Trait signature::RandomizedSigner
source · pub trait RandomizedSigner<S> {
fn try_sign_with_rng(
&self,
rng: &mut impl CryptoRngCore,
msg: &[u8]
) -> Result<S, Error>;
fn sign_with_rng(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S { ... }
}
Available on crate feature
rand-preview
only.Expand description
Sign the given message using the provided external randomness source.
Required Methods
sourcefn try_sign_with_rng(
&self,
rng: &mut impl CryptoRngCore,
msg: &[u8]
) -> Result<S, Error>
fn try_sign_with_rng(
&self,
rng: &mut impl CryptoRngCore,
msg: &[u8]
) -> Result<S, Error>
Attempt to sign the given message, returning a digital signature on success, or an error if something went wrong.
The main intended use case for signing errors is when communicating with external signers, e.g. cloud KMS, HSMs, or other hardware tokens.
Provided Methods
sourcefn sign_with_rng(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S
fn sign_with_rng(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S
Sign the given message and return a digital signature