pub trait RandomizedSigner<S> {
// Required method
fn try_sign_with_rng(
&self,
rng: &mut impl CryptoRngCore,
msg: &[u8],
) -> Result<S, Error>;
// Provided method
fn sign_with_rng(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S { ... }
}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
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.
Implementations on Foreign Types§
Source§impl RandomizedSigner<Signature<NistP521>> for SigningKey
Available on crate feature ecdsa only.
impl RandomizedSigner<Signature<NistP521>> for SigningKey
Available on crate feature
ecdsa only.fn try_sign_with_rng( &self, rng: &mut impl CryptoRngCore, msg: &[u8], ) -> Result<Signature<NistP521>, Error>
Source§impl<C> RandomizedSigner<Signature<C>> for SigningKey<C>where
C: PrimeCurve + CurveArithmetic + DigestPrimitive,
<C as CurveArithmetic>::Scalar: Invert<Output = CtOption<<C as CurveArithmetic>::Scalar>> + SignPrimitive<C>,
<<C as Curve>::FieldBytesSize as Add>::Output: ArrayLength<u8> + Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>,
<<<C as Curve>::FieldBytesSize as Add>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArrayLength<u8>,
Available on crate feature der only.
impl<C> RandomizedSigner<Signature<C>> for SigningKey<C>where
C: PrimeCurve + CurveArithmetic + DigestPrimitive,
<C as CurveArithmetic>::Scalar: Invert<Output = CtOption<<C as CurveArithmetic>::Scalar>> + SignPrimitive<C>,
<<C as Curve>::FieldBytesSize as Add>::Output: ArrayLength<u8> + Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>,
<<<C as Curve>::FieldBytesSize as Add>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArrayLength<u8>,
Available on crate feature
der only.