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
| Parameter | Purpose |
|---|---|
CMSDER | DER-encoded CMS SignedData, such as the /Contents of a PDF signature |
Info | Receives the ETSI EN 319 412-5 statements (QcCompliance, QcSSCD, QcType, QcLimitValue, QcPDS) and the ETSI TS 119 495 PSD2 statement of the signer certificate |
CertCount | Receives 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
- The function inspects certificate content only; it does not verify the signature, the certificate chain or the trusted-list status of the issuer
- For a signature in a loaded document,
THotPDF.GetLoadedSignatureQCStatementsreturns the same statements without extracting the CMS data first