Function simple_cookie::decode_cookie
source · pub fn decode_cookie<Name: AsRef<str>, Value: AsRef<[u8]>>(
key: &SigningKey,
name: Name,
value: Value
) -> Option<Vec<u8>>Expand description
Decrypt & verify the signature of a cookie value.
The name of the cookie is included in the signed content generated by encode_cookie, and is cross-referenced with the value you provide here to guarantee that the cookie’s encrypted content was not swapped with the encrypted content of another cookie. For security purposes (e.g. to prevent side-channel attacks) no details about a decoding failure are returned.
Inspired by the cookie crate.