THotPDF.GetLoadedSignatureQCStatements Method

Declaration

function GetLoadedSignatureQCStatements(SigIndex: Integer;
  out Info: THPDFQCStatementInfo): boolean;

Behaviour

Reports certificate metadata from the CMS signer certificate stored in one loaded signature, including the ETSI EN 319 412-5 QCStatements QcCompliance, QcSSCD, the QcType values, QcLimitValue and the PDS locations, plus the ETSI TS 119 495 PSD2 statement

This method does not verify the PDF signature, signed byte coverage, certificate trust, or modification authority; use VerifyLoadedSignature and the applicable trust and policy APIs for those decisions

A missing ByteRange does not prevent certificate metadata inspection and no range is synthesised; when a ByteRange is supplied, the existing strict signature dictionary reader still requires four admissible nonnegative integer entries

Returns true when a usable signer certificate is found, including a certificate without QCStatements, and returns false for missing or malformed CMS data, an unusable signer certificate, or a malformed supplied range

Limits and cancellation

The stored Contents string representation is limited to 64 MiB before scanning or CMS allocation, and decoded CMS is limited to 16 MiB; an exceeded limit raises EHPDFDecodeBudgetError

Hexadecimal strings accept PDF whitespace and odd final nibble zero padding; literal strings use the bytes already unescaped by the PDF parser, so these extractor limits do not bound allocations made earlier whilst loading the document

Cooperative cancellation through OperationCancellationToken is checked during admission and extraction and propagates as EHPDFOperationCancelled; the signature dictionary and its stored Contents are left unchanged

The fixed CMS limits are independent of DecodeBudgetBytes and DocumentDecodeBudgetBytes, which govern stream decoding

PSD2 statement

The PSD2 QCStatement (0.4.0.19495.2) carries a PSD2QcType: the roles the payment service provider is authorised for, the name of the national competent authority (NCA), and the NCA identifier. These are reported through the following fields of THPDFQCStatementInfo:

To parse a PSD2QcType you already hold as DER, call HPDFParsePSD2QcStatement from the HPDFSignVerify unit. It fills a THPDFPSD2QcStatement and returns false for any malformed input

var
  Info: THPDFQCStatementInfo;
  I: Integer;
begin
  if HotPDF1.GetLoadedSignatureQCStatements(0, Info) and Info.HasPSD2Statement then
  begin
    for I:= 0 to High(Info.PSD2RolesOfPSP) do
      Writeln(Info.PSD2RolesOfPSP[I].Name, ' (', Info.PSD2RolesOfPSP[I].OID, ')');
    Writeln('NCA: ', Info.PSD2NCAName, ' / ', Info.PSD2NCAId);
  end;
end;

Qualified signature heuristic

QualifiedSignatureLikely marks the eIDAS 910/2014 Annex IV heuristic of QcCompliance plus QcSSCD; a false value is not proof of a non-qualified signature, because the QTSP service trust decision stays with the caller. Returns false when the signature carries no usable certificate

See also GetLoadedSignatureInfo, Batch Signature Validation