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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
extractSecret(byte[] encapsulated)
Extracts the secret from an encapsulation ciphertext.int
getEncapsulationLength()
Gets the required encapsulation length in bytes.byte[]
getPublicKey()
Gets the KEM public key.void
init()
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
- ifencapsulated
doesn'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.
-
-