Package org.apache.sshd.common.kex
Interface KeyEncapsulationMethod.Client
- All Known Implementing Classes:
SNTRUP761.Client
- Enclosing interface:
KeyEncapsulationMethod
public static interface KeyEncapsulationMethod.Client
Client-side KEM operations.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
extractSecret
(byte[] encapsulated) Extracts the secret from an encapsulation ciphertext.int
Gets the required encapsulation length in bytes.byte[]
Gets the KEM public key.void
init()
Initializes the KEM and generates a new key pair.
-
Method Details
-
init
void init()Initializes the KEM and generates a new key pair. -
getPublicKey
byte[] getPublicKey()Gets the KEM public key.- Returns:
- the KEM public key.
-
extractSecret
byte[] extractSecret(byte[] encapsulated) Extracts the secret from an encapsulation ciphertext.- Parameters:
encapsulated
- ciphertext to process.- Returns:
- the secret from an encapsulation ciphertext.
- Throws:
IllegalArgumentException
- ifencapsulated
doesn't have the expected lengthNullPointerException
- ifencapsulated == null
-
getEncapsulationLength
int getEncapsulationLength()Gets the required encapsulation length in bytes.- Returns:
- the length required for a valid encapsulation ciphertext.
-