Skip to main content

KeyProvider

Trait KeyProvider 

Source
pub trait KeyProvider: Send + Sync {
    // Required method
    fn vault_key(&self) -> Result<Zeroizing<[u8; 32]>, CryptoError>;
}
Expand description

The seam through which an operator supplies the vault key.

Object-safe on purpose: a crate::Collection holds an Arc<dyn KeyProvider> so the store is not generic over the provider. Implementations MUST return CryptoError::Cold when no key is currently available, and SHOULD hand back a Zeroizing copy so the key is wiped when the borrow ends.

Required Methods§

Source

fn vault_key(&self) -> Result<Zeroizing<[u8; 32]>, CryptoError>

The 32-byte vault key, or CryptoError::Cold if the vault is locked.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§