pub trait KmsClient: Send + Sync {
// Required methods
fn create_key<'life0, 'async_trait>(
&'life0 self,
alias: String,
purpose: KeyPurpose,
algorithm: KeyAlgorithm,
) -> Pin<Box<dyn Future<Output = Result<KeyMetadata>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<KeyMetadata>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_keys<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<KeyMetadata>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn encrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
plaintext: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn decrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
ciphertext: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn rotate_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<KeyMetadata>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn disable_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn enable_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn generate_data_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<u8>, Vec<u8>)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
KMS client trait
Required Methods§
Sourcefn create_key<'life0, 'async_trait>(
&'life0 self,
alias: String,
purpose: KeyPurpose,
algorithm: KeyAlgorithm,
) -> Pin<Box<dyn Future<Output = Result<KeyMetadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_key<'life0, 'async_trait>(
&'life0 self,
alias: String,
purpose: KeyPurpose,
algorithm: KeyAlgorithm,
) -> Pin<Box<dyn Future<Output = Result<KeyMetadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new key
Sourcefn get_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<KeyMetadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<KeyMetadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get key metadata
Sourcefn list_keys<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<KeyMetadata>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_keys<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<KeyMetadata>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all keys
Sourcefn encrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
plaintext: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn encrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
plaintext: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Encrypt data using KMS
Sourcefn decrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
ciphertext: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn decrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
ciphertext: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Decrypt data using KMS
Sourcefn rotate_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<KeyMetadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn rotate_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<KeyMetadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Rotate key
Sourcefn disable_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn disable_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Disable key
Sourcefn enable_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn enable_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Enable key
Sourcefn generate_data_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<u8>, Vec<u8>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_data_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<u8>, Vec<u8>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate data encryption key (for envelope encryption)