Interface KeyEncapsulationMethod.Server

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      byte[] getEncapsulation()
      Retrieves the encapsulation of the secret.
      byte[] getSecret()
      Retrieves the secret.
      byte[] init​(byte[] publicKey)
      Initializes the KEM with a public key received from a client and prepares an encapsulated secret.
    • Method Detail

      • init

        byte[] init​(byte[] publicKey)
        Initializes the KEM with a public key received from a client and prepares an encapsulated secret.
        Parameters:
        publicKey - data received from the client, expected to contain the public key at the start
        Returns:
        the remaining bytes of publicKey after the public key
        Throws:
        java.lang.IllegalArgumentException - if publicKey does not have enough bytes for a valid public key
        java.lang.NullPointerException - if publicKey == null
      • getSecret

        byte[] getSecret()
        Retrieves the secret.
        Returns:
        the secret, not encapsulated
      • getEncapsulation

        byte[] getEncapsulation()
        Retrieves the encapsulation of the secret.
        Returns:
        the encapsulation of the secret that may be sent to the client