HPDFEvaluateCMSSignerQCStatements Function

Reads the eIDAS qualified-certificate statements and the PSD2 statement of the signer certificate in CMS signature data

Declaration

function HPDFEvaluateCMSSignerQCStatements(const CMSDER: TBytes;
  out Info: THPDFQCStatementDescriptor; out CertCount: Integer): boolean;

Unit

HPDFSignVerify

Parameters

ParameterPurpose
CMSDERDER-encoded CMS SignedData, such as the /Contents of a PDF signature
InfoReceives the ETSI EN 319 412-5 statements (QcCompliance, QcSSCD, QcType, QcLimitValue, QcPDS) and the ETSI TS 119 495 PSD2 statement of the signer certificate
CertCountReceives the number of certificates embedded in the CMS data; 0 when the data cannot be parsed

Return value

false when the CMS data cannot be parsed or holds no readable certificate, and Info is then empty. A certificate without QC statements still returns true, with Info.HasQCStatements left false

Signer certificate

The certificate that the SignerInfo identifies is evaluated; when none matches, the first embedded certificate is used, which is where CMS builders place the signer

Example

var
  Info: THPDFQCStatementDescriptor;
  CertCount: Integer;
begin
  if HPDFEvaluateCMSSignerQCStatements(CMSDER, Info, CertCount) then
  begin
    if Info.QCCompliant and Info.QCSSCD then
      Writeln('Qualified certificate on a qualified device');
    if Info.HasPSD2Statement then
      Writeln('PSD2 NCA: ', Info.PSD2NCAName, ' / ', Info.PSD2NCAId);
  end;
end;

Usage notes

Related APIs