pub fn sign(
raw_signer: &dyn RawSigningKey,
message: &[u8],
) -> Result<Vec<u8>, Error>Expand description
Generates an OpenPGP signature using a RawSigningKey implementation.
Signs the message message using the RawSigningKey and returns a binary OpenPGP data
signature.
ยงErrors
Returns an Error if creating an OpenPGP signature for the hasher state fails:
- the certificate for a given key has not been generated or is invalid
- subpacket lengths exceed maximum values
- hashing signed data fails
- signature creation using a
RawSigningKeyimplementation fails - constructing OpenPGP signature from parts fails
- writing the signature to vector fails