TPDFlibSignatureVerifier

Requires the Enterprise edition. The type is declared in the Enterprise unit PDFlibEntSignVerify (previously PDFlibDigitalSign), which other editions do not include

Security and Signatures

Description

Enumerates PDF signature fields and CMS signers, validates a selected signature without loading the complete PDF into memory, and reports the selected signature's own incremental revision separately from the current file

The verifier accepts a file, caller-owned stream, or ANSI byte string through OpenPDF, OpenPDFStream, or OpenPDFString

Selection

Count := Verifier.GetSignatureCount;
Verifier.GetSignatureFieldName(0, FieldName);
SignerCount := Verifier.GetSignerCount(0);
Result := Verifier.VerifySignatureByName(FieldName, 0, Report);

VerifySignatureByIndex selects a PDF field by zero-based index, whilst VerifySignatureByName uses the fully qualified AcroForm field name and both methods accept a zero-based CMS signer index

Signature verification report

IntegrityResultCryptographic CMS or legacy PKCS#7 integrity result for the selected signer
CoverageStatusscInvalid, scSignedRevision, or scWholeDocument
ByteRangeValidTrue only when all ranges are bounded and the signed revision ends at its own %%EOF
ContentsGapValidTrue only when the omitted bytes are exactly the selected hexadecimal /Contents token
HasLaterRevisionsTrue when the selected signature authenticates an earlier incremental revision and later bytes exist
SignedRevisionLengthByte length of the revision authenticated by the selected signature
PermissionReportParsed DocMDP and FieldMDP constraints for the selected signature

Certification and field permissions

GetSignaturePermissionInfo and GetSignaturePermissionInfoByName return TPDFlibSignaturePermissionReport

The report distinguishes a valid DocMDP transform from a matching catalog /Perms /DocMDP reference and verifies that a field /Lock dictionary matches its FieldMDP transform, action, and field-name list

Certificate chain and revocation

VerifySignerCertificateChainByIndex and VerifySignerCertificateChainByName run the default chain validation for an explicitly selected signature and signer

VerifySignerCertificateChainEx and VerifySignerCertificateChainExByName accept srmNone, srmCacheOnly, or srmOnline, plus an optional verification time

TPDFlibSignatureChainReport separates TrustStatus, Windows chain and policy errors, DSS or VRI evidence counts, exact OCSP attribution, OCSP status, revocation reason, freshness, and native errors

Native CMS archival revocation consumes the selected signer's signed CRL/OCSP attribute and reports ArchivalRevocationPresent, ArchivalCRLCount, ArchivalOCSPCount, ArchivalOtherCount and ArchivalNativeError separately from DSS inventory

Embedded certificates and validation material can complete a chain but do not convert an untrusted root into a trusted root

On Windows, DSS or VRI OCSP evidence is accepted only when its responder signature, issuer or delegated responder usage, CertID, status, and freshness match the selected certificate

The native non-Windows signer-chain route supports direct complete DSS or VRI CRLs for every non-anchor certificate, using explicit trust anchors and the requested verification time

Cached issuer-signed or authorised delegated DSS or VRI OCSP responses combine with validated CRLs per non-anchor certificate, with exact CertID, signature, issuer and requested-time checks; authenticated revocation takes priority over good evidence

Native OCSP requires nextUpdate; delegated responders additionally require their own CRL status or valid nocheck extension; see Native OCSP revocation

Native srmOnline checks cached coverage, then retrieves bounded HTTP(S) OCSP responses and CRLs after base trust succeeds; unresolved revocation returns vsUnknown with stsRevocationUnknown, whilst confirmed revocation returns vsInvalid with stsRevoked

Default current-time checks follow elapsed network time and revalidate base trust; explicit UTC verification times remain fixed, and downloaded responses never inflate DSS inventory or cached validation counts

NativeOCSPHTTPMethod selects nohmPreferPOST, nohmPreferGET, nohmPOSTOnly or nohmGETOnly for the native backend; the default prefers POST with GET fallback on method rejection, and the preference persists across document opens

