Methods Summary |
---|
public abstract java.lang.Object | clone()Clones the MessageDigest object.
|
public abstract int | digest(byte[] buf, int offset, int len)Completes the hash computation by performing final operations
such as padding. The digest is reset after this call is made.
|
public abstract java.lang.String | getAlgorithm()Gets the message digest algorithm.
|
public abstract int | getDigestLength()Gets the length (in bytes) of the hash.
|
public static com.sun.midp.crypto.MessageDigest | getInstance(java.lang.String algorithm)Generates a MessageDigest object that implements
the specified digest
algorithm.
if (algorithm == null || algorithm.length() == 0) {
throw new IllegalArgumentException();
}
algorithm = algorithm.toUpperCase();
if (algorithm.equals("MD2")) {
return new MD2();
} else if (algorithm.equals("MD5")) {
return new MD5();
} else if (algorithm.equals("SHA-1")) {
return new SHA();
}
throw new NoSuchAlgorithmException(algorithm);
|
public abstract void | reset()Resets the MessageDigest to the initial state for further use.
|
public abstract void | update(byte[] inBuf, int inOff, int inLen)Accumulates a hash of the input data. This method is useful when
the input data to be hashed is not available in one byte array.
|