pub trait RandomizedDigestSigner<D: Update, S> {
// Required method
fn try_sign_digest_with_rng<R: TryCryptoRng + ?Sized, F: Fn(&mut D) -> Result<(), Error>>(
&self,
rng: &mut R,
f: F,
) -> Result<S, Error>;
// Provided method
fn sign_digest_with_rng<R: CryptoRng + ?Sized, F: Fn(&mut D)>(
&self,
rng: &mut R,
f: F,
) -> S { ... }
}Expand description
Combination of DigestSigner and RandomizedSigner with support for computing a signature
over a digest which requires entropy from an RNG.
Required Methods§
Sourcefn try_sign_digest_with_rng<R: TryCryptoRng + ?Sized, F: Fn(&mut D) -> Result<(), Error>>(
&self,
rng: &mut R,
f: F,
) -> Result<S, Error>
fn try_sign_digest_with_rng<R: TryCryptoRng + ?Sized, F: Fn(&mut D) -> Result<(), Error>>( &self, rng: &mut R, f: F, ) -> Result<S, Error>
Attempt to sign a message by updating the received Digest with it, returning a digital
signature on success, or an error if something went wrong.
The given function can be invoked multiple times. It is expected that in each invocation the
Digest is updated with the entire equal message.
§Errors
Returns implementation-specific errors in the event signing failed (e.g. KMS or HSM
communication error), or if the provided rng experiences an internal failure.
Provided Methods§
Sourcefn sign_digest_with_rng<R: CryptoRng + ?Sized, F: Fn(&mut D)>(
&self,
rng: &mut R,
f: F,
) -> S
fn sign_digest_with_rng<R: CryptoRng + ?Sized, F: Fn(&mut D)>( &self, rng: &mut R, f: F, ) -> S
Sign a message by updating the received Digest with it, returning a signature.
The given function can be invoked multiple times. It is expected that in each invocation the
Digest is updated with the entire equal message.
§Panics
In the event of a signing error.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.