Overview | Package | Class | Tree | Deprecated | Index | Help
| JSS 3.3
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mozilla.jss.pkcs11
Class PK11MessageDigest

    java.lang.Object
      |
      +--org.mozilla.jss.crypto.JSSMessageDigest
            |
            +--org.mozilla.jss.pkcs11.PK11MessageDigest

public final class PK11MessageDigest
extends JSSMessageDigest

Message Digesting with PKCS #11.

Method Summary
`int` | `digest(byte[] outbuf, int offset, int len)` Completes digesting, storing the result into the provided array.
`DigestAlgorithm` | `getAlgorithm()` Returns the algorithm that this digest uses.
`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.

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`

Method Detail

### initHMAC

    public void initHMAC(SymmetricKey key)
                  throws java.security.DigestException,
                         java.security.InvalidKeyException

  Description copied from class: `JSSMessageDigest`
  Initializes an HMAC digest with the given symmetric key. This also has the effect of resetting the digest.

  Specified by:
    `initHMAC` in class `JSSMessageDigest`
  Throws:
    `java.security.InvalidKeyException` - If the given key is not valid.
    `java.security.DigestException` - If this algorithm is not an HMAC algorithm.

### update

    public void update(byte[] input,
                       int offset,
                       int len)
                throws java.security.DigestException

  Description copied from class: `JSSMessageDigest`
  Updates the digest with a portion of an array.

  Specified by:
    `update` in class `JSSMessageDigest`
  Parameters:
    `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.
  Throws:
    `java.security.DigestException` - If an error occurs while digesting.

### digest

    public int digest(byte[] outbuf,
                      int offset,
                      int len)
               throws java.security.DigestException

  Description copied from class: `JSSMessageDigest`
  Completes digesting, storing the result into the provided array.

  Specified by:
    `digest` in class `JSSMessageDigest`
  Parameters:
    `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.
  Returns:
    The number of bytes actually stored into buf.
  Throws:
    `java.security.DigestException` - If the provided space is too small for the digest, or an error occurs with the digest.

### reset

    public void reset()
               throws java.security.DigestException

  Description copied from class: `JSSMessageDigest`
  Resets this digest for further use. This clears all input and output streams. If this is an HMAC digest, the HMAC key is not cleared.

  Specified by:
    `reset` in class `JSSMessageDigest`
    `java.security.DigestException`

### getAlgorithm

    public DigestAlgorithm getAlgorithm()

  Description copied from class: `JSSMessageDigest`
  Returns the algorithm that this digest uses.

  Specified by:
    `getAlgorithm` in class `JSSMessageDigest`

Overview | Package | Class | Tree | Deprecated | Index | Help
| JSS 3.3
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD