public abstract class LunaDigest extends MessageDigestSpi
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
mByteArray |
protected long |
mMechType |
| Modifier | Constructor and Description |
|---|---|
protected |
LunaDigest(long mechType)
Creates a new LunaDigest using a PKCS11 mechanism type to specify the
digest type.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Cloning is not supported for Luna message digests.
|
protected byte[] |
engineDigest()
Runs the hash computation on the accumulated data and returns the
result in a new byte array.
|
protected int |
engineDigest(byte[] output,
int offset,
int len)
Runs the hash computation on the accumulated data and copies the result
into the specified buffer.
|
protected abstract int |
engineGetDigestLength()
Returns the digest length in bytes.
|
protected void |
engineReset()
Resets the digest for further use.
|
protected void |
engineUpdate(byte input)
Updates the digest using the specified byte.
|
protected void |
engineUpdate(byte[] input,
int offset,
int len)
Updates the digest using the specified array of bytes, starting at the
specified offset.
|
protected void |
engineUpdate(ByteBuffer buff) |
protected LunaDigest(long mechType)
mechType - PKCS11 mechanism type for this digestprotected void engineReset()
engineReset in class MessageDigestSpiprotected void engineUpdate(byte input)
engineUpdate in class MessageDigestSpiinput - The byte to use for the updateprotected void engineUpdate(byte[] input,
int offset,
int len)
engineUpdate in class MessageDigestSpiinput - 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 offsetprotected void engineUpdate(ByteBuffer buff)
engineUpdate in class MessageDigestSpiprotected byte[] engineDigest()
engineDigest in class MessageDigestSpiprotected int engineDigest(byte[] output,
int offset,
int len)
throws DigestException
engineDigest in class MessageDigestSpioutput - The digest is copied into this buffer. A DigestException
will be thrown if the buffer from the offset forward is
too short to contain the digest outputoffset - Offset into the destination bufferlen - The amount of the buffer to use for the digest. A
DigestException is thrown if this value is less than
the size of the digestDigestException - The given output buffer is too smallprotected abstract int engineGetDigestLength()
engineGetDigestLength in class MessageDigestSpipublic Object clone() throws CloneNotSupportedException
clone in class MessageDigestSpiCloneNotSupportedException - exceptionCopyright 2014-2016 SafeNet Inc