Top Description Fields Constructors Methods
org.bouncycastle.crypto.params

public Class HKDFParameters

extends Object
implements DerivationParameters
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.DerivationParameters
Imports
org.bouncycastle.crypto.DerivationParameters, org.bouncycastle.util.Arrays

Parameter class for the HKDFBytesGenerator class.

Field Summary

Modifier and TypeField and Description
private final byte[]
private final byte[]
private final byte[]
private final boolean

Constructor Summary

AccessConstructor and Description
private
HKDFParameters(final byte[] ikm, final boolean skip, final byte[] salt, final byte[] info)

public
HKDFParameters(final byte[]
the input keying material or seed
ikm
,
final byte[]
the salt to use, may be null for a salt for hashLen zeros
salt
,
final byte[]
the info to use, may be null for an info field of zero bytes
info
)

Generates parameters for HKDF, specifying both the optional salt and optional info.

Method Summary

Modifier and TypeMethod and Description
public static HKDFParameters
defaultParameters(final byte[] ikm)

public byte[]

Returns:

the keying material
getIKM
()

Returns the input keying material or seed.

public byte[]

Returns:

the info field, never null
getInfo
()

Returns the info field, which may be empty (null is converted to empty).

public byte[]

Returns:

the salt, or null
getSalt
()

Returns the salt, or null if the salt should be generated as a byte array of HashLen zeros.

public boolean

Returns:

true for skipping, false for no skipping of step 1
skipExtract
()

Returns if step 1: extract has to be skipped or not

public static HKDFParameters

Returns:

HKDFParameters that makes the implementation skip step 1
skipExtractParameters
(final byte[]
the input keying material or seed, directly used for step 2: Expand
ikm
,
final byte[]
the info to use, may be null for an info field of zero bytes
info
)

Factory method that makes the HKDF skip the extract part of the key derivation function.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ikmback to summary
private final byte[] ikm
infoback to summary
private final byte[] info
saltback to summary
private final byte[] salt
skipExpandback to summary
private final boolean skipExpand

Constructor Detail

HKDFParametersback to summary
private HKDFParameters(final byte[] ikm, final boolean skip, final byte[] salt, final byte[] info)
HKDFParametersback to summary
public HKDFParameters(final byte[] ikm, final byte[] salt, final byte[] info)

Generates parameters for HKDF, specifying both the optional salt and optional info. Step 1: Extract won't be skipped.

Parameters
ikm:byte[]

the input keying material or seed

salt:byte[]

the salt to use, may be null for a salt for hashLen zeros

info:byte[]

the info to use, may be null for an info field of zero bytes

Method Detail

defaultParametersback to summary
public static HKDFParameters defaultParameters(final byte[] ikm)
getIKMback to summary
public byte[] getIKM()

Returns the input keying material or seed.

Returns:byte[]

the keying material

getInfoback to summary
public byte[] getInfo()

Returns the info field, which may be empty (null is converted to empty).

Returns:byte[]

the info field, never null

getSaltback to summary
public byte[] getSalt()

Returns the salt, or null if the salt should be generated as a byte array of HashLen zeros.

Returns:byte[]

the salt, or null

skipExtractback to summary
public boolean skipExtract()

Returns if step 1: extract has to be skipped or not

Returns:boolean

true for skipping, false for no skipping of step 1

skipExtractParametersback to summary
public static HKDFParameters skipExtractParameters(final byte[] ikm, final byte[] info)

Factory method that makes the HKDF skip the extract part of the key derivation function.

Parameters
ikm:byte[]

the input keying material or seed, directly used for step 2: Expand

info:byte[]

the info to use, may be null for an info field of zero bytes

Returns:HKDFParameters

HKDFParameters that makes the implementation skip step 1