|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mozilla.jss.pkcs12.MacData
public class MacData
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(java.io.OutputStream ostream)
Write this value's DER encoding to an output stream using its own base tag. |
void |
encode(Tag implicitTag,
java.io.OutputStream ostream)
Write this value's DER encoding to an output stream using an implicit tag. |
DigestInfo |
getMac()
|
INTEGER |
getMacIterationCount()
|
OCTET_STRING |
getMacSalt()
|
Tag |
getTag()
Returns the base tag for this type, not counting any tags that may be imposed on it by its context. |
static MacData.Template |
getTemplate()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MacData()
public MacData(DigestInfo mac, OCTET_STRING macSalt, INTEGER macIterationCount)
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).public MacData(Password password, byte[] macSalt, int iterations, byte[] toBeMACed) throws CryptoManager.NotInitializedException, java.security.DigestException, TokenException, java.io.CharConversionException
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.
CryptoManager.NotInitializedException
- If the crypto subsystem
has not been initialized yet.
TokenException
- If an error occurs on a crypto token.
java.security.DigestException
java.io.CharConversionException
Method Detail |
---|
public DigestInfo getMac()
public OCTET_STRING getMacSalt()
public INTEGER getMacIterationCount()
public Tag getTag()
ASN1Value
getTag
in interface ASN1Value
public void encode(java.io.OutputStream ostream) throws java.io.IOException
ASN1Value
encode
in interface ASN1Value
java.io.IOException
public void encode(Tag implicitTag, java.io.OutputStream ostream) throws java.io.IOException
ASN1Value
encode
in interface ASN1Value
java.io.IOException
public static final MacData.Template getTemplate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |