APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.internal.spec

public Class TlsPrfParameterSpec

extends Object
implements AlgorithmParameterSpec
Class Inheritance
All Implemented Interfaces
java.security.spec.AlgorithmParameterSpec
Annotations
@Deprecated
Imports
java.security.spec.AlgorithmParameterSpec, javax.crypto.SecretKey

Deprecated

Sun JDK internal use only --- WILL BE REMOVED in a future release.

Parameters for the TLS PRF (pseudo-random function). The PRF function is defined in RFC 2246. This class is used to initialize KeyGenerators of the type "TlsPrf".

Instances of this class are immutable.

Author
Andreas Sterbenz
Since
1.6

Field Summary

Modifier and TypeField and Description
private final String
private final String
private final int
private final int
private final String
private final int
private final SecretKey
private final byte[]

Constructor Summary

AccessConstructor and Description
public
TlsPrfParameterSpec(SecretKey
the secret to use in the calculation (or null)
secret
,
String
the label to use in the calculation
label
,
byte[]
the random seed to use in the calculation
seed
,
int
the length in bytes of the output key to be produced
outputLength
,
String
the name of the TLS PRF hash algorithm to use. Used only for TLS 1.2+. TLS1.1 and earlier use a fixed PRF.
prfHashAlg
,
int
the output length of the TLS PRF hash algorithm. Used only for TLS 1.2+.
prfHashLength
,
int
the input block size of the TLS PRF hash algorithm. Used only for TLS 1.2+.
prfBlockSize
)

Constructs a new TlsPrfParameterSpec.

public
TlsPrfParameterSpec(SecretKey
the secret to use in the calculation (or null)
secret
,
String
the algorithm name for the generated SecretKey
keyAlg
,
String
the label to use in the calculation
label
,
byte[]
the random seed to use in the calculation
seed
,
int
the length in bytes of the output key to be produced
outputLength
,
String
the name of the TLS PRF hash algorithm to use. Used only for TLS 1.2+. TLS1.1 and earlier use a fixed PRF.
prfHashAlg
,
int
the output length of the TLS PRF hash algorithm. Used only for TLS 1.2+.
prfHashLength
,
int
the input block size of the TLS PRF hash algorithm. Used only for TLS 1.2+.
prfBlockSize
)

Constructs a new TlsPrfParameterSpec.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the key algorithm name
getKeyAlg
()

Returns the key algorithm name to use when generating the SecretKey.

public String

Returns:

the label to use in the PRF calculation.
getLabel
()

Returns the label to use in the PRF calculation.

public int

Returns:

the length in bytes of the output key to be produced.
getOutputLength
()

Returns the length in bytes of the output key to be produced.

public int

Returns:

the hash algorithm length.
getPRFBlockSize
()

Obtains the length of PRF hash algorithm.

public String

Returns:

the hash algorithm, or null if no algorithm was specified.
getPRFHashAlg
()

Obtains the PRF hash algorithm to use in the PRF calculation.

public int

Returns:

the hash algorithm length.
getPRFHashLength
()

Obtains the length of PRF hash algorithm.

public SecretKey

Returns:

the secret to use in the PRF calculation, or null if there is no secret.
getSecret
()

Returns the secret to use in the PRF calculation, or null if there is no secret.

public byte[]

Returns:

a copy of the seed to use in the PRF calculation.
getSeed
()

Returns a copy of the seed to use in the PRF calculation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keyAlgback to summary
private final String keyAlg
labelback to summary
private final String label
outputLengthback to summary
private final int outputLength
prfBlockSizeback to summary
private final int prfBlockSize
prfHashAlgback to summary
private final String prfHashAlg
prfHashLengthback to summary
private final int prfHashLength
secretback to summary
private final SecretKey secret
seedback to summary
private final byte[] seed

Constructor Detail

TlsPrfParameterSpecback to summary
public TlsPrfParameterSpec(SecretKey secret, String label, byte[] seed, int outputLength, String prfHashAlg, int prfHashLength, int prfBlockSize)

Constructs a new TlsPrfParameterSpec.

Parameters
secret:SecretKey

the secret to use in the calculation (or null)

label:String

the label to use in the calculation

seed:byte[]

the random seed to use in the calculation

outputLength:int

the length in bytes of the output key to be produced

prfHashAlg:String

the name of the TLS PRF hash algorithm to use. Used only for TLS 1.2+. TLS1.1 and earlier use a fixed PRF.

prfHashLength:int

the output length of the TLS PRF hash algorithm. Used only for TLS 1.2+.

prfBlockSize:int

the input block size of the TLS PRF hash algorithm. Used only for TLS 1.2+.

Exceptions
NullPointerException:
if label or seed is null
IllegalArgumentException:
if outputLength is negative
TlsPrfParameterSpecback to summary
public TlsPrfParameterSpec(SecretKey secret, String keyAlg, String label, byte[] seed, int outputLength, String prfHashAlg, int prfHashLength, int prfBlockSize)

Constructs a new TlsPrfParameterSpec.

Parameters
secret:SecretKey

the secret to use in the calculation (or null)

keyAlg:String

the algorithm name for the generated SecretKey

label:String

the label to use in the calculation

seed:byte[]

the random seed to use in the calculation

outputLength:int

the length in bytes of the output key to be produced

prfHashAlg:String

the name of the TLS PRF hash algorithm to use. Used only for TLS 1.2+. TLS1.1 and earlier use a fixed PRF.

prfHashLength:int

the output length of the TLS PRF hash algorithm. Used only for TLS 1.2+.

prfBlockSize:int

the input block size of the TLS PRF hash algorithm. Used only for TLS 1.2+.

Exceptions
NullPointerException:
if keyAlg, label or seed is null
IllegalArgumentException:
if outputLength is negative or keyAlg is empty

Method Detail

getKeyAlgback to summary
public String getKeyAlg()

Returns the key algorithm name to use when generating the SecretKey.

Returns:String

the key algorithm name

getLabelback to summary
public String getLabel()

Returns the label to use in the PRF calculation.

Returns:String

the label to use in the PRF calculation.

getOutputLengthback to summary
public int getOutputLength()

Returns the length in bytes of the output key to be produced.

Returns:int

the length in bytes of the output key to be produced.

getPRFBlockSizeback to summary
public int getPRFBlockSize()

Obtains the length of PRF hash algorithm.

Returns:int

the hash algorithm length.

getPRFHashAlgback to summary
public String getPRFHashAlg()

Obtains the PRF hash algorithm to use in the PRF calculation.

Returns:String

the hash algorithm, or null if no algorithm was specified.

getPRFHashLengthback to summary
public int getPRFHashLength()

Obtains the length of PRF hash algorithm. It would have been preferred to use MessageDigest.getDigestLength(), but the API does not require implementations to support the method.

Returns:int

the hash algorithm length.

getSecretback to summary
public SecretKey getSecret()

Returns the secret to use in the PRF calculation, or null if there is no secret.

Returns:SecretKey

the secret to use in the PRF calculation, or null if there is no secret.

getSeedback to summary
public byte[] getSeed()

Returns a copy of the seed to use in the PRF calculation.

Returns:byte[]

a copy of the seed to use in the PRF calculation.