java.lang.Object
java.security.MessageDigestSpi
com.ibm.crypto.hdwrCCA.provider.MD2
- All Implemented Interfaces:
Cloneable
The MD2 class is used to compute an MD2 message digest over a given
buffer of bytes. It is an implementation of the RSA Data Security Inc.
MD2 algorithim as described in internet RFC 1319.
-
Constructor Summary
ConstructorsConstructorDescriptionMD2()Standard constructor, creates a new MD2 instance, allocates its buffers from the heap. -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones this object.protected byte[]Computes and returns the MD2 hash.protected intengineDigest(byte[] buf, int offset, int len) Computes and returns the MD2 hash in the buffer provided.protected intReturn the digest length in bytes.protected voidResets the MD2 information back to starting values.protected voidengineUpdate(byte b) Update adds the passed byte to the digested data.protected voidengineUpdate(byte[] input, int offset, int len) Update adds the selected part of an array of bytes to the digest.voidinit()Initialize the MD2 information.Methods inherited from class java.security.MessageDigestSpi
engineUpdate
-
Constructor Details
-
MD2
public MD2()Standard constructor, creates a new MD2 instance, allocates its buffers from the heap.
-
-
Method Details
-
init
public void init()Initialize the MD2 information. -
engineReset
protected void engineReset()Resets the MD2 information back to starting values.- Specified by:
engineResetin classMessageDigestSpi
-
engineGetDigestLength
protected int engineGetDigestLength()Return the digest length in bytes.- Overrides:
engineGetDigestLengthin classMessageDigestSpi
-
engineUpdate
protected void engineUpdate(byte b) Update adds the passed byte to the digested data.- Specified by:
engineUpdatein classMessageDigestSpi
-
engineUpdate
protected void engineUpdate(byte[] input, int offset, int len) Update adds the selected part of an array of bytes to the digest. This version is more efficient than the byte-at-a-time version; it avoids data copies and reduces per-byte call overhead.- Specified by:
engineUpdatein classMessageDigestSpi
-
engineDigest
protected byte[] engineDigest()Computes and returns the MD2 hash.- Specified by:
engineDigestin classMessageDigestSpi- Returns:
- the MD2 hash.
-
engineDigest
Computes and returns the MD2 hash in the buffer provided.- Overrides:
engineDigestin classMessageDigestSpi- Parameters:
buf- the buffer to put the MD2 hash into.offset- is the offset in the buffer into which to copy the hash.len- the length of the buffer.- Throws:
DigestException- is thrown when the array is not large enough for the digest.
-
clone
Clones this object.- Overrides:
clonein classMessageDigestSpi- Returns:
- Returns a new MD2 hash object like this one.
-