pub trait Sign {
    fn sign(
        &self,
        message: &[u8]
    ) -> Result<(Vec<u8>, SignatureAlgorithm), Error>; fn key_algorithm(&self) -> Option<KeyAlgorithm>; fn public_key_data(&self) -> Bytes; fn signature_algorithm(&self) -> Result<SignatureAlgorithm, Error>; fn private_key_data(&self) -> Option<Vec<u8>>; fn rsa_primes(&self) -> Result<Option<(Vec<u8>, Vec<u8>)>, Error>; }
Expand description

Signifies that an entity is capable of producing cryptographic signatures.

Required Methods

👎 Deprecated since 0.13.0:

use the signature::Signer trait instead

Create a cyrptographic signature over a message.

Takes the message to be signed, which will be digested by the implementation.

Returns the raw bytes constituting the signature and which signature algorithm was used. The returned SignatureAlgorithm can be serialized into an ASN.1 AlgorithmIdentifier via .into().

Obtain the algorithm of the private key.

If we can’t coerce the key algorithm to KeyAlgorithm, None is returned.

Obtain the raw bytes constituting the public key of the signing certificate.

This will be .tbs_certificate.subject_public_key_info.subject_public_key of a parsed X.509 public certificate.

Obtain the SignatureAlgorithm that this signer will use.

Instances can be coerced into the ASN.1 AlgorithmIdentifier via .into() for easy inclusion in ASN.1 structures.

Obtain the raw private key data.

Obtain RSA key primes p and q, if available.

Implementors