pub struct Keys { /* private fields */ }Expand description
Keys derived from the configured secrets. The first secret signs and encrypts; every secret verifies and decrypts, so secrets rotate without signing anyone out.
Implementations§
Source§impl Keys
impl Keys
Sourcepub fn sign(&self, purpose: SignPurpose, value: &str) -> String
pub fn sign(&self, purpose: SignPurpose, value: &str) -> String
value.signature, signature base64url.
Sourcepub fn verify<'a>(
&self,
purpose: SignPurpose,
signed: &'a str,
) -> Option<&'a str>
pub fn verify<'a>( &self, purpose: SignPurpose, signed: &'a str, ) -> Option<&'a str>
The value, when the signature matches any configured secret.
pub fn decrypt(&self, data: &[u8]) -> Option<Vec<u8>>
Trait Implementations§
Auto Trait Implementations§
impl Forget for Keys
impl Freeze for Keys
impl Move for Keys
impl RefUnwindSafe for Keys
impl Send for Keys
impl Sync for Keys
impl Unpin for Keys
impl UnsafeUnpin for Keys
impl UnwindSafe for Keys
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