Top Description Inners Fields Constructors Methods
org.bouncycastle.crypto.util

public Class PBKDF2Config

extends PBKDFConfig
Class Inheritance
Imports
java.util.HashMap, .Map, org.bouncycastle.asn1.ASN1ObjectIdentifier, .DERNull, org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers, org.bouncycastle.asn1.gm.GMObjectIdentifiers, org.bouncycastle.asn1.nist.NISTObjectIdentifiers, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.internal.asn1.rosstandart.RosstandartObjectIdentifiers, org.bouncycastle.util.Integers

Configuration class for a PBKDF using PKCS#5 Scheme 2.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

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

AlgorithmIdentifier for a PRF using HMac with SHA-1

public static final AlgorithmIdentifier
PRF_SHA256

AlgorithmIdentifier for a PRF using HMac with SHA-256

public static final AlgorithmIdentifier
PRF_SHA3_256

AlgorithmIdentifier for a PRF using HMac with SHA3-256

public static final AlgorithmIdentifier
PRF_SHA3_512

AlgorithmIdentifier for a PRF using SHA3-512

public static final AlgorithmIdentifier
PRF_SHA512

AlgorithmIdentifier for a PRF using HMac with SHA-512

private static final Map<K, V>
private final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
public AlgorithmIdentifier
public int
pack-priv static int
Inherited from org.bouncycastle.crypto.util.PBKDFConfig:
getAlgorithm

Field Detail

iterationCountback to summary
private final int iterationCount
prfback to summary
private final AlgorithmIdentifier prf
PRF_SHA1back to summary
public static final AlgorithmIdentifier PRF_SHA1

AlgorithmIdentifier for a PRF using HMac with SHA-1

PRF_SHA256back to summary
public static final AlgorithmIdentifier PRF_SHA256

AlgorithmIdentifier for a PRF using HMac with SHA-256

PRF_SHA3_256back to summary
public static final AlgorithmIdentifier PRF_SHA3_256

AlgorithmIdentifier for a PRF using HMac with SHA3-256

PRF_SHA3_512back to summary
public static final AlgorithmIdentifier PRF_SHA3_512

AlgorithmIdentifier for a PRF using SHA3-512

PRF_SHA512back to summary
public static final AlgorithmIdentifier PRF_SHA512

AlgorithmIdentifier for a PRF using HMac with SHA-512

PRFS_SALTback to summary
private static final Map<K, V> PRFS_SALT
saltLengthback to summary
private final int saltLength

Constructor Detail

PBKDF2Configback to summary
private PBKDF2Config(PBKDF2Config.Builder builder)

Method Detail

getIterationCountback to summary
public int getIterationCount()
getPRFback to summary
public AlgorithmIdentifier getPRF()
getSaltLengthback to summary
public int getSaltLength()
getSaltSizeback to summary
pack-priv static int getSaltSize(ASN1ObjectIdentifier algorithm)
org.bouncycastle.crypto.util back to summary

public Class PBKDF2Config.Builder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private int
private AlgorithmIdentifier
private int

Constructor Summary

AccessConstructor and Description
public
Builder()

Base constructor.

Method Summary

Modifier and TypeMethod and Description
public PBKDF2Config
public PBKDF2Config.Builder

Returns:

the current builder.
withIterationCount
(int
the iteration count to apply to the key creation.
iterationCount
)

Set the iteration count for the PBE calculation.

public PBKDF2Config.Builder

Returns:

the current builder.
withPRF
(AlgorithmIdentifier
algorithm id for PRF.
prf
)

Set the PRF to use for key generation.

public PBKDF2Config.Builder

Returns:

the current builder.
withSaltLength
(int
the length of the salt (in octets) to use.
saltLength
)

Set the length of the salt to use.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

iterationCountback to summary
private int iterationCount
prfback to summary
private AlgorithmIdentifier prf
saltLengthback to summary
private int saltLength

Constructor Detail

Builderback to summary
public Builder()

Base constructor. This configures the builder to use an iteration count of 1024, and the HMacSHA1 PRF.

Method Detail

buildback to summary
public PBKDF2Config build()
withIterationCountback to summary
public PBKDF2Config.Builder withIterationCount(int iterationCount)

Set the iteration count for the PBE calculation.

Parameters
iterationCount:int

the iteration count to apply to the key creation.

Returns:PBKDF2Config.Builder

the current builder.

withPRFback to summary
public PBKDF2Config.Builder withPRF(AlgorithmIdentifier prf)

Set the PRF to use for key generation. By default this is HmacSHA1.

Parameters
prf:AlgorithmIdentifier

algorithm id for PRF.

Returns:PBKDF2Config.Builder

the current builder.

withSaltLengthback to summary
public PBKDF2Config.Builder withSaltLength(int saltLength)

Set the length of the salt to use.

Parameters
saltLength:int

the length of the salt (in octets) to use.

Returns:PBKDF2Config.Builder

the current builder.