Top Description Fields Constructors Methods
org.bouncycastle.asn1.pkcs

public Class PBKDF2Params

extends ASN1Object
Class Inheritance
Imports
java.math.BigInteger, java.util.Enumeration, org.bouncycastle.asn1.ASN1EncodableVector, .ASN1Integer, .ASN1Object, .ASN1OctetString, .ASN1Primitive, .ASN1Sequence, .DERNull, .DEROctetString, .DERSequence, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.util.Arrays

    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 }

Field Summary

Modifier and TypeField and Description
private static final AlgorithmIdentifier
private final ASN1Integer
private final ASN1Integer
private final ASN1OctetString
private final AlgorithmIdentifier

Constructor Summary

AccessConstructor and Description
public
PBKDF2Params(byte[]
input salt.
salt
,
int
input iteration count.
iterationCount
)

Create a PBKDF2Params with the specified salt, iteration count, and algid-hmacWithSHA1 for the prf.

public
PBKDF2Params(byte[]
input salt.
salt
,
int
input iteration count.
iterationCount
,
int
intended key length to be produced.
keyLength
)

Create a PBKDF2Params with the specified salt, iteration count, keyLength, and algid-hmacWithSHA1 for the prf.

public
PBKDF2Params(byte[]
input salt.
salt
,
int
input iteration count.
iterationCount
,
int
intended key length to be produced.
keyLength
,
AlgorithmIdentifier
the pseudo-random function to use.
prf
)

Create a PBKDF2Params with the specified salt, iteration count, keyLength, and a defined prf.

public
PBKDF2Params(byte[]
input salt.
salt
,
int
input iteration count.
iterationCount
,
AlgorithmIdentifier
the pseudo-random function to use.
prf
)

Create a PBKDF2Params with the specified salt, iteration count, and a defined prf.

private

Method Summary

Modifier and TypeMethod and Description
public static PBKDF2Params

Returns:

a PBKDF2Params instance.
getInstance
(Object
either PBKDF2Params or an ASN1Sequence.
obj
)

Create PBKDF2Params from the passed in object,

public BigInteger

Returns:

the input iteration count.
getIterationCount
()

Return the iteration count to use.

public BigInteger

Returns:

length in octets for derived key, if specified.
getKeyLength
()

Return the intended length in octets of the derived key.

public AlgorithmIdentifier

Returns:

the prf algorithm identifier.
getPrf
()

Return the algId of the underlying pseudo random function to use.

public byte[]

Returns:

the input salt.
getSalt
()

Return the salt to use.

public boolean

Returns:

true if PRF is default, false otherwise.
isDefaultPrf
()

Return true if the PRF is the default (hmacWithSHA1)

public ASN1Primitive

Returns:

the object as an ASN.1 encodable structure.
toASN1Primitive
()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Return an ASN.1 structure suitable for encoding.
Inherited from org.bouncycastle.asn1.ASN1Object:
encodeToencodeToequalsgetEncodedgetEncodedhasEncodedTagValuehashCode

Field Detail

algid_hmacWithSHA1back to summary
private static final AlgorithmIdentifier algid_hmacWithSHA1
iterationCountback to summary
private final ASN1Integer iterationCount
keyLengthback to summary
private final ASN1Integer keyLength
octStrback to summary
private final ASN1OctetString octStr
prfback to summary
private final AlgorithmIdentifier prf

Constructor Detail

PBKDF2Paramsback to summary
public PBKDF2Params(byte[] salt, int iterationCount)

Create a PBKDF2Params with the specified salt, iteration count, and algid-hmacWithSHA1 for the prf.

Parameters
salt:byte[]

input salt.

iterationCount:int

input iteration count.

PBKDF2Paramsback to summary
public PBKDF2Params(byte[] salt, int iterationCount, int keyLength)

Create a PBKDF2Params with the specified salt, iteration count, keyLength, and algid-hmacWithSHA1 for the prf.

Parameters
salt:byte[]

input salt.

iterationCount:int

input iteration count.

keyLength:int

intended key length to be produced.

PBKDF2Paramsback to summary
public PBKDF2Params(byte[] salt, int iterationCount, int keyLength, AlgorithmIdentifier prf)

Create a PBKDF2Params with the specified salt, iteration count, keyLength, and a defined prf.

Parameters
salt:byte[]

input salt.

iterationCount:int

input iteration count.

keyLength:int

intended key length to be produced.

prf:AlgorithmIdentifier

the pseudo-random function to use.

PBKDF2Paramsback to summary
public PBKDF2Params(byte[] salt, int iterationCount, AlgorithmIdentifier prf)

Create a PBKDF2Params with the specified salt, iteration count, and a defined prf.

Parameters
salt:byte[]

input salt.

iterationCount:int

input iteration count.

prf:AlgorithmIdentifier

the pseudo-random function to use.

PBKDF2Paramsback to summary
private PBKDF2Params(ASN1Sequence seq)

Method Detail

getInstanceback to summary
public static PBKDF2Params getInstance(Object obj)

Create PBKDF2Params from the passed in object,

Parameters
obj:Object

either PBKDF2Params or an ASN1Sequence.

Returns:PBKDF2Params

a PBKDF2Params instance.

getIterationCountback to summary
public BigInteger getIterationCount()

Return the iteration count to use.

Returns:BigInteger

the input iteration count.

getKeyLengthback to summary
public BigInteger getKeyLength()

Return the intended length in octets of the derived key.

Returns:BigInteger

length in octets for derived key, if specified.

getPrfback to summary
public AlgorithmIdentifier getPrf()

Return the algId of the underlying pseudo random function to use.

Returns:AlgorithmIdentifier

the prf algorithm identifier.

getSaltback to summary
public byte[] getSalt()

Return the salt to use.

Returns:byte[]

the input salt.

isDefaultPrfback to summary
public boolean isDefaultPrf()

Return true if the PRF is the default (hmacWithSHA1)

Returns:boolean

true if PRF is default, false otherwise.

toASN1Primitiveback to summary
public ASN1Primitive toASN1Primitive()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Return an ASN.1 structure suitable for encoding.

Returns:ASN1Primitive

the object as an ASN.1 encodable structure.