Struct csrf::AesGcmCsrfProtection [−][src]
pub struct AesGcmCsrfProtection { /* fields omitted */ }
Expand description
Uses AES-GCM to provide signed, encrypted CSRF tokens and cookies.
Implementations
Trait Implementations
Given a nonce and a time to live (TTL), create a cookie to send to the end user.
Given a nonce, create a token to send to the end user.
Given a decoded byte array, deserialize, decrypt, and verify the cookie.
Given a decoded byte array, deserialize, decrypt, and verify the token.
fn verify_token_pair(
&self,
token: &UnencryptedCsrfToken,
cookie: &UnencryptedCsrfCookie
) -> bool
fn verify_token_pair(
&self,
token: &UnencryptedCsrfToken,
cookie: &UnencryptedCsrfCookie
) -> bool
Given a token pair that has been parsed, decoded, decrypted, and verified, return whether or not the token matches the cookie and they have not expired. Read more
Given a buffer, fill it with random bytes or error if this is not possible.