pub trait Signer<S> {
// Required method
fn try_sign(&self, msg: &[u8]) -> Result<S, Error>;
// Provided method
fn sign(&self, msg: &[u8]) -> S { ... }
}Expand description
Sign the provided message bytestring using Self (e.g. a cryptographic key or connection to an
HSM), returning a digital signature.
Required Methods§
Sourcefn try_sign(&self, msg: &[u8]) -> Result<S, Error>
fn try_sign(&self, 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.
§Errors
Returns implementation-specific errors in the event signing failed (e.g. KMS or HSM communication error).
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<C> Signer<(Signature<C>, RecoveryId)> for SigningKey<C>where
C: EcdsaCurve + CurveArithmetic + DigestAlgorithm,
<C as CurveArithmetic>::Scalar: Invert<Output = CtOption<<C as CurveArithmetic>::Scalar>>,
Available on crate feature algorithm only.
impl<C> Signer<(Signature<C>, RecoveryId)> for SigningKey<C>where
C: EcdsaCurve + CurveArithmetic + DigestAlgorithm,
<C as CurveArithmetic>::Scalar: Invert<Output = CtOption<<C as CurveArithmetic>::Scalar>>,
Available on crate feature
algorithm only.Source§impl<C> Signer<Signature<C>> for SigningKey<C>where
C: EcdsaCurve + CurveArithmetic + DigestAlgorithm,
<C as CurveArithmetic>::Scalar: Invert<Output = CtOption<<C as CurveArithmetic>::Scalar>>,
Sign message using a deterministic ephemeral scalar (k)
computed using the algorithm described in RFC6979 § 3.2.
impl<C> Signer<Signature<C>> for SigningKey<C>where
C: EcdsaCurve + CurveArithmetic + DigestAlgorithm,
<C as CurveArithmetic>::Scalar: Invert<Output = CtOption<<C as CurveArithmetic>::Scalar>>,
Sign message using a deterministic ephemeral scalar (k)
computed using the algorithm described in RFC6979 § 3.2.
Source§impl<C> Signer<Signature<C>> for SigningKey<C>where
C: EcdsaCurve + CurveArithmetic + DigestAlgorithm,
<C as CurveArithmetic>::Scalar: Invert<Output = CtOption<<C as CurveArithmetic>::Scalar>>,
<<<C as Curve>::FieldBytesSize as Add>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArraySize,
<<C as Curve>::FieldBytesSize as Add>::Output: Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>> + ArraySize,
Available on crate feature der only.
impl<C> Signer<Signature<C>> for SigningKey<C>where
C: EcdsaCurve + CurveArithmetic + DigestAlgorithm,
<C as CurveArithmetic>::Scalar: Invert<Output = CtOption<<C as CurveArithmetic>::Scalar>>,
<<<C as Curve>::FieldBytesSize as Add>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArraySize,
<<C as Curve>::FieldBytesSize as Add>::Output: Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>> + ArraySize,
Available on crate feature
der only.