com.ibm.crypto.hdwrCCA.provider
Class MD5
- java.lang.Object
-
- java.security.MessageDigestSpi
-
- com.ibm.crypto.hdwrCCA.provider.MD5
-
- All Implemented Interfaces:
- java.lang.Cloneable
public final class MD5 extends java.security.MessageDigestSpi implements java.lang.CloneableThe MD5 class is used to compute an MD5 message digest over a given buffer of bytes. It is an implementation of the RSA Data Security Inc. MD5 algorithm as described in Internet RFC 1321. This is done via a hardware crypto call.
-
-
Constructor Summary
Constructors Constructor and Description MD5()Standard constructor, creates a new MD5 instance, allocates its buffers from the heap.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Objectclone()Clones this object.protected byte[]engineDigest()Computes and returns the MD5 hash.protected intengineDigest(byte[] buf, int offset, int len)Computes and returns the MD5 hash in the buffer provided.protected intengineGetDigestLength()Return the digest length in bytes.protected voidengineReset()Resets the MD5 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 MD5 information for this object.
-
-
-
Constructor Detail
-
MD5
public MD5()
Standard constructor, creates a new MD5 instance, allocates its buffers from the heap.
-
-
Method Detail
-
init
public void init()
Initialize the MD5 information for this object.
-
engineReset
protected void engineReset()
Resets the MD5 information back to starting values.- Specified by:
engineResetin classjava.security.MessageDigestSpi
-
engineGetDigestLength
protected int engineGetDigestLength()
Return the digest length in bytes.- Overrides:
engineGetDigestLengthin classjava.security.MessageDigestSpi
-
engineUpdate
protected void engineUpdate(byte b)
Update adds the passed byte to the digested data.- Specified by:
engineUpdatein classjava.security.MessageDigestSpi- Parameters:
b- is the byte to add to the digest.
-
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 classjava.security.MessageDigestSpi- Parameters:
input- array used to update the digest.offset- the offset into the array.len- the length of the array.
-
engineDigest
protected byte[] engineDigest()
Computes and returns the MD5 hash.- Specified by:
engineDigestin classjava.security.MessageDigestSpi- Returns:
- the MD5 hash.
-
engineDigest
protected int engineDigest(byte[] buf, int offset, int len) throws java.security.DigestExceptionComputes and returns the MD5 hash in the buffer provided.- Overrides:
engineDigestin classjava.security.MessageDigestSpi- Parameters:
buf- the buffer to put the MD5 hash into.offset- is the offset in the buffer into which to copy the hash.len- the length of the buffer.- Throws:
java.security.DigestException- is thrown when the array is not large enough to hold the digest.
-
clone
public java.lang.Object clone()
Clones this object.- Overrides:
clonein classjava.security.MessageDigestSpi
-
-