pub struct MultiEpochOrgCipher { /* private fields */ }Expand description
A multi-epoch org cipher: holds the per-epoch derived audience keys and, on
decrypt, selects EXACTLY ONE by the envelope’s kid — it NEVER iterates the
keyring (no trial-decrypt / wrong-key-acceptance). Encrypt always uses the
NEWEST epoch held and stamps kid. This is what makes rotation expressible: a
remaining member holding {N, N+1} decrypts old ops under N and new ops under
N+1, deterministically. Fail-closed: an unknown kid, a missing kid, or an
empty keyring all error (the op stays opaque) — never a wrong key.
Implementations§
Trait Implementations§
Source§impl Debug for MultiEpochOrgCipher
impl Debug for MultiEpochOrgCipher
Source§impl PayloadCipher for MultiEpochOrgCipher
impl PayloadCipher for MultiEpochOrgCipher
Source§fn encrypt(&self, plaintext: &Value) -> Result<Value, CryptoError>
fn encrypt(&self, plaintext: &Value) -> Result<Value, CryptoError>
Encrypt a cleartext payload into a ciphertext
Envelope (as a
Value).Source§fn decrypt(&self, envelope: &Value) -> Result<Value, CryptoError>
fn decrypt(&self, envelope: &Value) -> Result<Value, CryptoError>
Recover the cleartext payload from a ciphertext
Envelope. Fails
(CryptoError::Decrypt) on a wrong key or any tamper.Auto Trait Implementations§
impl Freeze for MultiEpochOrgCipher
impl RefUnwindSafe for MultiEpochOrgCipher
impl Send for MultiEpochOrgCipher
impl Sync for MultiEpochOrgCipher
impl Unpin for MultiEpochOrgCipher
impl UnsafeUnpin for MultiEpochOrgCipher
impl UnwindSafe for MultiEpochOrgCipher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more