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

Extension of PBEKeySpec which takes into account the PRF algorithm setting available in PKCS#5 PBKDF2.

Field Summary

Modifier and TypeField and Description
private static final AlgorithmIdentifier
private AlgorithmIdentifier

Constructor Summary

AccessConstructor and Description
public
PBKDF2KeySpec(char[]
password to use as the seed of the PBE key generator.
password
,
byte[]
salt to use in the generator,
salt
,
int
iteration count to use in the generator.
iterationCount
,
int
size of the key to be generated (in bits).
keySize
,
AlgorithmIdentifier
identifier and parameters for the PRF algorithm to use.
prf
)

Base constructor.

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, AlgorithmIdentifier prf)

Base constructor.

Parameters
password:char[]

password to use as the seed of the PBE key generator.

salt:byte[]

salt to use in the generator,

iterationCount:int

iteration count to use in the generator.

keySize:int

size of the key to be generated (in bits).

prf:AlgorithmIdentifier

identifier and parameters for the PRF algorithm 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.