A copy of the ciphertext.
A copy of the additional authenticated data.
Returns a reference to the nonce value used for encryption.
Returns a reference to the authentication tag value used for encryption.
StaticcodecTagged-CBOR codec; decode also accepts the untagged form.
StaticfromAssemble a message from its parts (no encryption happens here).
Returns a CBOR representation in the AAD field, if it exists.
Returns a Digest instance if the AAD data can be parsed as CBOR.
Returns true if the AAD data can be parsed as a Digest.
Get string representation.
The CBOR tags this type decodes from; the first one is used to encode.
Returns the untagged CBOR encoding (as an array). Array format: [ciphertext, nonce, auth, ?aad]
The tagged CBOR form.
As a UR, typed by the first tag's name.
Staticfrom
Encrypted message with ChaCha20-Poly1305 AEAD
A secure encrypted message using IETF ChaCha20-Poly1305 authenticated encryption.
EncryptedMessagerepresents data that has been encrypted using a symmetric key with the ChaCha20-Poly1305 AEAD (Authenticated Encryption with Associated Data) construction as specified in RFC-8439.An
EncryptedMessagecontains:ciphertext: The encrypted data (same length as the original plaintext)aad: Additional Authenticated Data that is not encrypted but is authenticated (optional)nonce: A 12-byte number used once for this specific encryption operationauth: A 16-byte authentication tag that verifies the integrity of the messageThe
aadfield is often used to include theDigestof the plaintext, which allows verification of the plaintext after decryption and preserves the unique identity of the data when used with structures like Gordian Envelope.CBOR Serialization
EncryptedMessageis serialized to CBOR with tag 40002.CDDL:
UR Serialization
When serialized as a Uniform Resource (UR), an
EncryptedMessageis represented with the type "encrypted".