Package org.bouncycastle.tls.crypto
Interface TlsAgreement
- All Known Implementing Classes:
BcTlsDH
,BcTlsECDH
,BcTlsMLKem
,BcX25519
,BcX448
,JceTlsDH
,JceTlsECDH
,JceTlsMLKem
,JceX25519
,JceX448
public interface TlsAgreement
Base interface for ephemeral key agreement calculator.
-
Method Summary
Modifier and TypeMethodDescriptionCalculate the agreed secret based on the calculator's current state.byte[]
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.
-
Method Details
-
generateEphemeral
Generate an ephemeral key pair, returning the encoding of the public key.- Returns:
- a byte encoding of the public key.
- Throws:
IOException
- in case of error.
-
receivePeerValue
Pass in the public key for the peer to the agreement calculator.- Parameters:
peerValue
- a byte encoding of the peer public key.- Throws:
IOException
- in case of error.
-
calculateSecret
Calculate the agreed secret based on the calculator's current state.- Returns:
- the calculated secret.
- Throws:
IOException
- in case of error.
-