Package org.apache.sshd.common.kex
Interface KeyEncapsulationMethod.Client
-
- All Known Implementing Classes:
MLKEM.Client,SNTRUP761.Client
- Enclosing interface:
- KeyEncapsulationMethod
public static interface KeyEncapsulationMethod.ClientClient-side KEM operations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]extractSecret(byte[] encapsulated)Extracts the secret from an encapsulation ciphertext.intgetEncapsulationLength()Gets the required encapsulation length in bytes.byte[]getPublicKey()Gets the KEM public key.voidinit()Initializes the KEM and generates a new key pair.
-
-
-
Method Detail
-
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:
java.lang.IllegalArgumentException- ifencapsulateddoesn't have the expected lengthjava.lang.NullPointerException- ifencapsulated == null
-
getEncapsulationLength
int getEncapsulationLength()
Gets the required encapsulation length in bytes.- Returns:
- the length required for a valid encapsulation ciphertext.
-
-