pub struct CookieSigner { /* private fields */ }Expand description
Signs and verifies cookie values
Implementations§
Source§impl CookieSigner
impl CookieSigner
Sourcepub fn new(key: &[u8]) -> Result<Self>
pub fn new(key: &[u8]) -> Result<Self>
key must be at least 32 bytes of randomness (see
random_bytes)
Sourcepub fn previous_key(self, key: &[u8]) -> Result<Self>
pub fn previous_key(self, key: &[u8]) -> Result<Self>
An older key that still verifies cookies (key rotation)
Trait Implementations§
Source§impl Clone for CookieSigner
impl Clone for CookieSigner
Auto Trait Implementations§
impl Freeze for CookieSigner
impl RefUnwindSafe for CookieSigner
impl Send for CookieSigner
impl Sync for CookieSigner
impl Unpin for CookieSigner
impl UnsafeUnpin for CookieSigner
impl UnwindSafe for CookieSigner
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