StaticfromCreate an EncapsulationPublicKey from an X25519PublicKey.
StaticfromCreate an EncapsulationPublicKey from raw X25519 public key bytes.
StaticfromCreate an EncapsulationPublicKey from an MLKEMPublicKey.
StaticfromCreate an EncapsulationPublicKey from raw MLKEM public key bytes.
Returns the encapsulation scheme.
Returns true if this is an X25519 public key.
Returns true if this is an MLKEM public key.
Returns the X25519 public key if available, or null.
Returns the MLKEM public key if available, or null.
Returns the raw public key data.
Returns this object as an EncapsulationPublicKey.
This method allows EncapsulationPublicKey to implement the Encrypter interface.
Since this class is itself an encapsulation public key, it returns this.
This encapsulation public key
Encapsulate a new shared secret for this public key.
This generates a random shared secret and encapsulates it so that only the holder of the corresponding private key can recover it.
A tuple of [sharedSecret, ciphertext]
Get string representation.
Returns a unique reference to this EncapsulationPublicKey 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 public key.
Returns the untagged CBOR encoding.
Returns the tagged CBOR encoding.
Returns the tagged value in CBOR binary representation.
Creates an EncapsulationPublicKey by decoding it from untagged CBOR. Note: Without tags, we assume X25519 scheme.
Creates an EncapsulationPublicKey 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.
StaticfromStaticfrom
Represents a public key for key encapsulation.
Use this to encapsulate a shared secret for a recipient.