Skip to main content

decrypt_cookie

Function decrypt_cookie 

Source
pub fn decrypt_cookie(encrypted: &str, key: &[u8]) -> Option<String>
Available on crate feature crypto only.
Expand description

Decrypts a cookie value produced by encrypted_cookie. Returns the original value on success. Returns None on any failure — malformed input, the wrong key, or a tampered/corrupted ciphertext (GCM’s authentication tag check fails closed rather than returning garbage).