public class DigestAlgorithm extends java.lang.Object implements Algorithm
name | values | description | required |
---|---|---|---|
algorithm.algorithm | MD5 | SHA (default provider) | name of the algorithm the provider should use | no, defaults to MD5 |
algorithm.provider | name of the provider to use | no, defaults to null |
Constructor and Description |
---|
DigestAlgorithm() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getValue(java.io.File file)
Computes a value for a file content with the specified digest algorithm.
|
void |
initMessageDigest()
Initialize the security message digest.
|
boolean |
isValid()
This algorithm supports only MD5 and SHA.
|
void |
setAlgorithm(java.lang.String algorithm)
Specifies the algorithm to be used to compute the checksum.
|
void |
setProvider(java.lang.String provider)
Sets the MessageDigest algorithm provider to be used
to calculate the checksum.
|
java.lang.String |
toString()
Override Object.toString().
|
public void setAlgorithm(java.lang.String algorithm)
algorithm
- the digest algorithm to usepublic void setProvider(java.lang.String provider)
provider
- provider to usepublic void initMessageDigest()
public boolean isValid()
public java.lang.String getValue(java.io.File file)
public java.lang.String toString()
toString
in class java.lang.Object