|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.novell.java.security.MessageDigestSpi
Defines the Service Provider Interface (SPI) for the MessageDigest class. The MessageDigest class provides the functionality of a message digest algorithm, such as MD5 or SHA. Message digests are secure one-way hash functions that take arbitrary-sized data and output a fixed-length hash value.
All the abstract methods in this class must be implemented by a cryptographic service provider who wishes to supply the implementation of a particular message digest algorithm. Implementations are free to implement the Cloneable interface.
MessageDigest
Constructor Summary | |
MessageDigestSpi()
|
Method Summary | |
java.lang.Object |
clone()
Creates a new message digest object of the same class as this message digest object. |
protected abstract byte[] |
engineDigest()
Completes the hash computation by performing final operations such as padding. |
protected int |
engineDigest(byte[] buf,
int offset,
int len)
Completes the hash computation by performing final operation such as padding. |
protected int |
engineGetDigestLength()
Returns the message digest length in bytes. |
protected abstract void |
engineReset()
Resets the digest for further use. |
protected abstract void |
engineUpdate(byte input)
Updates the message digest using the specified byte. |
protected abstract void |
engineUpdate(byte[] input,
int offset,
int len)
Updates the message digest using the specified array of bytes, starting at the specified offset. |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public MessageDigestSpi()
Method Detail |
protected int engineGetDigestLength()
protected abstract void engineUpdate(byte input)
input
- The byte to use for updating the message digest.protected abstract void engineUpdate(byte[] input, int offset, int len)
input
- The array of bytes to use for updating the
message digest.offset
- The offset in the array of bytes from which to
start.len
- The number of bytes to use, starting at offset.protected abstract byte[] engineDigest()
protected int engineDigest(byte[] buf, int offset, int len) throws DigestException
This method should be abstract, but we leave it concrete for binary compatibility. Knowledgeable providers should override this method. Both this default implementation and the SUN provider do not return partial digests. The presence of the len parameter is solely for consistency in our APIs. If the value of the len parameter is less than the actual digest length, the method will throw a DigestException. The len parameter is ignored if its value is greater than or equal to the actual digest length.
buf
- The output buffer in which to store the message
digest.offset
- The offset in the output buffer from which to
start.len
- The number of bytes within the output buffer (buf)
allotted for the digest.protected abstract void engineReset()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |