StaticfromCreate an EncapsulationPrivateKey from an X25519PrivateKey.
StaticfromCreate an EncapsulationPrivateKey from raw X25519 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.
StatickeypairGenerate a new keypair.
StatickeypairGenerate a new keypair using the given RNG.
Returns the encapsulation scheme.
Returns true if this is an X25519 private key.
Returns the X25519 private key if this is an X25519 encapsulation key.
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.