Package org.apache.sshd.common.kex
Interface KeyEncapsulationMethod.Server
-
- All Known Implementing Classes:
SNTRUP761.Server
- Enclosing interface:
- KeyEncapsulationMethod
public static interface KeyEncapsulationMethod.Server
Server-side KEM operations.
-
-
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
- ifpublicKey
does not have enough bytes for a valid public keyjava.lang.NullPointerException
- ifpublicKey == 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
-
-