public class Base64ChecksumGenerator extends BasicChecksumGenerator
ChecksumGenerator
that return Base64-encoded
checksums using algorithms from java.security.MessageDigest
.MessageDigest
Constructor and Description |
---|
Base64ChecksumGenerator(java.lang.String algorithm)
Constructs a
Base64ChecksumGenerator that uses the specified
message digest algorithm. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getChecksum(java.io.InputStream in)
Returns a Base64 encoded representation of the message digest
checksum of the input stream.
|
getChecksum
public Base64ChecksumGenerator(java.lang.String algorithm)
Base64ChecksumGenerator
that uses the specified
message digest algorithm. The supported algorithms are:
"MD2"
,
"MD5"
,
"SHA-1"
,
"SHA-256"
,
"SHA-384"
, and
"SHA-512"
algorithm
- message digest algorithmpublic java.lang.String getChecksum(java.io.InputStream in) throws java.io.IOException
getChecksum
in interface ChecksumGenerator
getChecksum
in class BasicChecksumGenerator
in
- input stream to create a checksum forin
java.io.IOException
- if there is an error reading the input stream