TPDFlibSignatureVerificationReport
Data types, security and signatures
Description
TPDFlibSignatureVerificationReport is the report returned by VerifySignatureByIndex and VerifySignatureByName on TPDFlibSignatureVerifier, and the IntegrityReport embedded in AdES historical validation.
It covers the cryptographic integrity of one signer and the bytes the signature claims, but not certificate trust; use TPDFlibSignatureChainReport for that.
Syntax
Delphi
TPDFlibSignatureVerificationReport = Record
FieldName: WideString;
SubFilter: AnsiString;
SignerIndex: Integer;
SignerCount: Integer;
IntegrityResult: TPDFlibSignatureVerifierResult;
CoverageStatus: TPDFlibSignatureCoverageStatus;
ByteRangeValid: Boolean;
ContentsGapValid: Boolean;
RevisionEndValid: Boolean;
CoversWholeDocument: Boolean;
HasLaterRevisions: Boolean;
SignedRevisionLength: Int64;
DocumentLength: Int64;
NativeError: Cardinal;
PermissionReport: TPDFlibSignaturePermissionReport;
End;Fields
| FieldName | Fully qualified name of the signature field |
|---|---|
| SubFilter | The /SubFilter value, for example adbe.pkcs7.detached, ETSI.CAdES.detached, adbe.pkcs7.sha1 or ETSI.RFC3161; empty when no signature field could be read |
| SignerIndex | Zero-based CMS signer index that was verified |
| SignerCount | Number of CMS signers in the signature; for a document timestamp, the signer count of the timestamp token |
| IntegrityResult | Cryptographic verification result for the selected signer |
| CoverageStatus | scUnknown, scInvalid, scSignedRevision or scWholeDocument |
| ByteRangeValid | The /ByteRange starts at zero, is ordered and in bounds, and the signed revision ends at its own %%EOF |
| ContentsGapValid | The omitted bytes are exactly the hexadecimal /Contents token |
| RevisionEndValid | The signed revision ends with an %%EOF marker |
| CoversWholeDocument | The signed revision length equals the current file length |
| HasLaterRevisions | The signed revision is shorter than the current file, so later incremental updates exist |
| SignedRevisionLength | Byte length of the revision authenticated by the signature, taken from the end of the second byte range |
| DocumentLength | Current file size in bytes |
| NativeError | Platform or native error code from the failing verification step; 0 when none was reported |
| PermissionReport | Parsed DocMDP and FieldMDP constraints that apply to the signature |
Remarks
Integrity is independent of trust: a correct signature over bytes signed by an untrusted certificate has IntegrityResult vsValid with normal coverage.
A valid signature over an earlier revision leaves HasLaterRevisions True; that is not tampering by itself, but a byte range that does not end at a complete revision boundary is reported through RevisionEndValid and fails ByteRangeValid.
ByteRangeValid requires the range to start at offset zero, to have increasing, in-bounds ranges, and the gap to decode to the stored /Contents; ContentsGapValid and RevisionEndValid report those sub-checks separately.
If the field is missing, /Contents is empty, or the subfilter is unsupported, the report keeps its defaults and the method returns vsUnknown.
See also
TPDFlibSignatureVerifier, TPDFlibSignatureMetadata, TPDFlibSignatureCertificate, VerifySignerCertificateChainEx