|
JSS 3.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mozilla.jss.crypto.JSSMessageDigest | +--org.mozilla.jss.pkcs11.PK11MessageDigest
Message Digesting with PKCS #11.
Field Summary | |
private DigestAlgorithm |
alg
|
private CipherContextProxy |
digestProxy
|
private PK11SymKey |
hmacKey
|
private PK11Token |
token
|
Constructor Summary | |
(package private) |
PK11MessageDigest(PK11Token token,
DigestAlgorithm alg)
|
Method Summary | |
int |
digest(byte[] outbuf,
int offset,
int len)
Completes digesting, storing the result into the provided array. |
private static int |
digest(CipherContextProxy proxy,
byte[] outbuf,
int offset,
int len)
|
DigestAlgorithm |
getAlgorithm()
Returns the algorithm that this digest uses. |
private static CipherContextProxy |
initDigest(DigestAlgorithm alg)
|
private static CipherContextProxy |
initHMAC(PK11Token token,
DigestAlgorithm alg,
PK11SymKey key)
|
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. |
private static void |
update(CipherContextProxy proxy,
byte[] inbuf,
int offset,
int len)
|
Methods inherited from class org.mozilla.jss.crypto.JSSMessageDigest |
digest, digest, getOutputSize, update, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private PK11Token token
private CipherContextProxy digestProxy
private PK11SymKey hmacKey
private DigestAlgorithm alg
Constructor Detail |
PK11MessageDigest(PK11Token token, DigestAlgorithm alg) throws java.security.NoSuchAlgorithmException, java.security.DigestException
Method Detail |
public void initHMAC(SymmetricKey key) throws java.security.DigestException, java.security.InvalidKeyException
JSSMessageDigest
initHMAC
in class JSSMessageDigest
java.security.InvalidKeyException
- If the given key is not valid.
java.security.DigestException
- If this algorithm is not an HMAC algorithm.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
public DigestAlgorithm getAlgorithm()
JSSMessageDigest
getAlgorithm
in class JSSMessageDigest
private static CipherContextProxy initDigest(DigestAlgorithm alg) throws java.security.DigestException
java.security.DigestException
private static CipherContextProxy initHMAC(PK11Token token, DigestAlgorithm alg, PK11SymKey key) throws java.security.DigestException
java.security.DigestException
private static void update(CipherContextProxy proxy, byte[] inbuf, int offset, int len)
private static int digest(CipherContextProxy proxy, byte[] outbuf, int offset, int len)
|
JSS 3.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |