Package netscape.security.provider
Class MD5
- java.lang.Object
-
- java.security.MessageDigestSpi
-
- netscape.security.provider.MD5
-
- All Implemented Interfaces:
java.lang.Cloneable
public final class MD5 extends java.security.MessageDigestSpi implements java.lang.Cloneable
The 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 algorithim as described in internet RFC 1321.- Version:
- 1.24 97/12/10
- Author:
- Chuck McManis, Benjamin Renaud
-
-
Constructor Summary
Constructors Constructor 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 Description java.lang.Object
clone()
protected byte[]
engineDigest()
protected int
engineDigest(byte[] buf, int offset, int len)
protected int
engineGetDigestLength()
Return the digest length in bytesprotected void
engineReset()
protected void
engineUpdate(byte b)
Update adds the passed byte to the digested data.protected void
engineUpdate(byte[] input, int offset, int len)
Update adds the selected part of an array of bytes to the digest.void
init()
Initialize the MD5 state information and reset the bit count to 0.
-
-
-
Method Detail
-
init
public void init()
Initialize the MD5 state information and reset the bit count to 0. Given this implementation you are constrained to counting 2^64 bits.
-
engineReset
protected void engineReset()
- Specified by:
engineReset
in classjava.security.MessageDigestSpi
-
engineGetDigestLength
protected int engineGetDigestLength()
Return the digest length in bytes- Overrides:
engineGetDigestLength
in classjava.security.MessageDigestSpi
-
engineUpdate
protected void engineUpdate(byte b)
Update adds the passed byte to the digested data.- Specified by:
engineUpdate
in classjava.security.MessageDigestSpi
-
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:
engineUpdate
in classjava.security.MessageDigestSpi
-
engineDigest
protected byte[] engineDigest()
- Specified by:
engineDigest
in classjava.security.MessageDigestSpi
-
engineDigest
protected int engineDigest(byte[] buf, int offset, int len) throws java.security.DigestException
- Overrides:
engineDigest
in classjava.security.MessageDigestSpi
- Throws:
java.security.DigestException
-
clone
public java.lang.Object clone()
- Overrides:
clone
in classjava.security.MessageDigestSpi
-
-