HPDFEvaluateCMSSignerQCStatements Function

Examines CMS signature data and reads out the eIDAS qualified-certificate statements and the PSD2 statement carried by the signer certificate

Declaration

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

Unit

HPDFSignVerify

Parameters

ParameterPurpose
CMSDERDER-encoded CMS SignedData, for instance the /Contents of a PDF signature
InfoReceives the signer certificate's ETSI EN 319 412-5 statements (QcCompliance, QcSSCD, QcType, QcLimitValue, QcPDS) together with its ETSI TS 119 495 PSD2 statement
CertCountReceives how many certificates the CMS data embeds; 0 when the data cannot be parsed

Return value

false when the CMS data cannot be parsed or carries no readable certificate, in which case Info is left empty. A certificate without QC statements still yields true, with Info.HasQCStatements remaining false

Signer certificate

The certificate named by the SignerInfo is the one evaluated; should none match, the first embedded certificate is used, since that 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