NativeOCSPNonceMode selects disabled, preferred or required nonce matching for native signer-chain and timestamp OCSP retrieval, using 32-byte CSPRNG requests and stable request identity within each verification call

SetNativeOCSPRequestPFX, SetNativeOCSPRequestPKCS11, HasNativeOCSPRequestIdentity and ClearNativeOCSPRequestIdentity manage an explicit native request-signing credential independently of document trust anchors; OCSPRequestSigningError reports local signing failures separately from the overall chain result

See Native CRL revocation for retrieval budgets, evidence accounting and the remaining delta/indirect CRL and dedicated timestamp boundaries

Custom trust anchors

Verifier.AddTrustAnchorDER(RootCertificateDER);
Verifier.AddTrustAnchorFromFile('BusinessRoot.cer');
AnchorCount := Verifier.GetTrustAnchorCount;
Verifier.ClearTrustAnchors;

AddTrustAnchorDER and AddTrustAnchorFromFile add validated X.509 certificates to an in-memory, duplicate-free trust-anchor set

When the set is nonempty, every signer and timestamp chain is built with an exclusive trust engine that uses the set for CA roots and explicit certificate pins without consulting the Windows Root or TrustedPeople stores

The exclusive engine and parsed root store are cached by the verifier and reused until the anchor set changes

This isolation lets an application apply a private business trust policy without installing certificates or inheriting unrelated machine trust

Trust-anchor membership does not bypass certificate validity, key usage, signature, or requested revocation checks

ClearTrustAnchors releases the set and restores the default Windows system trust engine for subsequent checks

External trust sources

Verifier.SetTrustSource(TrustSource);
Source := Verifier.GetTrustSource;

SetTrustSource attaches a non-owning TPDFlibSignatureTrustSource that can supply time-specific anchors and evaluate a successfully built certificate chain

Source anchors are combined with manual custom anchors in the same exclusive chain engine, which is cached by source revision and verification time

On Windows, a chain in which the signer or a certificate carried by the signature or the DSS uses Ed25519, Ed448, ML-DSA or SM2 is built and checked by the library itself rather than by the Windows chain engine, which cannot verify those algorithms. The path must end at a custom or trust-source anchor; each signature, the validity period at the verification time and the CA flag of every intermediate are checked, and when revocation checking is requested every certificate below the anchor must be covered by a CRL in the DSS that its issuer signed, otherwise the result is revocation unknown

Assigning a source disables fallback to Windows system roots when no source or manual anchor is available

A successful source evaluation populates TPDFlibSignatureChainReport.QualificationReport without weakening certificate-chain, usage, validity, signature, or revocation checks

TPDFlibEUTSLTrustSource implements this contract for signed EU LOTL and national TSL documents

RFC 3161 timestamps

VerifyDocumentTimeStamp (signature index) and VerifyDocumentTimeStampByName (field name) validate a document timestamp against the signature ByteRange data

GetSignatureTimeStampCount and the VerifySignatureTimeStamp family enumerate and validate id-aa-signatureTimeStampToken attributes against the selected CMS signer signatureValue; VerifySignatureTimeStamp selects the signature by index and VerifySignatureTimeStampByName by field name

The Ex variants (VerifyDocumentTimeStampEx, VerifyDocumentTimeStampExByName, VerifySignatureTimeStampEx, VerifySignatureTimeStampExByName) also accept revocation mode, expected policy OID, and expected nonce

TPDFlibTimeStampVerificationReport reports token-signature validity, message-imprint validity, TSA EKU and name binding, policy, nonce, generation time, chain result, and trust status independently

The native timestamp backend requires ESS signing-certificate binding and supports cached or bounded online CRL/OCSP validation at the fixed UTC GenerationTime, with DSS intermediate certificates and the NativeOCSPHTTPMethod transport policy

AdES historical validation

