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

FieldNameFully qualified name of the signature field
SubFilterThe /SubFilter value, for example adbe.pkcs7.detached, ETSI.CAdES.detached, adbe.pkcs7.sha1 or ETSI.RFC3161; empty when no signature field could be read
SignerIndexZero-based CMS signer index that was verified
SignerCountNumber of CMS signers in the signature; for a document timestamp, the signer count of the timestamp token
IntegrityResultCryptographic verification result for the selected signer
CoverageStatusscUnknown, scInvalid, scSignedRevision or scWholeDocument
ByteRangeValidThe /ByteRange starts at zero, is ordered and in bounds, and the signed revision ends at its own %%EOF
ContentsGapValidThe omitted bytes are exactly the hexadecimal /Contents token
RevisionEndValidThe signed revision ends with an %%EOF marker
CoversWholeDocumentThe signed revision length equals the current file length
HasLaterRevisionsThe signed revision is shorter than the current file, so later incremental updates exist
SignedRevisionLengthByte length of the revision authenticated by the signature, taken from the end of the second byte range
DocumentLengthCurrent file size in bytes
NativeErrorPlatform or native error code from the failing verification step; 0 when none was reported
PermissionReportParsed 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