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 the encapsulation scheme.
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.
Returns the raw ciphertext data.
Compare with another EncapsulationCiphertext.
Get string representation.
Returns the CBOR tags associated with this ciphertext.
Returns the untagged CBOR encoding.
Returns the tagged CBOR encoding.
Returns the tagged value in CBOR binary representation.
Creates an EncapsulationCiphertext by decoding it from untagged CBOR. Note: Without tags, we assume X25519 scheme.
Creates an EncapsulationCiphertext by decoding it from tagged CBOR.
StaticfromStaticfromStatic method to decode from tagged CBOR binary data.
StaticfromStatic method to decode from untagged CBOR binary data.
Represents the ciphertext from a key encapsulation operation.
For X25519, this wraps an ephemeral public key. For MLKEM, this wraps an MLKEMCiphertext.