public class PBKDF2Params extends ASN1Object
PBKDF2-params ::= SEQUENCE { salt CHOICE { specified OCTET STRING, otherSource AlgorithmIdentifier {{PBKDF2-SaltSources}} }, iterationCount INTEGER (1..MAX), keyLength INTEGER (1..MAX) OPTIONAL, prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT algid-hmacWithSHA1 }
Constructor and Description |
---|
PBKDF2Params(byte[] salt,
int iterationCount)
Create a PBKDF2Params with the specified salt, iteration count, and algid-hmacWithSHA1 for the prf.
|
PBKDF2Params(byte[] salt,
int iterationCount,
AlgorithmIdentifier prf)
Create a PBKDF2Params with the specified salt, iteration count, and a defined prf.
|
PBKDF2Params(byte[] salt,
int iterationCount,
int keyLength)
Create a PBKDF2Params with the specified salt, iteration count, keyLength, and algid-hmacWithSHA1 for the prf.
|
PBKDF2Params(byte[] salt,
int iterationCount,
int keyLength,
AlgorithmIdentifier prf)
Create a PBKDF2Params with the specified salt, iteration count, keyLength, and a defined prf.
|
Modifier and Type | Method and Description |
---|---|
static PBKDF2Params |
getInstance(java.lang.Object obj)
Create PBKDF2Params from the passed in object,
|
java.math.BigInteger |
getIterationCount()
Return the iteration count to use.
|
java.math.BigInteger |
getKeyLength()
Return the intended length in octets of the derived key.
|
AlgorithmIdentifier |
getPrf()
Return the algId of the underlying pseudo random function to use.
|
byte[] |
getSalt()
Return the salt to use.
|
boolean |
isDefaultPrf()
Return true if the PRF is the default (hmacWithSHA1)
|
ASN1Primitive |
toASN1Primitive()
Return an ASN.1 structure suitable for encoding.
|
equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode, toASN1Object
public PBKDF2Params(byte[] salt, int iterationCount)
salt
- input salt.iterationCount
- input iteration count.public PBKDF2Params(byte[] salt, int iterationCount, int keyLength)
salt
- input salt.iterationCount
- input iteration count.keyLength
- intended key length to be produced.public PBKDF2Params(byte[] salt, int iterationCount, int keyLength, AlgorithmIdentifier prf)
salt
- input salt.iterationCount
- input iteration count.keyLength
- intended key length to be produced.prf
- the pseudo-random function to use.public PBKDF2Params(byte[] salt, int iterationCount, AlgorithmIdentifier prf)
salt
- input salt.iterationCount
- input iteration count.prf
- the pseudo-random function to use.public static PBKDF2Params getInstance(java.lang.Object obj)
obj
- either PBKDF2Params or an ASN1Sequence.public byte[] getSalt()
public java.math.BigInteger getIterationCount()
public java.math.BigInteger getKeyLength()
public boolean isDefaultPrf()
public AlgorithmIdentifier getPrf()
public ASN1Primitive toASN1Primitive()
toASN1Primitive
in interface ASN1Encodable
toASN1Primitive
in class ASN1Object