pub trait CryptoProvider:
Debug
+ Send
+ Sync {
// Required methods
fn digest(
&self,
algorithm: DigestAlgorithm,
) -> Result<Box<dyn DigestContext>>;
fn hmac(
&self,
algorithm: DigestAlgorithm,
secret: &[u8],
) -> Result<Box<dyn HmacContext>>;
fn sign(
&self,
algorithm: SigningAlgorithm,
pem: &[u8],
) -> Result<Box<dyn Signer>>;
}Available on crate feature
cloud-base and (crate features aws-base or azure-base or gcp-base) only.Expand description
Provides cryptographic primitives
Required Methods§
Sourcefn digest(&self, algorithm: DigestAlgorithm) -> Result<Box<dyn DigestContext>>
fn digest(&self, algorithm: DigestAlgorithm) -> Result<Box<dyn DigestContext>>
Compute a digest
Sourcefn hmac(
&self,
algorithm: DigestAlgorithm,
secret: &[u8],
) -> Result<Box<dyn HmacContext>>
fn hmac( &self, algorithm: DigestAlgorithm, secret: &[u8], ) -> Result<Box<dyn HmacContext>>
Compute an HMAC with the provided secret
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".