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 Type
    Method
    Description
    Calculate 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

      byte[] generateEphemeral() throws IOException
      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

      void receivePeerValue(byte[] peerValue) throws IOException
      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

      TlsSecret calculateSecret() throws IOException
      Calculate the agreed secret based on the calculator's current state.
      Returns:
      the calculated secret.
      Throws:
      IOException - in case of error.