APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.crypto.provider

public final Class TlsMasterSecretGenerator

extends KeyGeneratorSpi
Class Inheritance
Imports
java.io.IOException, .InvalidObjectException, .ObjectInputStream, java.security.*, java.security.spec.AlgorithmParameterSpec, java.util.Arrays, javax.crypto.*, sun.security.internal.interfaces.TlsMasterSecret, sun.security.internal.spec.TlsMasterSecretParameterSpec

KeyGenerator implementation for the SSL/TLS master secret derivation.
Author
Andreas Sterbenz
Since
1.6

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
TlsMasterSecretGenerator.TlsMasterSecretKey

References Deprecated TlsMasterSecret is deprecated or references (maybe indirectly) at least one deprecated element.

Field Summary

Modifier and TypeField and Description
private static final String
private int
private TlsMasterSecretParameterSpec
spec

References Deprecated TlsMasterSecretParameterSpec is deprecated or references (maybe indirectly) at least one deprecated element.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected SecretKey
engineGenerateKey()

Implements abstract javax.crypto.KeyGeneratorSpi.engineGenerateKey.

Generates a secret key.

protected void
engineInit(SecureRandom random)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Initializes the key generator.

protected void
engineInit(AlgorithmParameterSpec params, SecureRandom random)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Initializes the key generator with the specified parameter set and a user-provided source of randomness.

protected void
engineInit(int keysize, SecureRandom random)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Initializes this key generator for a certain keysize, using the given source of randomness.

Field Detail

MSGback to summary
private static final String MSG
protocolVersionback to summary
private int protocolVersion
specback to summary
private TlsMasterSecretParameterSpec spec

References Deprecated

TlsMasterSecretParameterSpec is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Annotations
@SuppressWarnings:deprecation

Constructor Detail

TlsMasterSecretGeneratorback to summary
public TlsMasterSecretGenerator()

Method Detail

engineGenerateKeyback to summary
protected SecretKey engineGenerateKey()

Implements abstract javax.crypto.KeyGeneratorSpi.engineGenerateKey.

Doc from javax.crypto.KeyGeneratorSpi.engineGenerateKey.

Generates a secret key.

engineInitback to summary
protected void engineInit(SecureRandom random)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Doc from javax.crypto.KeyGeneratorSpi.engineInit.

Initializes the key generator.

engineInitback to summary
protected void engineInit(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Doc from javax.crypto.KeyGeneratorSpi.engineInit.

Initializes the key generator with the specified parameter set and a user-provided source of randomness.

Annotations
@SuppressWarnings:deprecation
Exceptions
InvalidAlgorithmParameterException:
if params is inappropriate for this key generator
engineInitback to summary
protected void engineInit(int keysize, SecureRandom random)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Doc from javax.crypto.KeyGeneratorSpi.engineInit.

Initializes this key generator for a certain keysize, using the given source of randomness.

com.sun.crypto.provider back to summary

private final Class TlsMasterSecretGenerator.TlsMasterSecretKey

extends Object
implements TlsMasterSecret
Class Inheritance
  • java.lang.Object
  • com.sun.crypto.provider.TlsMasterSecretGenerator.TlsMasterSecretKey
All Implemented Interfaces
sun.security.internal.interfaces.TlsMasterSecret, javax.crypto.SecretKey, javax.security.auth.Destroyable, java.security.Key, java.io.Serializable
Annotations
@SuppressWarnings:deprecation

References Deprecated

TlsMasterSecret is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Field Summary

Modifier and TypeField and Description
private byte[]
private final int
private final int
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
TlsMasterSecretKey(byte[] key, int majorVersion, int minorVersion)

Method Summary

Modifier and TypeMethod and Description
public String
getAlgorithm()

Implements java.security.Key.getAlgorithm.

Returns the standard algorithm name for this key.

public byte[]
getEncoded()

Implements java.security.Key.getEncoded.

Returns the key in its primary encoding format, or null if this key does not support encoding.

public String
getFormat()

Implements java.security.Key.getFormat.

Returns the name of the primary encoding format of this key, or null if this key does not support encoding.

public int
getMajorVersion()

Implements sun.security.internal.interfaces.TlsMasterSecret.getMajorVersion.

Returns the major version number encapsulated in the premaster secret this master secret was derived from, or -1 if it is not available.

public int
getMinorVersion()

Implements sun.security.internal.interfaces.TlsMasterSecret.getMinorVersion.

Returns the minor version number encapsulated in the premaster secret this master secret was derived from, or -1 if it is not available.

private void
readObject(ObjectInputStream
the ObjectInputStream from which data is read
stream
)

Restores the state of this object from the stream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keyback to summary
private byte[] key
majorVersionback to summary
private final int majorVersion
minorVersionback to summary
private final int minorVersion
serialVersionUIDback to summary
private static final long serialVersionUID

Hides sun.security.internal.interfaces.TlsMasterSecret.serialVersionUID.

Annotations
@Serial

Constructor Detail

TlsMasterSecretKeyback to summary
pack-priv TlsMasterSecretKey(byte[] key, int majorVersion, int minorVersion)

Method Detail

getAlgorithmback to summary
public String getAlgorithm()

Implements java.security.Key.getAlgorithm.

Doc from java.security.Key.getAlgorithm.

Returns the standard algorithm name for this key. For example, "RSA" would indicate that this key is an RSA key. See the Key Algorithms section in the Java Security Standard Algorithm Names Specification for information about standard key algorithm names.

getEncodedback to summary
public byte[] getEncoded()

Implements java.security.Key.getEncoded.

Doc from java.security.Key.getEncoded.

Returns the key in its primary encoding format, or null if this key does not support encoding.

getFormatback to summary
public String getFormat()

Implements java.security.Key.getFormat.

Doc from java.security.Key.getFormat.

Returns the name of the primary encoding format of this key, or null if this key does not support encoding. The primary encoding format is named in terms of the appropriate ASN.1 data format, if an ASN.1 specification for this key exists. For example, the name of the ASN.1 data format for public keys is SubjectPublicKeyInfo, as defined by the X.509 standard; in this case, the returned format is "X.509". Similarly, the name of the ASN.1 data format for private keys is PrivateKeyInfo, as defined by the PKCS #8 standard; in this case, the returned format is "PKCS#8".

getMajorVersionback to summary
public int getMajorVersion()

Implements sun.security.internal.interfaces.TlsMasterSecret.getMajorVersion.

Doc from sun.security.internal.interfaces.TlsMasterSecret.getMajorVersion.

Returns the major version number encapsulated in the premaster secret this master secret was derived from, or -1 if it is not available.

This information will only usually only be available when RSA was used as the key exchange algorithm.

getMinorVersionback to summary
public int getMinorVersion()

Implements sun.security.internal.interfaces.TlsMasterSecret.getMinorVersion.

Doc from sun.security.internal.interfaces.TlsMasterSecret.getMinorVersion.

Returns the minor version number encapsulated in the premaster secret this master secret was derived from, or -1 if it is not available.

This information will only usually only be available when RSA was used as the key exchange algorithm.

readObjectback to summary
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException

Restores the state of this object from the stream.

Parameters
stream:ObjectInputStream

the ObjectInputStream from which data is read

Annotations
@Serial
Exceptions
IOException:
if an I/O error occurs
ClassNotFoundException:
if a serialized class cannot be loaded