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:
HasPSD2Statementistrueonly when the certificate carries a well-formed PSD2 statement; a statement with overrunning or non-minimal lengths, missing or extra components, wrong tags, or names that are not 1 to 256 characters of valid UTF-8 is ignored and leaves the PSD2 fields emptyPSD2RolesOfPSPlists every role in certificate order as aTHPDFPSD2RolewithOID(0.4.0.19495.1.1PSP_AS,0.4.0.19495.1.2PSP_PI,0.4.0.19495.1.3PSP_AI,0.4.0.19495.1.4PSP_IC) andName, the role name held in the certificate, such asPSP_ASPSD2NCANameandPSD2NCAIdhold the NCA name and identifier, for exampleCZ-CNBPSD2RolesPayerandPSD2RolesPayeeare deprecated and always empty, because ETSI TS 119 495 defines no payer or payee role lists; readPSD2RolesOfPSPinstead
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