Trait salvo_csrf::CsrfCipher
source · pub trait CsrfCipher: Send + Sync + 'static {
fn verify(&self, token: &[u8], secret: &[u8]) -> bool;
fn generate(&self) -> (Vec<u8>, Vec<u8>);
fn random_bytes(&self, len: usize) -> Vec<u8> ⓘ { ... }
}
Expand description
Generate secret and token and valid token.
Required Methods§
Provided Methods§
Implementors§
impl CsrfCipher for AesGcmCipher
Available on crate feature
aes-gcm-cipher
only.impl CsrfCipher for BcryptCipher
Available on crate feature
bcrypt-cipher
only.impl CsrfCipher for CcpCipher
Available on crate feature
ccp-cipher
only.impl CsrfCipher for HmacCipher
Available on crate feature
hmac-cipher
only.