Next: The MacFactory Class, Previous: Message Authentication Codes, Up: Message Authentication Codes
A key in the attributes map passed to the
initmethod. The value is taken to be a byte array, which contains the key as raw bytes. The length of the key must be at least the length of the computed hash in the case of hash-based MACs.
The actual size of the returned hash, taken from the first bytes of the raw result. The value must be a
java.lang.Integercontaining the desired length, which should not be smaller than 80 bits or one half the MAC's usual output length, whichever is larger.
Initializes this MAC instance with a specified attributes map, which maps keys (such as
MAC_KEY_MATERIAL) to parameters (such as the key bytes). Throws ajava.security.InvalidKeyExceptionif the key is unacceptable or omitted, and trows ajava.lang.IllegalStateExceptionif this instance has already been initialized.
Continues the computation of the MAC with a portion of the byte array in, starting at offset and considering length bytes.
Finishes the computation of the MAC and returns it in a new byte array. The instance is reset after this method returns.
Resets the internal state of this instance, which may then be re-initialized.