pub struct PrivateCookies<'a> { /* private fields */ }Expand description
A cookie jar that provides authenticated encryption for its cookies.
A private child jar signs and encrypts all the cookies added to it and
verifies and decrypts cookies retrieved from it. Any cookies stored in
PrivateCookies are simultaneously assured confidentiality, integrity, and
authenticity. In other words, clients cannot discover nor tamper with the
contents of a cookie, nor can they fabricate cookie data.
Implementations§
Source§impl<'a> PrivateCookies<'a>
impl<'a> PrivateCookies<'a>
Sourcepub fn add(&self, cookie: Cookie<'static>)
pub fn add(&self, cookie: Cookie<'static>)
Adds cookie to the parent jar. The cookie’s value is encrypted with
authenticated encryption assuring confidentiality, integrity, and
authenticity.
Sourcepub fn get(&self, name: &str) -> Option<Cookie<'static>>
pub fn get(&self, name: &str) -> Option<Cookie<'static>>
Returns a reference to the Cookie inside this jar with the name name
and authenticates and decrypts the cookie’s value, returning a Cookie
with the decrypted value. If the cookie cannot be found, or the cookie
fails to authenticate or decrypt, None is returned.