pub trait KeyProvider:
Send
+ Sync
+ Debug {
// Required methods
fn current_key(&self) -> Result<(SecretKey, String), AuthError>;
fn key_by_id(&self, key_id: &str) -> Result<SecretKey, AuthError>;
fn key_ids(&self) -> Vec<String>;
}Expand description
Trait for providing encryption keys.
Implementations can load keys from files, environment variables, or external KMS services.
All key material is returned as SecretKey to ensure automatic
zeroization when the consumer drops the value.
Required Methods§
Sourcefn current_key(&self) -> Result<(SecretKey, String), AuthError>
fn current_key(&self) -> Result<(SecretKey, String), AuthError>
Get the current (latest) encryption key and its ID.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".