Package org.apache.sshd.common.kex
Class MLKEM.Client
- java.lang.Object
-
- org.apache.sshd.common.kex.MLKEM.Client
-
- All Implemented Interfaces:
KeyEncapsulationMethod.Client
- Enclosing class:
- MLKEM
private static class MLKEM.Client extends java.lang.Object implements KeyEncapsulationMethod.Client
-
-
Field Summary
Fields Modifier and Type Field Description private org.bouncycastle.pqc.crypto.mlkem.MLKEMExtractorextractorprivate MLKEM.Parametersparametersprivate org.bouncycastle.pqc.crypto.mlkem.MLKEMPublicKeyParameterspublicKey
-
Constructor Summary
Constructors Constructor Description Client(MLKEM.Parameters parameters)
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Field Detail
-
parameters
private final MLKEM.Parameters parameters
-
extractor
private org.bouncycastle.pqc.crypto.mlkem.MLKEMExtractor extractor
-
publicKey
private org.bouncycastle.pqc.crypto.mlkem.MLKEMPublicKeyParameters publicKey
-
-
Constructor Detail
-
Client
Client(MLKEM.Parameters parameters)
-
-
Method Detail
-
init
public void init()
Description copied from interface:KeyEncapsulationMethod.ClientInitializes the KEM and generates a new key pair.- Specified by:
initin interfaceKeyEncapsulationMethod.Client
-
getPublicKey
public byte[] getPublicKey()
Description copied from interface:KeyEncapsulationMethod.ClientGets the KEM public key.- Specified by:
getPublicKeyin interfaceKeyEncapsulationMethod.Client- Returns:
- the KEM public key.
-
extractSecret
public byte[] extractSecret(byte[] encapsulated)
Description copied from interface:KeyEncapsulationMethod.ClientExtracts the secret from an encapsulation ciphertext.- Specified by:
extractSecretin interfaceKeyEncapsulationMethod.Client- Parameters:
encapsulated- ciphertext to process.- Returns:
- the secret from an encapsulation ciphertext.
-
getEncapsulationLength
public int getEncapsulationLength()
Description copied from interface:KeyEncapsulationMethod.ClientGets the required encapsulation length in bytes.- Specified by:
getEncapsulationLengthin interfaceKeyEncapsulationMethod.Client- Returns:
- the length required for a valid encapsulation ciphertext.
-
-