Static ReadonlySYMMETRIC_The byte length of a SymmetricKey.
A copy of the bytes; mutating it does not touch this value.
StaticcodecTagged-CBOR codec; decode also accepts the untagged form.
StaticrandomA fresh random value; pass rng to make it deterministic.
StaticfromStaticfromGet hex string representation.
Get base64 representation.
The reference: the digest of the tagged CBOR, as the reference computes it.
The first four bytes of reference() in hex, the reference's ref_hex_short.
The reference's Display: the type name over the short reference.
Encrypt the given plaintext with this key, and the given additional authenticated data and nonce.
Decrypt the given encrypted message with this key.
The CBOR tags this type decodes from; the first one is used to encode.
Returns the untagged CBOR encoding (as a byte string).
The tagged CBOR form.
As a UR, typed by the first tag's name.
Staticfrom
Symmetric key for ChaCha20-Poly1305 AEAD encryption (32 bytes)
A symmetric encryption key used for both encryption and decryption.
SymmetricKeyis a 32-byte cryptographic key used with ChaCha20-Poly1305 AEAD (Authenticated Encryption with Associated Data) encryption. This implementation follows the IETF ChaCha20-Poly1305 specification as defined in RFC-8439.Symmetric encryption uses the same key for both encryption and decryption, unlike asymmetric encryption where different keys are used for each operation.
CBOR Serialization
SymmetricKeyis serialized to CBOR with tag 40023.