Skip to main content

CloudKms

pub trait CloudKms: Send + Sync {
    // Required methods
    fn encrypt(&self, plaintext: &[u8], key_id: &str) -> Result<Vec<u8>, String>;
    fn decrypt(
        &self,
        ciphertext: &[u8],
        key_id: &str,
    ) -> Result<Vec<u8>, String>;
    fn create_key(&self, key_id: &str) -> Result<(), String>;
    fn delete_key(&self, key_id: &str) -> Result<(), String>;
    fn key_exists(&self, key_id: &str) -> bool;
    fn name(&self) -> &str;
}

Required Methods§

Source

fn encrypt(&self, plaintext: &[u8], key_id: &str) -> Result<Vec<u8>, String>

Source

fn decrypt(&self, ciphertext: &[u8], key_id: &str) -> Result<Vec<u8>, String>

Source

fn create_key(&self, key_id: &str) -> Result<(), String>

Source

fn delete_key(&self, key_id: &str) -> Result<(), String>

Source

fn key_exists(&self, key_id: &str) -> bool

Source

fn name(&self) -> &str

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§