pub trait KeyProvider:
Send
+ Sync
+ Debug {
// Required methods
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CompileError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn verify<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
signature: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<bool, CompileError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn public_key_bytes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CompileError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn supports_local_delegation(&self) -> bool { ... }
}Expand description
Abstraction for cryptographic signing operations.
Implementations handle key storage, signing, and verification.
The default LocalKeyProvider stores keys on-disk; future
implementations can integrate with external KMS services.
Required Methods§
Sourcefn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CompileError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CompileError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sign the given data and return the signature bytes.
Sourcefn verify<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
signature: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<bool, CompileError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn verify<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
signature: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<bool, CompileError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Verify a signature against the given data.
Sourcefn public_key_bytes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CompileError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn public_key_bytes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CompileError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the public key bytes (for embedding in descriptors).
Provided Methods§
Sourcefn supports_local_delegation(&self) -> bool
fn supports_local_delegation(&self) -> bool
Whether this captured provider signs entirely in memory, without fresh key lookup, filesystem access, networking or another ambient credential. Unknown/KMS implementations need an explicit delegated binding first.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".