pub trait CryptoProvider: Send + Sync {
// Required methods
fn provider_id(&self) -> CryptoProviderId;
fn generate_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: GenerateKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn generate_sealing_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: GenerateSealingKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn import_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: ImportKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
request: SignRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn verify<'life0, 'life1, 'async_trait>(
&'life0 self,
request: VerifyRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<bool, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn encapsulate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: EncapsulateRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Encapsulation, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn decapsulate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: DecapsulateRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Zeroizing<Vec<u8>>, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn wrap_envelope<'life0, 'life1, 'async_trait>(
&'life0 self,
request: WrapEnvelopeRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Envelope, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn unwrap_envelope<'life0, 'life1, 'async_trait>(
&'life0 self,
request: UnwrapEnvelopeRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Provider-neutral crypto operations.
Required Methods§
Sourcefn provider_id(&self) -> CryptoProviderId
fn provider_id(&self) -> CryptoProviderId
Stable provider identifier.
Sourcefn generate_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: GenerateKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: GenerateKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate a new provider-native signing key.
Sourcefn generate_sealing_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: GenerateSealingKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_sealing_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: GenerateSealingKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate a new provider-native KEM sealing (recipient) key.
Sourcefn import_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: ImportKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn import_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: ImportKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Import caller-provided key material.
Sourcefn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
request: SignRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
request: SignRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sign in place.
Sourcefn verify<'life0, 'life1, 'async_trait>(
&'life0 self,
request: VerifyRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<bool, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn verify<'life0, 'life1, 'async_trait>(
&'life0 self,
request: VerifyRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<bool, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Verify with provider-held public material.
Sourcefn encapsulate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: EncapsulateRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Encapsulation, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn encapsulate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: EncapsulateRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Encapsulation, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
KEM encapsulation.
Sourcefn decapsulate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: DecapsulateRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Zeroizing<Vec<u8>>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn decapsulate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: DecapsulateRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Zeroizing<Vec<u8>>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
KEM decapsulation.
Sourcefn wrap_envelope<'life0, 'life1, 'async_trait>(
&'life0 self,
request: WrapEnvelopeRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Envelope, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn wrap_envelope<'life0, 'life1, 'async_trait>(
&'life0 self,
request: WrapEnvelopeRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Envelope, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
KEM plus envelope encryption.
Sourcefn unwrap_envelope<'life0, 'life1, 'async_trait>(
&'life0 self,
request: UnwrapEnvelopeRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unwrap_envelope<'life0, 'life1, 'async_trait>(
&'life0 self,
request: UnwrapEnvelopeRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
KEM plus envelope decryption.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".