fn prepare_digest_data_for_openpgp(
signature_type: SignatureType,
oid: AlgorithmIdentifier,
digest: &[u8],
) -> Result<Cow<'_, [u8]>, Error>Expand description
Transforms the raw digest data for cryptographic signing with OpenPGP.
Raw cryptographic signing primitives have special provisions that need to be taken care of when using certain combinations of signing schemes and hashing algorithms.
This function transforms the digest into bytes that are ready to be passed to raw cryptographic functions. The exact specifics of the transformations are documented inside the function.
ยงErrors
Returns an error if
- the
signature_typeisSignatureType::Pkcs1and the encoding of the digest data fails, - or the
signature_typeis the unsupportedSignatureType::PssSha1,SignatureType::PssSha224,SignatureType::PssSha256,SignatureType::PssSha384, orSignatureType::PssSha512.