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
| Parameter | Purpose |
|---|---|
CMSDER | DER-encoded CMS SignedData, for instance the /Contents of a PDF signature |
Info | Receives the signer certificate's ETSI EN 319 412-5 statements (QcCompliance, QcSSCD, QcType, QcLimitValue, QcPDS) together with its ETSI TS 119 495 PSD2 statement |
CertCount | Receives 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
- The function inspects certificate content only; it verifies neither the signature, nor the certificate chain, nor the issuer's trusted-list status
- For a signature inside a loaded document,
THotPDF.GetLoadedSignatureQCStatementsreturns the same statements without the CMS data having to be extracted first