Struct csrf::AesGcmCsrfProtection
[−]
[src]
pub struct AesGcmCsrfProtection { /* fields omitted */ }
Uses AES-GCM to provide signed, encrypted CSRF tokens and cookies.
Methods
impl AesGcmCsrfProtection
[src]
Trait Implementations
impl CsrfProtection for AesGcmCsrfProtection
[src]
fn from_password(password: &[u8]) -> Self
Using scrypt
with params n=12
, r=8
, p=1
, generate the key material used for the
underlying crypto functions.
Panics
This function may panic if the underlying crypto library fails catastrophically.
fn rng(&self) -> &SystemRandom
fn verify_token_pair(&self,
token: &UnencryptedCsrfToken,
cookie: &UnencryptedCsrfCookie)
-> bool
token: &UnencryptedCsrfToken,
cookie: &UnencryptedCsrfCookie)
-> bool
fn generate_token(&self, token: &[u8]) -> Result<CsrfToken, CsrfError>
fn parse_token(&self, token: &[u8]) -> Result<UnencryptedCsrfToken, CsrfError>
fn generate_token_pair(&self,
previous_token: Option<Vec<u8>>,
ttl_seconds: i64)
-> Result<(CsrfToken, CsrfCookie), CsrfError>
previous_token: Option<Vec<u8>>,
ttl_seconds: i64)
-> Result<(CsrfToken, CsrfCookie), CsrfError>