Expand description
chacha20poly1305 AEAD wrapper for token-at-rest encryption.
The cipher operations live in the shared crate-internal aead core (one
implementation for both at-rest stacks); this module owns key loading
from {PREFIX}_OAUTH_ENCRYPTION_KEY and the upstream error taxonomy.
Every seal() call generates a fresh random 12-byte nonce. Callers
MUST store the returned nonce alongside the ciphertext and MUST NOT reuse
it. The upsert path in store.rs always replaces the stored nonce with
the one returned by seal().
Structs§
- Encryption
Key - A loaded 32-byte encryption key ready for
seal/open. Wiped from memory on drop.
Enums§
- Encryption
Error - Errors from encryption/decryption operations.
Functions§
- load_
key - Load a 32-byte key from a base64-encoded string (e.g.
{PREFIX}_OAUTH_ENCRYPTION_KEY). - open
- Decrypt
ciphertextusingkeyandnonce. - open_
with_ aad - seal
- Encrypt
plaintextunderkey, returning(ciphertext, nonce). - seal_
with_ aad