Package org.apache.sshd.common.kex
Interface KeyEncapsulationMethod.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.intGets the required encapsulation length in bytes.byte[]Gets the KEM public key.voidinit()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- ifencapsulateddoesn'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.
-