Class BcTlsMLKem
- java.lang.Object
-
- org.bouncycastle.tls.crypto.impl.bc.BcTlsMLKem
-
- All Implemented Interfaces:
TlsAgreement
public class BcTlsMLKem extends java.lang.Object implements TlsAgreement
-
-
Field Summary
Fields Modifier and Type Field Description protected BcTlsMLKemDomaindomainprotected org.bouncycastle.pqc.crypto.crystals.kyber.KyberPrivateKeyParametersprivateKeyprotected org.bouncycastle.pqc.crypto.crystals.kyber.KyberPublicKeyParameterspublicKeyprotected TlsSecretsecret
-
Constructor Summary
Constructors Constructor Description BcTlsMLKem(BcTlsMLKemDomain domain)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TlsSecretcalculateSecret()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.voidreceivePeerValue(byte[] peerValue)Pass in the public key for the peer to the agreement calculator.
-
-
-
Field Detail
-
domain
protected final BcTlsMLKemDomain domain
-
privateKey
protected org.bouncycastle.pqc.crypto.crystals.kyber.KyberPrivateKeyParameters privateKey
-
publicKey
protected org.bouncycastle.pqc.crypto.crystals.kyber.KyberPublicKeyParameters publicKey
-
secret
protected TlsSecret secret
-
-
Constructor Detail
-
BcTlsMLKem
public BcTlsMLKem(BcTlsMLKemDomain domain)
-
-
Method Detail
-
generateEphemeral
public byte[] generateEphemeral() throws java.io.IOExceptionDescription copied from interface:TlsAgreementGenerate an ephemeral key pair, returning the encoding of the public key.- Specified by:
generateEphemeralin 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.IOExceptionDescription copied from interface:TlsAgreementPass in the public key for the peer to the agreement calculator.- Specified by:
receivePeerValuein 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:TlsAgreementCalculate the agreed secret based on the calculator's current state.- Specified by:
calculateSecretin interfaceTlsAgreement- Returns:
- the calculated secret.
- Throws:
java.io.IOException- in case of error.
-
-