Trait encryption_export::Backend[][src]

pub trait Backend: 'static + Sync + Send + Debug {
    pub fn encrypt(&self, plaintext: &[u8]) -> Result<EncryptedContent, Error>;
pub fn decrypt(
        &self,
        ciphertext: &EncryptedContent
    ) -> Result<Vec<u8, Global>, Error>;
pub 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

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

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

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

Tests whether this backend is secure.

Loading content...

Implementations on Foreign Types

impl Backend for PlaintextBackend[src]

impl Backend for FileBackend[src]

Loading content...

Implementors

impl Backend for KmsBackend[src]

Loading content...