Top Description Fields Constructors Methods
org.bouncycastle.jcajce.spec

public Class PBKDF2ParameterSpec

extends PBEParameterSpec
Class Inheritance
Imports
javax.crypto.spec.PBEParameterSpec, org.bouncycastle.asn1.DERNull, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.crypto.DigestAlgorithm

PBEParameterSpec allowing for the use of alternate PRFs with PBKDF2.

Field Summary

Modifier and TypeField and Description
private static final AlgorithmIdentifier
private final int
private final AlgorithmIdentifier

Constructor Summary

AccessConstructor and Description
public
PBKDF2ParameterSpec(byte[]
salt to use.
salt
,
int
iteration count for PBE algorithm.
iterationCount
,
int
keySize in bits.
keySize
)

Base constructor with the default PRF.

public
PBKDF2ParameterSpec(byte[]
salt to use.
salt
,
int
iteration count for PBE algorithm.
iterationCount
,
int
keySize in bits.
keySize
,
DigestAlgorithm
Algorithm identifying the PRF to use.
prfAlgorithm
)

Constructor that allows specifying a PRF using an Algorithm.

public
PBKDF2ParameterSpec(byte[]
salt to use.
salt
,
int
iteration count for PBE algorithm.
iterationCount
,
int
keySize in bits.
keySize
,
AlgorithmIdentifier
AlgorithmIdentifier for the PRF to use.
prf
)

Constructor that allows specifying a PRF.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the size of the generated key required.
getKeySize
()

Return the key size (in bits) for the key to be derived.

public AlgorithmIdentifier

Returns:

the PRF's AlgorithmIdentifier.
getPrf
()

Return an AlgorithmIdentifier representing the PRF.

public boolean

Returns:

true if this spec uses the default PRF, false otherwise.
isDefaultPrf
()

Return true if this spec is for the default PRF (HmacSHA1), false otherwise.

Inherited from javax.crypto.spec.PBEParameterSpec:
getIterationCountgetParameterSpecgetSalt

Field Detail

defaultPRFback to summary
private static final AlgorithmIdentifier defaultPRF
keySizeback to summary
private final int keySize
prfback to summary
private final AlgorithmIdentifier prf

Constructor Detail

PBKDF2ParameterSpecback to summary
public PBKDF2ParameterSpec(byte[] salt, int iterationCount, int keySize)

Base constructor with the default PRF.

Parameters
salt:byte[]

salt to use.

iterationCount:int

iteration count for PBE algorithm.

keySize:int

keySize in bits.

PBKDF2ParameterSpecback to summary
public PBKDF2ParameterSpec(byte[] salt, int iterationCount, int keySize, DigestAlgorithm prfAlgorithm)

Constructor that allows specifying a PRF using an Algorithm.

Parameters
salt:byte[]

salt to use.

iterationCount:int

iteration count for PBE algorithm.

keySize:int

keySize in bits.

prfAlgorithm:DigestAlgorithm

Algorithm identifying the PRF to use.

PBKDF2ParameterSpecback to summary
public PBKDF2ParameterSpec(byte[] salt, int iterationCount, int keySize, AlgorithmIdentifier prf)

Constructor that allows specifying a PRF.

Parameters
salt:byte[]

salt to use.

iterationCount:int

iteration count for PBE algorithm.

keySize:int

keySize in bits.

prf:AlgorithmIdentifier

AlgorithmIdentifier for the PRF to use.

Method Detail

getKeySizeback to summary
public int getKeySize()

Return the key size (in bits) for the key to be derived.

Returns:int

the size of the generated key required.

getPrfback to summary
public AlgorithmIdentifier getPrf()

Return an AlgorithmIdentifier representing the PRF.

Returns:AlgorithmIdentifier

the PRF's AlgorithmIdentifier.

isDefaultPrfback to summary
public boolean isDefaultPrf()

Return true if this spec is for the default PRF (HmacSHA1), false otherwise.

Returns:boolean

true if this spec uses the default PRF, false otherwise.