Bouncy Castle Cryptography Library 1.77.0

org.bouncycastle.jcajce.spec
Class TLSKeyMaterialSpec

java.lang.Object
  |
  +--org.bouncycastle.jcajce.spec.TLSKeyMaterialSpec
All Implemented Interfaces:
java.security.spec.KeySpec

public class TLSKeyMaterialSpec
extends java.lang.Object
implements java.security.spec.KeySpec

Key Spec class for generating TLS key/iv material.


Field Summary
static java.lang.String KEY_EXPANSION
           
static java.lang.String MASTER_SECRET
           
 
Constructor Summary
TLSKeyMaterialSpec(byte[] secret, java.lang.String label, int length, byte[] seedMaterial1, byte[] seedMaterial2)
          Constructor specifying the basic parameters for a TLS KDF
TLSKeyMaterialSpec(byte[] secret, java.lang.String label, int length, byte[] seedMaterial1, byte[] seedMaterial2, byte[] seedMaterial3)
          Constructor specifying the basic parameters for a TLS KDF
 
Method Summary
 java.lang.String getLabel()
          Return the label associated with this spec.
 int getLength()
          Return the number of bytes of key material to be generated for this spec.
 byte[] getSecret()
          Return the secret associated with this spec.
 byte[] getSeed()
          Return the full seed for the spec.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MASTER_SECRET

public static final java.lang.String MASTER_SECRET

KEY_EXPANSION

public static final java.lang.String KEY_EXPANSION
Constructor Detail

TLSKeyMaterialSpec

public TLSKeyMaterialSpec(byte[] secret,
                          java.lang.String label,
                          int length,
                          byte[] seedMaterial1,
                          byte[] seedMaterial2)
Constructor specifying the basic parameters for a TLS KDF
Parameters:
secret - secret to use
label - e.g. 'master secret', or 'key expansion'
length - number of bytes of material to be generated
seedMaterial1 - first element of seed material
seedMaterial2 - second element of seed material

TLSKeyMaterialSpec

public TLSKeyMaterialSpec(byte[] secret,
                          java.lang.String label,
                          int length,
                          byte[] seedMaterial1,
                          byte[] seedMaterial2,
                          byte[] seedMaterial3)
Constructor specifying the basic parameters for a TLS KDF
Parameters:
secret - secret to use
label - e.g. 'master secret', or 'key expansion'
length - number of bytes of material to be generated
seedMaterial1 - first element of seed material
seedMaterial2 - second element of seed material
seedMaterial3 - third element of seed material
Method Detail

getLabel

public java.lang.String getLabel()
Return the label associated with this spec.
Returns:
the label to be used with the TLS KDF.

getLength

public int getLength()
Return the number of bytes of key material to be generated for this spec.
Returns:
the length in bytes of the result.

getSecret

public byte[] getSecret()
Return the secret associated with this spec.
Returns:
a copy of the secret.

getSeed

public byte[] getSeed()
Return the full seed for the spec.
Returns:
a copy of the seed.

Bouncy Castle Cryptography Library 1.77.0