|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.planets_project.services.utils.Checksums
public class Checksums
Checksums util class.
Constructor Summary | |
---|---|
Checksums()
|
Method Summary | |
---|---|
static byte[] |
digest(String algorithm,
byte[] in)
Calculate the checksum of a byte array. |
static byte[] |
digest(String algorithm,
File in)
Calculate the checksum of a given File . |
static byte[] |
digest(String algorithm,
InputStream in)
Calculate the checksum of a given InputStream . |
static byte[] |
digest(String algorithm,
String in)
Calculate the checksum of a given String . |
static byte[] |
md5(File in)
Calculate the MD5 checksum of a File . |
static byte[] |
md5(InputStream in)
Calculate the MD5 checksum of a given stream. |
static byte[] |
md5(String in)
Calculate the MD5 checksum of a string. |
static byte[] |
sha1(File in)
Calculate the SHA-1 checksum of a File . |
static byte[] |
sha1(InputStream in)
Calculate the SHA-1 checksum of a given stream. |
static byte[] |
sha1(String in)
Calculate the SHA-1 checksum of a string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Checksums()
Method Detail |
---|
public static byte[] digest(String algorithm, InputStream in) throws IOException, NoSuchAlgorithmException
InputStream
.
The stream is guaranteed to be closed after ended operation.
algorithm
- the algorithm to use to compute the digest. Possbile values can be found in the Java CryptoSpec.in
- the stream to digest
IOException
- if there is an error reading the input stream
NoSuchAlgorithmException
- if the algorithm requested in algorithm
isn't known to the jvm.public static byte[] digest(String algorithm, byte[] in) throws NoSuchAlgorithmException
algorithm
- the algorithm to use to compute the digest. Possbile values can be found in the Java CryptoSpec.in
- array the byte array to compute the digest of
NoSuchAlgorithmException
- if the algorithm requested in algorithm
isn't known to the jvm.public static byte[] digest(String algorithm, String in) throws NoSuchAlgorithmException
String
.
NoSuchAlgorithmException
digest(String, java.io.InputStream)
public static byte[] digest(String algorithm, File in) throws NoSuchAlgorithmException, IOException
File
.
NoSuchAlgorithmException
IOException
digest(String, java.io.InputStream)
public static byte[] sha1(InputStream in) throws IOException
SHA-1
checksum of a given stream.
IOException
- if there is an error reading the streampublic static byte[] sha1(String in)
SHA-1
checksum of a string.
DigestException
- if the JVM doesn't know the SHA-1
algorithmpublic static byte[] sha1(File in) throws IOException
SHA-1
checksum of a File
.
IOException
- if there is an error reading the file
DigestException
- if the JVM doesn't know the SHA-1
algorithmpublic static byte[] md5(InputStream in) throws IOException
MD5
checksum of a given stream.
IOException
- if there is an error reading the stream
DigestException
- if the JVM doesn't know the MD5
algorithmpublic static byte[] md5(String in)
MD5
checksum of a string.
DigestException
- if the JVM doesn't know the MD5
algorithmpublic static byte[] md5(File in) throws IOException
MD5
checksum of a File
.
IOException
- if there is an error reading the file
DigestException
- if the JVM doesn't know the MD5
algorithm
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |