StaticfromCreate an EncapsulationPrivateKey from an X25519PrivateKey.
StaticfromCreate an EncapsulationPrivateKey from raw X25519 private key bytes.
StaticfromCreate an EncapsulationPrivateKey from an MLKEMPrivateKey.
StaticfromCreate an EncapsulationPrivateKey from raw MLKEM private key bytes.
StaticnewGenerate a new random X25519 encapsulation private key.
StaticrandomGenerate a new random X25519 encapsulation private key.
StaticnewGenerate a new random X25519 encapsulation private key using provided RNG.
StaticnewGenerate a new MLKEM encapsulation private key.
StaticnewGenerate a new MLKEM encapsulation private key using provided RNG.
StatickeypairGenerate a new keypair for X25519.
StatickeypairGenerate a new keypair using the given RNG (X25519).
StaticmlkemGenerate a new MLKEM keypair.
StaticmlkemGenerate a new MLKEM keypair using the given RNG.
Returns the encapsulation scheme.
Returns true if this is an X25519 private key.
Returns true if this is an MLKEM private key.
Returns the X25519 private key if this is an X25519 encapsulation key.
Returns the MLKEM private key if this is an MLKEM encapsulation key.
Returns the X25519 private key if available, or null.
Returns the MLKEM private key if available, or null.
Returns the raw private key data.
Get the public key corresponding to this private key.
Decapsulate a shared secret from ciphertext.
The ciphertext from encapsulation
The decapsulated shared secret
Compare with another EncapsulationPrivateKey.
Get string representation.
Returns a unique reference to this EncapsulationPrivateKey instance.
The reference is derived from the SHA-256 hash of the tagged CBOR representation, providing a unique, content-addressable identifier.
Returns the CBOR tags associated with this private key.
Returns the untagged CBOR encoding.
Returns the tagged CBOR encoding.
Returns the tagged value in CBOR binary representation.
Creates an EncapsulationPrivateKey by decoding it from untagged CBOR. Note: Without tags, we assume X25519 scheme.
Creates an EncapsulationPrivateKey by decoding it from tagged CBOR.
StaticfromStaticfromStatic method to decode from tagged CBOR binary data.
StaticfromStatic method to decode from untagged CBOR binary data.
Returns the UR representation.
Returns the UR string representation.
StaticfromStaticfromCreates an EncapsulationPrivateKey from a UR string.
Represents a private key for key encapsulation.
Use this to decapsulate a shared secret from ciphertext.