Class JceTlsMLKem
- java.lang.Object
-
- org.bouncycastle.tls.crypto.impl.jcajce.JceTlsMLKem
-
- All Implemented Interfaces:
TlsAgreement
public class JceTlsMLKem extends java.lang.Object implements TlsAgreement
-
-
Field Summary
Fields Modifier and Type Field Description protected JceTlsMLKemDomain
domain
protected java.security.PrivateKey
privateKey
protected java.security.PublicKey
publicKey
protected TlsSecret
secret
-
Constructor Summary
Constructors Constructor Description JceTlsMLKem(JceTlsMLKemDomain domain)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TlsSecret
calculateSecret()
Calculate the agreed secret based on the calculator's current state.byte[]
generateEphemeral()
Generate an ephemeral key pair, returning the encoding of the public key.void
receivePeerValue(byte[] peerValue)
Pass in the public key for the peer to the agreement calculator.
-
-
-
Field Detail
-
domain
protected final JceTlsMLKemDomain domain
-
privateKey
protected java.security.PrivateKey privateKey
-
publicKey
protected java.security.PublicKey publicKey
-
secret
protected TlsSecret secret
-
-
Constructor Detail
-
JceTlsMLKem
public JceTlsMLKem(JceTlsMLKemDomain domain)
-
-
Method Detail
-
generateEphemeral
public byte[] generateEphemeral() throws java.io.IOException
Description copied from interface:TlsAgreement
Generate an ephemeral key pair, returning the encoding of the public key.- Specified by:
generateEphemeral
in interfaceTlsAgreement
- Returns:
- a byte encoding of the public key.
- Throws:
java.io.IOException
- in case of error.
-
receivePeerValue
public void receivePeerValue(byte[] peerValue) throws java.io.IOException
Description copied from interface:TlsAgreement
Pass in the public key for the peer to the agreement calculator.- Specified by:
receivePeerValue
in interfaceTlsAgreement
- Parameters:
peerValue
- a byte encoding of the peer public key.- Throws:
java.io.IOException
- in case of error.
-
calculateSecret
public TlsSecret calculateSecret() throws java.io.IOException
Description copied from interface:TlsAgreement
Calculate the agreed secret based on the calculator's current state.- Specified by:
calculateSecret
in interfaceTlsAgreement
- Returns:
- the calculated secret.
- Throws:
java.io.IOException
- in case of error.
-
-