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

public Class TlsMasterSecretParameterSpec

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 SSL/TLS master secret generation. This class encapsulates the information necessary to calculate an SSL/TLS master secret from the premaster secret and other parameters. It is used to initialize KeyGenerators of the type "TlsMasterSecret".

Instances of this class are immutable.

Author
Andreas Sterbenz
Since
1.6

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
TlsMasterSecretParameterSpec(SecretKey
the premaster secret
premasterSecret
,
int
the major number of the protocol version
majorVersion
,
int
the minor number of the protocol version
minorVersion
,
byte[]
the client's random value
clientRandom
,
byte[]
the server's random value
serverRandom
,
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 TlsMasterSecretParameterSpec.

public
TlsMasterSecretParameterSpec(SecretKey
the premaster secret
premasterSecret
,
int
the major number of the protocol version
majorVersion
,
int
the minor number of the protocol version
minorVersion
,
byte[]
the session hash for Extended Master Secret
extendedMasterSecretSessionHash
,
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 TlsMasterSecretParameterSpec.

private
TlsMasterSecretParameterSpec(SecretKey premasterSecret, int majorVersion, int minorVersion, byte[] clientRandom, byte[] serverRandom, byte[] extendedMasterSecretSessionHash, String prfHashAlg, int prfHashLength, int prfBlockSize)

Method Summary

Modifier and TypeMethod and Description
pack-priv static int
checkVersion(int version)

public byte[]

Returns:

a copy of the client's random value.
getClientRandom
()

Returns a copy of the client's random value.

public byte[]

Returns:

a copy of the Extended Master Secret session hash, or an empty array if no extended master secret session hash was provided at instantiation time
getExtendedMasterSecretSessionHash
()

Returns a copy of the Extended Master Secret session hash.

public int

Returns:

the major version number.
getMajorVersion
()

Returns the major version number.

public int

Returns:

the minor version number.
getMinorVersion
()

Returns the minor version number.

public SecretKey

Returns:

the premaster secret.
getPremasterSecret
()

Returns the premaster secret.

public int

Returns:

the hash algorithm block size.
getPRFBlockSize
()

Obtains the block size of the PRF hash algorithm.

public String

Returns:

the hash algorithm.
getPRFHashAlg
()

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

public int

Returns:

the hash algorithm length.
getPRFHashLength
()

Obtains the length of the PRF hash algorithm.

public byte[]

Returns:

a copy of the server's random value.
getServerRandom
()

Returns a copy of the server's random value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clientRandomback to summary
private final byte[] clientRandom
extendedMasterSecretSessionHashback to summary
private final byte[] extendedMasterSecretSessionHash
majorVersionback to summary
private final int majorVersion
minorVersionback to summary
private final int minorVersion
premasterSecretback to summary
private final SecretKey premasterSecret
prfBlockSizeback to summary
private final int prfBlockSize
prfHashAlgback to summary
private final String prfHashAlg
prfHashLengthback to summary
private final int prfHashLength
serverRandomback to summary
private final byte[] serverRandom

Constructor Detail

TlsMasterSecretParameterSpecback to summary
public TlsMasterSecretParameterSpec(SecretKey premasterSecret, int majorVersion, int minorVersion, byte[] clientRandom, byte[] serverRandom, String prfHashAlg, int prfHashLength, int prfBlockSize)

Constructs a new TlsMasterSecretParameterSpec.

The getAlgorithm() method of premasterSecret should return "TlsRsaPremasterSecret" if the key exchange algorithm was RSA and "TlsPremasterSecret" otherwise.

Parameters
premasterSecret:SecretKey

the premaster secret

majorVersion:int

the major number of the protocol version

minorVersion:int

the minor number of the protocol version

clientRandom:byte[]

the client's random value

serverRandom:byte[]

the server's random value

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 premasterSecret, clientRandom, or serverRandom are null
IllegalArgumentException:
if minorVersion or majorVersion are negative or larger than 255
TlsMasterSecretParameterSpecback to summary
public TlsMasterSecretParameterSpec(SecretKey premasterSecret, int majorVersion, int minorVersion, byte[] extendedMasterSecretSessionHash, String prfHashAlg, int prfHashLength, int prfBlockSize)

Constructs a new TlsMasterSecretParameterSpec.

The getAlgorithm() method of premasterSecret should return "TlsRsaPremasterSecret" if the key exchange algorithm was RSA and "TlsPremasterSecret" otherwise.

Parameters
premasterSecret:SecretKey

the premaster secret

majorVersion:int

the major number of the protocol version

minorVersion:int

the minor number of the protocol version

extendedMasterSecretSessionHash:byte[]

the session hash for Extended Master Secret

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 premasterSecret is null
IllegalArgumentException:
if minorVersion or majorVersion are negative or larger than 255
TlsMasterSecretParameterSpecback to summary
private TlsMasterSecretParameterSpec(SecretKey premasterSecret, int majorVersion, int minorVersion, byte[] clientRandom, byte[] serverRandom, byte[] extendedMasterSecretSessionHash, String prfHashAlg, int prfHashLength, int prfBlockSize)

Method Detail

checkVersionback to summary
pack-priv static int checkVersion(int version)
getClientRandomback to summary
public byte[] getClientRandom()

Returns a copy of the client's random value.

Returns:byte[]

a copy of the client's random value.

getExtendedMasterSecretSessionHashback to summary
public byte[] getExtendedMasterSecretSessionHash()

Returns a copy of the Extended Master Secret session hash.

Returns:byte[]

a copy of the Extended Master Secret session hash, or an empty array if no extended master secret session hash was provided at instantiation time

getMajorVersionback to summary
public int getMajorVersion()

Returns the major version number.

Returns:int

the major version number.

getMinorVersionback to summary
public int getMinorVersion()

Returns the minor version number.

Returns:int

the minor version number.

getPremasterSecretback to summary
public SecretKey getPremasterSecret()

Returns the premaster secret.

Returns:SecretKey

the premaster secret.

getPRFBlockSizeback to summary
public int getPRFBlockSize()

Obtains the block size of the PRF hash algorithm.

Returns:int

the hash algorithm block size.

getPRFHashAlgback to summary
public String getPRFHashAlg()

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

Returns:String

the hash algorithm.

getPRFHashLengthback to summary
public int getPRFHashLength()

Obtains the length of the PRF hash algorithm.

Returns:int

the hash algorithm length.

getServerRandomback to summary
public byte[] getServerRandom()

Returns a copy of the server's random value.

Returns:byte[]

a copy of the server's random value.