Methods Summary |
---|
public java.lang.Object | clone()
return super.clone();
|
protected abstract byte[] | engineDigest()Computes and returns the final hash value for this
{@link MessageDigestSpi}. After the digest is computed the receiver is
reset.
|
protected int | engineDigest(byte[] buf, int offset, int len)Computes and stores the final hash value for this
{@link MessageDigestSpi}. After the digest is computed the receiver is
reset.
if (len < engineGetDigestLength()) {
engineReset();
throw new DigestException(Messages.getString("security.1B")); //$NON-NLS-1$
}
if (offset < 0) {
engineReset();
throw new DigestException(Messages.getString("security.1C")); //$NON-NLS-1$
}
if (offset + len > buf.length) {
engineReset();
throw new DigestException(Messages.getString("security.1D")); //$NON-NLS-1$
}
byte tmp[] = engineDigest();
if (len < tmp.length) {
throw new DigestException(Messages.getString("security.1B")); //$NON-NLS-1$
}
System.arraycopy(tmp, 0, buf, offset, tmp.length);
return tmp.length;
|
protected int | engineGetDigestLength()Returns the engine digest length in bytes. If the implementation does not
implement this function {@code 0} is returned.
return 0;
|
protected abstract void | engineReset()Puts this {@code MessageDigestSpi} back in an initial state, such that it
is ready to compute a one way hash value.
|
protected abstract void | engineUpdate(byte input)Updates this {@code MessageDigestSpi} using the given {@code byte}.
|
protected abstract void | engineUpdate(byte[] input, int offset, int len)Updates this {@code MessageDigestSpi} using the given {@code byte[]}.
|
protected void | engineUpdate(java.nio.ByteBuffer input)Updates this {@code MessageDigestSpi} using the given {@code input}.
if (!input.hasRemaining()) {
return;
}
byte[] tmp;
if (input.hasArray()) {
tmp = input.array();
int offset = input.arrayOffset();
int position = input.position();
int limit = input.limit();
engineUpdate(tmp, offset+position, limit - position);
input.position(limit);
} else {
tmp = new byte[input.limit() - input.position()];
input.get(tmp);
engineUpdate(tmp, 0, tmp.length);
}
|