Trait encryption::Backend[][src]

pub trait Backend: Sync + Send + Debug + 'static {
    fn encrypt(&self, plaintext: &[u8]) -> Result<EncryptedContent>;
fn decrypt(&self, ciphertext: &EncryptedContent) -> Result<Vec<u8>>;
fn is_secure(&self) -> bool; }

Provide API to encrypt/decrypt key dictionary content.

Can be back by KMS, or a key read from a file. If file is used, it will prefix the result with the IV (nonce + initial counter) on encrypt, and decode the IV on decrypt.

Required methods

fn encrypt(&self, plaintext: &[u8]) -> Result<EncryptedContent>[src]

fn decrypt(&self, ciphertext: &EncryptedContent) -> Result<Vec<u8>>[src]

fn is_secure(&self) -> bool[src]

Tests whether this backend is secure.

Loading content...

Implementors

impl Backend for FileBackend[src]

impl Backend for KmsBackend[src]

impl Backend for PlaintextBackend[src]

Loading content...