APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.pkcs11

pack-priv final Class P11TlsPrfGenerator

extends KeyGeneratorSpi
Class Inheritance
Imports
java.security.*, java.security.spec.AlgorithmParameterSpec, javax.crypto.*, javax.crypto.spec.*, sun.security.internal.spec.TlsPrfParameterSpec, sun.security.pkcs11.wrapper.*

KeyGenerator for the TLS PRF. Note that although the PRF is used in a number of places during the handshake, this class is usually only used to calculate the Finished messages. The reason is that for those other uses more specific PKCS#11 mechanisms have been defined (CKM_SSL3_MASTER_KEY_DERIVE, etc.).

This class supports the CKM_TLS_PRF mechanism from PKCS#11 v2.20 and the older NSS private mechanism.

Author
Andreas Sterbenz
Since
1.6

Field Summary

Modifier and TypeField and Description
private final String
private final long
private static final String
private static final SecretKey
private P11Key
private TlsPrfParameterSpec
spec

References Deprecated TlsPrfParameterSpec is deprecated or references (maybe indirectly) at least one deprecated element.
private final Token

Constructor Summary

AccessConstructor and Description
pack-priv
P11TlsPrfGenerator(Token token, String algorithm, long mechanism)

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

algorithmback to summary
private final String algorithm
mechanismback to summary
private final long mechanism
MSGback to summary
private static final String MSG
NULL_KEYback to summary
private static final SecretKey NULL_KEY
p11Keyback to summary
private P11Key p11Key
specback to summary
private TlsPrfParameterSpec spec

References Deprecated

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

See corresponding docs for further information.

Annotations
@SuppressWarnings:deprecation
tokenback to summary
private final Token token

Constructor Detail

P11TlsPrfGeneratorback to summary
pack-priv P11TlsPrfGenerator(Token token, String algorithm, long mechanism) throws PKCS11Exception

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.