autofill::encryption

Type Alias EncryptorDecryptor

Source
pub type EncryptorDecryptor = EncryptorDecryptor<Error>;

Aliased Type§

struct EncryptorDecryptor { /* private fields */ }

Implementations

§

impl<E> EncryptorDecryptor<E>
where E: From<EncryptorDecryptorError>,

pub fn create_key() -> Result<String, E>

Create a key that can be used to construct an EncryptorDecryptor

pub fn new(key: &str) -> Result<EncryptorDecryptor<E>, E>

pub fn new_with_random_key() -> Result<EncryptorDecryptor<E>, E>

pub fn encrypt(&self, cleartext: &str, description: &str) -> Result<String, E>

Encrypt a string

description is a developer-friendly description of the operation that gets reported to Sentry on crypto errors.

pub fn encrypt_struct<T>( &self, fields: &T, description: &str, ) -> Result<String, E>
where T: Serialize,

Encrypt a struct

description is a developer-friendly description of the operation that gets reported to Sentry on crypto errors.

pub fn decrypt(&self, ciphertext: &str, description: &str) -> Result<String, E>

Decrypt a string

description is a developer-friendly description of the operation that gets reported to Sentry on crypto errors.

pub fn decrypt_struct<T>( &self, ciphertext: &str, description: &str, ) -> Result<T, E>

Decrypt a struct

description is a developer-friendly description of the operation that gets reported to Sentry on crypto errors.

pub fn create_canary(&self, text: &str) -> Result<String, E>

pub fn check_canary(&self, canary: &str, text: &str) -> Result<bool, E>

Trait Implementations

§

impl<E> Send for EncryptorDecryptor<E>

§

impl<E> Sync for EncryptorDecryptor<E>