public class Sha1Digest extends Object implements MessageDigest
| Constructor and Description |
|---|
Sha1Digest() |
| Modifier and Type | Method and Description |
|---|---|
String |
calculate(File file)
Calculates the message digest for a input stream
|
String |
calculate(InputStream inputStream)
Calculates the message digest for a input stream
|
String |
calculate(String path)
Calculates the message digest for a input stream
|
void |
save(String source)
Saves the message digest for the source file
|
boolean |
verify(String source)
Verify the message digest for a file
|
boolean |
verify(String source,
String digest)
Verify the message digest for a file
|
public String calculate(InputStream inputStream) throws IOException
MessageDigestcalculate in interface MessageDigestinputStream - The input streamIOException - If unable to read from the input streampublic String calculate(File file) throws IOException
MessageDigestcalculate in interface MessageDigestfile - input file to calculate the message streamIOException - If unable to read the file (ie.: not found)public String calculate(String path) throws IOException
MessageDigestcalculate in interface MessageDigestpath - The path to the file to calculate the digestIOException - If unable to read the file or if unable to read from
the input streampublic boolean verify(String source) throws IOException
MessageDigestverify in interface MessageDigestsource - The (path to the) source fileIOException - on I/O errorspublic boolean verify(String source, String digest) throws IOException
MessageDigestverify in interface MessageDigestsource - The (path to the) source filedigest - The message digest to verify againstIOException - If unable to read the file or if unable to read from
the input streampublic void save(String source) throws IOException
MessageDigestsave in interface MessageDigestsource - the (path to the) source fileIOException - If unable to read the file or if unable to read from
the input streamThis documentation was released into the public domain.