Result := Verifier.VerifyAdESHistoricalByName(
  FieldName, 0, srmCacheOnly, ValidationTime, HistoricalReport);

VerifyAdESHistorical and VerifyAdESHistoricalByName first validate signature integrity and the signer chain at the requested UTC time

If the requested-time chain is invalid, the verifier validates every signature timestamp and every document timestamp whose signed revision covers the target signature, derives the earliest trusted signature time and the latest whole-document archive time, and retries the chain at those proof-of-existence control times

A zero ValidationTime selects the current UTC time, whilst a nonzero value is passed directly to the certificate-chain policy as UTC

srmNone permits a trusted signature timestamp or covering document timestamp to supply the historical control time

srmCacheOnly and srmOnline require a trusted document timestamp that covers the complete current document before current DSS, VRI, CRL, or OCSP material can be treated as historical evidence; otherwise the report returns ahsEvidenceNotArchived

A timestamp supplies an upper bound on when the signed bytes existed, not an inferred signing time, so a signer certificate that was already invalid at the selected proof time remains invalid

Timestamps are themselves proven newest first: the latest document timestamp's TSA must be valid at the requested time, each older document timestamp's TSA at the time proven by the one above it, and signature timestamps at the time proven by the oldest document timestamp covering the signature. A timestamp whose TSA has expired or been revoked with nothing newer to prove it is not used as evidence, and neither is any older timestamp below it

A signer certificate revoked for key compromise or CA compromise stays invalid however early the proof of existence, because once the key may have been in other hands no earlier proof can rule out a forged signature

ClaimedSigningTime holds the signer's /M time and TimeConsistencyIssues flags time-order problems as bits: 1 the claimed signing time is later than a signature timestamp, 2 a signature timestamp is later than a document timestamp covering it, 4 a later document timestamp carries an earlier time, 8 a document timestamp could not be proven at the time of the one above it

TPDFlibAdESHistoricalValidationReport returns requested and effective chain reports, the best signature and archive times, the selected proof source, timestamp counts, time-slide state, and a specific historical status

DeriveBaselineProfile post-processes one such report, filling BaselineProfile from the signature subfilter together with the timestamp and DSS evidence already collected in the report

Each level requires the one below it: B-B needs the signing-certificate attribute to name the signer certificate, reported in SigningCertificateStatus (0 absent, 1 matches, 2 does not match, 3 could not be read); B-T a valid signature timestamp or a document timestamp added after the signature; B-LT CRL or OCSP data in the DSS; and B-LTA a further document timestamp covering the signature

ahsValidAtRequestedTimeThe integrity and chain are valid without time sliding
ahsValidAtProofTimeThe chain is valid at a trusted timestamp-derived control time
ahsIntegrityInvalidThe selected signature or document timestamp fails integrity or ByteRange validation
ahsNoTrustedProofNo trusted timestamp covers the selected signature revision
ahsEvidenceNotArchivedRevocation checking was requested but no trusted whole-document archive timestamp seals the validation material
ahsHistoricalTrustInvalidTrusted proof times exist but the signer chain is invalid at every derived control time

Compatibility methods

VerifySignature, GetSignatureMetadata, GetSignerCertificate, and VerifySignerCertificateChain remain available and select field 0 and signer 0

The corresponding ByIndex and ByName methods (GetSignatureMetadataByIndex, GetSignatureMetadataByName, GetSignerCertificateByIndex, GetSignerCertificateByName) provide explicit selection for multi-signature and multi-signer documents

See also

TPDFlibEUTSLTrustSource, SetSignProcessDocMDP, SetSignProcessFieldLock, SetPAdESSignatureTimeStampToken

Native Freshest CRL retrieval configures URI/fullName delta refresh with NativeFreshestCRLMode

Native CRL signer revocation configures independent auxiliary status with NativeCRLSignerRevocationMode and reports separate auxiliary signer counts for document and timestamp verification

Native CRL directory server points online native verification at an ldap:// directory for CRLs whose distribution points carry only a directory name