Struct csrf::MultiCsrfProtection[][src]

pub struct MultiCsrfProtection { /* fields omitted */ }
Expand description

This is used when one wants to rotate keys or switch from implementation to another. It accepts 1 + N instances of CsrfProtection and uses only the first to generate tokens and cookies. The N remaining instances are used only for parsing.

Implementations

Create a new MultiCsrfProtection from one current CsrfProtection and some N previous instances of CsrfProtection.

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.

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.

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.