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

public Class PBKDF2KeySpec

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

PBEKeySpec allowing for the use of alternate PRFs with PBKDF2.

Field Summary

Modifier and TypeField and Description
private static final AlgorithmIdentifier
private AlgorithmIdentifier

Constructor Summary

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

Base constructor with the default PRF.

public
PBKDF2KeySpec(char[]
password.
password
,
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
PBKDF2KeySpec(char[]
password.
password
,
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 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.PBEKeySpec:
clearPasswordgetIterationCountgetKeyLengthgetPasswordgetSalt

Field Detail

defaultPRFback to summary
private static final AlgorithmIdentifier defaultPRF
prfback to summary
private AlgorithmIdentifier prf

Constructor Detail

PBKDF2KeySpecback to summary
public PBKDF2KeySpec(char[] password, byte[] salt, int iterationCount, int keySize)

Base constructor with the default PRF.

Parameters
password:char[]

password.

salt:byte[]

salt to use.

iterationCount:int

iteration count for PBE algorithm.

keySize:int

keySize in bits.

PBKDF2KeySpecback to summary
public PBKDF2KeySpec(char[] password, byte[] salt, int iterationCount, int keySize, DigestAlgorithm prfAlgorithm)

Constructor that allows specifying a PRF using an Algorithm.

Parameters
password:char[]

password.

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.

PBKDF2KeySpecback to summary
public PBKDF2KeySpec(char[] password, byte[] salt, int iterationCount, int keySize, AlgorithmIdentifier prf)

Constructor that allows specifying a PRF.

Parameters
password:char[]

password.

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

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.