pub fn verify_cms_signed_data(
signed_data_der: &[u8],
truststore: &[Vec<u8>],
) -> Result<CmsVerificationResult, KipukaError>Expand description
Verify a CMS SignedData message and extract the payload.
RFC 8295 §3.1: The EST server performs the following steps:
- Parse the outer ContentInfo (DER) and verify
contentTypeisid-signedData(OID 1.2.840.113549.1.7.2). - Extract the
SignerInfo— exactly one signer is expected for EST. - Locate the signer’s certificate in the
certificatesfield. - Verify the signature using the signer’s public key and the
digestAlgorithm+signatureAlgorithmfromSignerInfo. - Validate the signer’s certificate chain against
truststore:- Build a chain from the signer cert to a trust anchor.
- Check validity periods (notBefore/notAfter).
- Check revocation status (CRL/OCSP) if configured.
- Extract the
eContentfromencapContentInfo— the unwrapped payload (CSR).
§Arguments
signed_data_der— DER-encoded CMS ContentInfo containing SignedData.truststore— DER-encoded trust anchor certificates to verify the signer’s certificate chain against.
§Errors
KipukaError::BadRequest— malformed CMS, missing signer, empty payload.KipukaError::Auth— signature verification failure, untrusted signer.KipukaError::Internal— crypto operations not yet implemented.