PLSigningCertificateAttributeStatus

Cryptography, digital signatures

Description

Checks the ESS signing-certificate or signing-certificate-v2 attribute of one CMS signer against the signer certificate

Syntax

Delphi

Function PLSigningCertificateAttributeStatus(Const CMSBytes: AnsiString;
  SignerIndex: Integer): Integer;

Parameters

CMSBytesDER-encoded SignedData structure
SignerIndexZero-based signer to inspect

Return values

0Neither signing-certificate v2 nor v1 is present in the signed attributes
1The attribute is present and its ESSCertID hash matches the signer certificate
2The attribute is present but the certificate hash does not match
3The CMS, signed-attributes set or attribute encoding could not be parsed

Signing-certificate-v2 is preferred when both forms are present; the hash algorithm is taken from the attribute, defaulting to SHA-256

AdES verification uses this check to confirm the signature really commits to the certificate that made it

See also

PLVerifyModernDetachedCMS, PLVerifyCertificatePathPure, PLCertificateSubjectAndIssuer