org.mozilla.jss.pkcs12
public class MacData extends Object implements ASN1Value
Nested Class Summary | |
---|---|
static class | MacData.Template
A Template for decoding a MacData from its BER encoding. |
Constructor Summary | |
---|---|
MacData() | |
MacData(DigestInfo mac, OCTET_STRING macSalt, INTEGER macIterationCount)
Creates a MacData from the given parameters.
| |
MacData(Password password, byte[] macSalt, int iterations, byte[] toBeMACed)
Creates a MacData by computing a HMAC on the given bytes. |
Method Summary | |
---|---|
void | encode(OutputStream ostream) |
void | encode(Tag implicitTag, OutputStream ostream) |
DigestInfo | getMac() |
INTEGER | getMacIterationCount() |
OCTET_STRING | getMacSalt() |
Tag | getTag() |
static MacData.Template | getTemplate() |
Parameters: macIterationCount 1 is the default and should be used for maximum compatibility. null can also be used, in which case the macIterationCount will be omitted from the structure (and the default value of 1 will be implied).
Parameters: password The password used to generate a key using a PBE mechanism. macSalt The salt used as input to the PBE key generation mechanism. If null is passed in, new random salt will be created. iterations The iteration count for creating the PBE key. toBeMACed The data on which the HMAC will be computed.
Throws: CryptoManager.NotInitializedException If the crypto subsystem has not been initialized yet. TokenException If an error occurs on a crypto token.