|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sshtools.util.Hash
Template helper class for Hash alogorithms, wraps the MessageDigest class from the java.security package
Constructor Summary | |
Hash(java.lang.String algorithm)
Constructor for the Hash object |
Method Summary | |
byte[] |
doFinal()
Description of the Method |
void |
putBigInteger(java.math.BigInteger bi)
Puts a BigInteger into the hash. |
void |
putByte(byte b)
Puts a byte into the hash |
void |
putBytes(byte[] data)
Puts an array of bytes into the hash |
void |
putInt(int i)
Puts an integer into the hash. |
void |
putString(java.lang.String str)
Puts a string into the hash. |
void |
reset()
Resets the hash; |
static byte[] |
simple(byte[] data,
java.lang.String algorithm)
Puts the data into a new instance of the algorithm message digest and returns the output. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Hash(java.lang.String algorithm) throws java.security.NoSuchAlgorithmException
algorithm
- The algorithm to use
java.security.NoSuchAlgorithmException
- Thrown if the algorithm is not
supportedMethod Detail |
public void putString(java.lang.String str)
str
- The string to hashpublic void reset()
public void putInt(int i)
i
- The integer valuepublic void putBytes(byte[] data)
data
- The byte array to hashpublic void putByte(byte b)
b
- The byte to hashpublic void putBigInteger(java.math.BigInteger bi)
bi
- The BigInteger to hashpublic static byte[] simple(byte[] data, java.lang.String algorithm) throws java.security.NoSuchAlgorithmException
data
- The data to hashalgorithm
- The algorithm to use
java.security.NoSuchAlgorithmException
- Thrown of the algorithm is not
supportedpublic byte[] doFinal()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |