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

public Class TLSKeyMaterialSpec

extends Object
implements KeySpec
Class Inheritance
All Implemented Interfaces
java.security.spec.KeySpec
Imports
java.security.spec.KeySpec, org.bouncycastle.util.Arrays

Key Spec class for generating TLS key/iv material.

Field Summary

Modifier and TypeField and Description
public static final String
private final String
private final int
public static final String
private final byte[]
private final byte[]

Constructor Summary

AccessConstructor and Description
public
TLSKeyMaterialSpec(byte[]
secret to use
secret
,
String
e.g. 'master secret', or 'key expansion'
label
,
int
number of bytes of material to be generated
length
,
byte[]...
array of seed material inputs (to be concatenated together)
seedMaterial
)

Constructor specifying the basic parameters for a TLS KDF

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the label to be used with the TLS KDF.
getLabel
()

Return the label associated with this spec.

public int

Returns:

the length in bytes of the result.
getLength
()

Return the number of bytes of key material to be generated for this spec.

public byte[]

Returns:

a copy of the secret.
getSecret
()

Return the secret associated with this spec.

public byte[]

Returns:

a copy of the seed.
getSeed
()

Return the full seed for the spec.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

KEY_EXPANSIONback to summary
public static final String KEY_EXPANSION
labelback to summary
private final String label
lengthback to summary
private final int length
MASTER_SECRETback to summary
public static final String MASTER_SECRET
secretback to summary
private final byte[] secret
seedback to summary
private final byte[] seed

Constructor Detail

TLSKeyMaterialSpecback to summary
public TLSKeyMaterialSpec(byte[] secret, String label, int length, byte[]... seedMaterial)

Constructor specifying the basic parameters for a TLS KDF

Parameters
secret:byte[]

secret to use

label:String

e.g. 'master secret', or 'key expansion'

length:int

number of bytes of material to be generated

seedMaterial:byte[][]

array of seed material inputs (to be concatenated together)

Method Detail

getLabelback to summary
public String getLabel()

Return the label associated with this spec.

Returns:String

the label to be used with the TLS KDF.

getLengthback to summary
public int getLength()

Return the number of bytes of key material to be generated for this spec.

Returns:int

the length in bytes of the result.

getSecretback to summary
public byte[] getSecret()

Return the secret associated with this spec.

Returns:byte[]

a copy of the secret.

getSeedback to summary
public byte[] getSeed()

Return the full seed for the spec.

Returns:byte[]

a copy of the seed.