pub trait KeyProvider: Send + Sync {
// Required method
fn on_key_request(
&self,
ctx: &Context,
id: KeyIdentifier<'_>,
kind: RequestedKeyType,
) -> KeyRequestOutcome;
}Expand description
Trait implemented by the consumer to feed keys into librnp on demand.
Called by librnp during verify/decrypt when the keyring doesn’t have a
key the operation needs. The implementation typically inspects id
and kind, fetches the key bytes from some external store, and calls
Context::load_keys on the supplied
ctx. Returns KeyRequestOutcome::Found if a key was loaded,
KeyRequestOutcome::NotFound otherwise.
Required Methods§
fn on_key_request( &self, ctx: &Context, id: KeyIdentifier<'_>, kind: RequestedKeyType, ) -> KeyRequestOutcome
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".