public abstract class LunaDigest
extends java.security.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 |
---|---|
java.lang.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(java.nio.ByteBuffer buff) |
protected LunaDigest(long mechType)
mechType
- PKCS11 mechanism type for this digestprotected void engineReset()
engineReset
in class java.security.MessageDigestSpi
protected void engineUpdate(byte input)
engineUpdate
in class java.security.MessageDigestSpi
input
- The byte to use for the updateprotected void engineUpdate(byte[] input, int offset, int len)
engineUpdate
in class java.security.MessageDigestSpi
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
protected void engineUpdate(java.nio.ByteBuffer buff)
engineUpdate
in class java.security.MessageDigestSpi
protected byte[] engineDigest()
engineDigest
in class java.security.MessageDigestSpi
protected int engineDigest(byte[] output, int offset, int len) throws java.security.DigestException
engineDigest
in class java.security.MessageDigestSpi
output
- 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 digestjava.security.DigestException
- The given output buffer is too smallprotected abstract int engineGetDigestLength()
engineGetDigestLength
in class java.security.MessageDigestSpi
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.security.MessageDigestSpi
java.lang.CloneNotSupportedException
- exceptionCopyright 2014-2018 SafeNet. All rights reserved.