public final class PK11MessageDigest extends JSSMessageDigest implements java.lang.AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
digest(byte[] outbuf,
int offset,
int len)
Completes digesting, storing the result into the provided array.
|
void |
finalize() |
DigestAlgorithm |
getAlgorithm() |
void |
initHMAC(SymmetricKey key)
Initializes an HMAC digest with the given symmetric key.
|
void |
reset()
Resets this digest for further use.
|
void |
update(byte[] input,
int offset,
int len)
Updates the digest with a portion of an array.
|
digest, digest, getOutputSize, update, update
public void initHMAC(SymmetricKey key) throws java.security.DigestException, java.security.InvalidKeyException
JSSMessageDigest
initHMAC
in class JSSMessageDigest
key
- Symmetric key.java.security.DigestException
- If this algorithm is not an HMAC algorithm.java.security.InvalidKeyException
- If the given key is not valid.public void update(byte[] input, int offset, int len) throws java.security.DigestException
JSSMessageDigest
update
in class JSSMessageDigest
input
- An array from which to update the digest.offset
- The index in the array at which to start digesting.len
- The number of bytes to digest.java.security.DigestException
- If an error occurs while digesting.public int digest(byte[] outbuf, int offset, int len) throws java.security.DigestException
JSSMessageDigest
digest
in class JSSMessageDigest
outbuf
- The buffer in which to place the digest output.offset
- The offset in the buffer at which to store the output.len
- The amount of space available in the buffer for the
digest output.java.security.DigestException
- If the provided space is too small for
the digest, or an error occurs with the digest.public void reset() throws java.security.DigestException
JSSMessageDigest
reset
in class JSSMessageDigest
java.security.DigestException
- If an error occurred.public DigestAlgorithm getAlgorithm()
getAlgorithm
in class JSSMessageDigest
public void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void close() throws java.lang.Exception
close
in interface java.lang.AutoCloseable
java.lang.Exception