Skip to main content

resolve_signer_certificate

Function resolve_signer_certificate 

Source
pub fn resolve_signer_certificate(
    signer: &SignerInfo,
    certificates: &[Vec<u8>],
) -> Result<usize, CmsError>
Expand description

Resolve the signing certificate for signer by walking the certificates array.

Resolution rules:

  • If the signer uses IssuerAndSerialNumber, find the cert whose serial bytes match. Issuer comparison is currently byte-equality on the DER issuer name (works for canonical-issuer certs; future work: full RFC 5280 name-comparison rules).
  • If the signer uses SubjectKeyIdentifier, find the cert whose SKI extension matches the supplied identifier.

Returns the cert index on success, or CmsError if no cert matches.