Returns the encapsulation scheme.
The bytes (a view; do not mutate).
StaticcodecTagged-CBOR codec; the tag value selects the scheme, as the reference's TryFrom<CBOR>.
StaticfromCreate an EncapsulationCiphertext from an X25519PublicKey.
StaticfromCreate an EncapsulationCiphertext from raw X25519 data.
StaticfromCreate an EncapsulationCiphertext from an MLKEMCiphertext.
StaticfromCreate an EncapsulationCiphertext from raw MLKEM ciphertext bytes.
Returns true if this is an X25519 ciphertext.
Returns true if this is an MLKEM ciphertext.
Returns the X25519 public key if this is an X25519 ciphertext.
Returns the MLKEM ciphertext if this is an MLKEM ciphertext.
Returns the X25519 public key if available, or null.
Returns the MLKEM ciphertext if available, or null.
Compare with another EncapsulationCiphertext.
Get string representation.
Returns the CBOR tags associated with this ciphertext.
Returns the untagged CBOR encoding.
The tagged CBOR form; the tag follows the scheme.
StaticfromDecode tagged (X25519 or ML-KEM) or untagged (X25519) CBOR.
Represents the ciphertext from a key encapsulation operation.
For X25519, this wraps an ephemeral public key. For MLKEM, this wraps an MLKEMCiphertext.