TPDFlibSignatureVerifier
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, while VerifySignatureByName uses the fully qualified AcroForm field name and both methods accept a zero-based CMS signer index
Signature verification report
| IntegrityResult | Cryptographic CMS or legacy PKCS#7 integrity result for the selected signer |
|---|---|
| CoverageStatus | scInvalid, scSignedRevision, or scWholeDocument |
| ByteRangeValid | True only when all ranges are bounded and the signed revision ends at its own %%EOF |
| ContentsGapValid | True only when the omitted bytes are exactly the selected hexadecimal /Contents token |
| HasLaterRevisions | True when the selected signature authenticates an earlier incremental revision and later bytes exist |
| SignedRevisionLength | Byte length of the revision authenticated by the selected signature |
| PermissionReport | Parsed 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
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
Embedded certificates and validation material can complete a chain but do not convert an untrusted root into a trusted root
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
RFC 3161 timestamps
VerifyDocumentTimeStamp* validates a document timestamp against the signature ByteRange data
GetSignatureTimeStampCount and VerifySignatureTimeStamp* enumerate and validate id-aa-signatureTimeStampToken attributes against the selected CMS signer signatureValue
The Ex variants 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
Compatibility methods
VerifySignature, GetSignatureMetadata, GetSignerCertificate, and VerifySignerCertificateChain remain available and select field 0 and signer 0
The corresponding ByIndex and ByName methods provide explicit selection for multi-signature and multi-signer documents
See also
SetSignProcessDocMDP, SetSignProcessFieldLock, SetPAdESSignatureTimeStampToken