Struct csrf::ChaCha20Poly1305CsrfProtection [] [src]

pub struct ChaCha20Poly1305CsrfProtection { /* fields omitted */ }

Uses ChaCha20Poly1305 to provide signed, encrypted CSRF tokens and cookies.

Methods

impl ChaCha20Poly1305CsrfProtection
[src]

[src]

Given a key, return a ChaCha20Poly1305CsrfProtection instance.

Trait Implementations

impl CsrfProtection for ChaCha20Poly1305CsrfProtection
[src]

Given a nonce and a time to live (TTL), create a cookie to send to the end user.

[src]

Given a nonce, create a token to send to the end user.

Given a decoded byte array, deserialize, decrypt, and verify the cookie.

[src]

Given a decoded byte array, deserialize, decrypt, and verify the token.

[src]

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

[src]

Given a buffer, fill it with random bytes or error if this is not possible.

[src]

Given an optional previous token and a TTL, generate a matching token and cookie pair.