pub struct KeyRing { /* private fields */ }Expand description
The current key, plus any retired ones still needed to read old payloads.
Rotation is the whole point. Adding a key to the front of the ring means everything written from then on uses it, while everything already written still decrypts — so a rotation is a deploy, not a migration.
Implementations§
Source§impl KeyRing
impl KeyRing
Sourcepub fn with_previous(self, key: Key) -> Self
pub fn with_previous(self, key: Key) -> Self
Add a retired key, usable for decryption only.
Order among retired keys does not matter; lookup is by id.
Sourcepub fn from_base64(current: &str, previous: &[String]) -> Result<Self>
pub fn from_base64(current: &str, previous: &[String]) -> Result<Self>
Build from an application key and any number of retired ones.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyRing
impl RefUnwindSafe for KeyRing
impl Send for KeyRing
impl Sync for KeyRing
impl Unpin for KeyRing
impl UnsafeUnpin for KeyRing
impl UnwindSafe for KeyRing
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