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

public Class KAKeyDerivation

extends Object
implements SSLKeyDerivation
Class Inheritance
All Implemented Interfaces
sun.security.ssl.SSLKeyDerivation
Imports
javax.crypto.DecapsulateException, .KDF, .KEM, .KeyAgreement, .SecretKey, javax.crypto.spec.HKDFParameterSpec, javax.net.ssl.SSLHandshakeException, java.io.IOException, java.security.GeneralSecurityException, .InvalidKeyException, .KeyFactory, .PrivateKey, .Provider, .PublicKey, .SecureRandom, java.security.spec.X509EncodedKeySpec, sun.security.util.KeyUtil

A common class for creating various KeyDerivation types.

Field Summary

Modifier and TypeField and Description
private final String
private final HandshakeContext
private final byte[]
private final PrivateKey
private final PublicKey
private final Provider
private static final String

Constructor Summary

AccessConstructor and Description
pack-priv
KAKeyDerivation(String algorithmName, HandshakeContext context, PrivateKey localPrivateKey, PublicKey peerPublicKey)

pack-priv
KAKeyDerivation(String algorithmName, NamedGroup namedGroup, HandshakeContext context, PrivateKey localPrivateKey, PublicKey peerPublicKey, byte[] keyshare)

Method Summary

Modifier and TypeMethod and Description
private SecretKey
deriveHandshakeSecret(String label, SecretKey sharedSecret)

public SecretKey
pack-priv KEM.Encapsulated
encapsulate(String algorithm, SecureRandom random)

This method is called by the server to perform KEM encapsulation.

private SecretKey
t12DeriveKey()

Handle the TLSv1-1.2 objects, which don't use the HKDF algorithms.

private SecretKey
t13DeriveKey(String type)

Handle the TLSv1.3 objects, which use the HKDF algorithms.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

algorithmNameback to summary
private final String algorithmName
contextback to summary
private final HandshakeContext context
keyshareback to summary
private final byte[] keyshare
localPrivateKeyback to summary
private final PrivateKey localPrivateKey
peerPublicKeyback to summary
private final PublicKey peerPublicKey
providerback to summary
private final Provider provider
t13KeyDerivationAlgorithmback to summary
private static final String t13KeyDerivationAlgorithm

Constructor Detail

KAKeyDerivationback to summary
pack-priv KAKeyDerivation(String algorithmName, HandshakeContext context, PrivateKey localPrivateKey, PublicKey peerPublicKey)
KAKeyDerivationback to summary
pack-priv KAKeyDerivation(String algorithmName, NamedGroup namedGroup, HandshakeContext context, PrivateKey localPrivateKey, PublicKey peerPublicKey, byte[] keyshare)

Method Detail

deriveHandshakeSecretback to summary
private SecretKey deriveHandshakeSecret(String label, SecretKey sharedSecret) throws GeneralSecurityException, IOException
deriveKeyback to summary
public SecretKey deriveKey(String type) throws IOException

Implements sun.security.ssl.SSLKeyDerivation.deriveKey.

Annotations
@Override
encapsulateback to summary
pack-priv KEM.Encapsulated encapsulate(String algorithm, SecureRandom random) throws IOException

This method is called by the server to perform KEM encapsulation. It uses the client's public key (sent by the client as a keyshare) to encapsulate a shared secret and returns the encapsulated message. Package-private, used from KeyShareExtension.SHKeyShareProducer:: produce().

t12DeriveKeyback to summary
private SecretKey t12DeriveKey() throws IOException

Handle the TLSv1-1.2 objects, which don't use the HKDF algorithms.

t13DeriveKeyback to summary
private SecretKey t13DeriveKey(String type) throws IOException

Handle the TLSv1.3 objects, which use the HKDF algorithms.