de.flexiprovider.api
Class MessageDigest
java.lang.Object
|
+--java.security.MessageDigestSpi
|
+--de.flexiprovider.api.MessageDigest
- Direct Known Subclasses:
- DHA256, FORK256, MDFamilyDigest, MessageDigestWrapper, NullDigest, SHA1, SHA224_256, SHA384_512, SWIFFTX224, SWIFFTX256, SWIFFTX384, SWIFFTX512, Tiger, VSH
- public abstract class MessageDigest
- extends java.security.MessageDigestSpi
|
Method Summary |
abstract byte[] |
digest()
Complete the hash computation by performing final operations such as
padding. |
byte[] |
digest(byte[] input)
Update the digest and complete the hash computation by performing final
operations such as padding. |
int |
digest(byte[] buf,
int offset,
int len)
Complete the hash computation by performing final operations such as
padding. |
protected byte[] |
engineDigest()
|
protected int |
engineGetDigestLength()
|
protected void |
engineReset()
|
protected void |
engineUpdate(byte input)
|
protected void |
engineUpdate(byte[] input,
int offset,
int len)
|
abstract int |
getDigestLength()
|
abstract void |
reset()
Reset the digest for further use. |
abstract void |
update(byte input)
Update the digest using the specified byte. |
void |
update(byte[] input)
Update the digest using the specified array of bytes, starting at the
specified offset. |
abstract void |
update(byte[] input,
int offset,
int len)
Update the digest using the specified array of bytes, starting at the
specified offset. |
| Methods inherited from class java.security.MessageDigestSpi |
clone, engineDigest |
| Methods inherited from class java.lang.Object |
, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageDigest
public MessageDigest()
engineGetDigestLength
protected final int engineGetDigestLength()
- Overrides:
engineGetDigestLength in class java.security.MessageDigestSpi
engineUpdate
protected final void engineUpdate(byte input)
- Overrides:
engineUpdate in class java.security.MessageDigestSpi
engineUpdate
protected final void engineUpdate(byte[] input,
int offset,
int len)
- Overrides:
engineUpdate in class java.security.MessageDigestSpi
engineDigest
protected final byte[] engineDigest()
- Overrides:
engineDigest in class java.security.MessageDigestSpi
engineReset
protected final void engineReset()
- Overrides:
engineReset in class java.security.MessageDigestSpi
getDigestLength
public abstract int getDigestLength()
- Returns:
- the digest length in bytes
update
public abstract void update(byte input)
- Update the digest using the specified byte.
- Parameters:
input - the byte to use for the update
update
public final void update(byte[] input)
- Update the digest using the specified array of bytes, starting at the
specified offset.
- Parameters:
input - the array of bytes to use for the update
update
public abstract void update(byte[] input,
int offset,
int len)
- Update the digest using the specified array of bytes, starting at the
specified offset.
- Parameters:
input - the array of bytes to use for the updateoffset - the offset to start from in the array of byteslen - the number of bytes to use, starting at offset
digest
public abstract byte[] digest()
- Complete the hash computation by performing final operations such as
padding. Once
digest() has been called, the engine should be
reset (see reset()). Resetting is the responsibility of the
engine implementor.
- Returns:
- the array of bytes for the resulting hash value.
digest
public final byte[] digest(byte[] input)
- Update the digest and complete the hash computation by performing final
operations such as padding. Once
digest(byte[]) has been called,
the engine should be reset (see reset()). Resetting is the
responsibility of the engine implementor.
- Parameters:
input - the array of bytes to use for the update- Returns:
- the array of bytes for the resulting hash value
digest
public final int digest(byte[] buf,
int offset,
int len)
throws DigestException
- Complete the hash computation by performing final operations such as
padding. Once
digest(byte[], int, int) has been called, the
engine should be reset (see reset()). Resetting is the
responsibility of the engine implementor.
- Parameters:
buf - the output buffer in which to store the digestoffset - offset to start from in the output bufferlen - number of bytes within buf allotted for the digest. Both
this default implementation and the SUN provider do not
return partial digests. The presence of this parameter is
solely for consistency in our API's. If the value of this
parameter is less than the actual digest length, the
method will throw a DigestException. This parameter is
ignored if its value is greater than or equal to the
actual digest length.- Returns:
- the length of the digest stored in the output buffer.
- Throws:
DigestException - if an error occurs.
reset
public abstract void reset()
- Reset the digest for further use.