pub fn decode_cookie(
key: SigningKey,
name: impl AsRef<[u8]>,
value: impl AsRef<[u8]>,
) -> Result<Vec<u8>, DecodeError>Expand description
Decrypt & verify the signature of a cookie value.
See decode_cookie_advanced for no_std support.
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.
Returns Err(DecodeCookieError) if the value argument is empty.
Inspired by the cookie crate.