pub trait EncryptorDecryptor: Send + Sync {
// Required methods
fn encrypt(&self, cleartext: Vec<u8>) -> ApiResult<Vec<u8>>;
fn decrypt(&self, ciphertext: Vec<u8>) -> ApiResult<Vec<u8>>;
}
Expand description
This is the generic EncryptorDecryptor trait, as handed over to the Store during initialization. Consumers can implement either this generic trait and bring in their own crypto, or leverage the ManagedEncryptorDecryptor below, which provides encryption algorithms out of the box.
Note that EncryptorDecryptor must not call any LoginStore methods. The login store can call out to the EncryptorDecryptor when it’s internal mutex is held so calling back in to the LoginStore may deadlock.