Skip to main content

KmsClientFactory

Trait KmsClientFactory 

Source
pub trait KmsClientFactory:
    Debug
    + Send
    + Sync {
    // Required method
    fn create_kms_client<'life0, 'life1, 'async_trait>(
        &'life0 self,
        properties: &'life1 HashMap<String, String>,
    ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn KeyManagementClient>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Factory for creating a KeyManagementClient from catalog properties.

Replaces Java’s reflection-based encryption.kms-impl + initialize(properties) pattern. Users provide an implementation of this trait to the catalog builder via CatalogBuilder::with_kms_client_factory.

The catalog calls create_kms_client once during catalog initialization with the catalog’s properties. The resulting client is shared across all tables in the catalog and passed to each table’s EncryptionManager via TableBuilder::kms_client(...).

Required Methods§

Source

fn create_kms_client<'life0, 'life1, 'async_trait>( &'life0 self, properties: &'life1 HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn KeyManagementClient>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a KeyManagementClient from catalog properties.

Called once during catalog initialization. Properties may include KMS endpoint, region, credentials, or any backend-specific configuration needed to construct the client.

Implementors§