PdfSignatureByteRangeCoverage class

How much of the PDF file a signature's /ByteRange actually protects.

A PDF signature signs two spans — from the start of the file up to the /Contents placeholder and from just after it to some offset — leaving the /Contents hex string itself as an unsigned gap. Anything before the first span or after the second is not covered by this signature. Later, legitimate incremental updates (a second signature, a form fill, an LTV/DSS update) are appended after the signed span, so trailing unsigned bytes are normal for every signature except, usually, the outermost one — they are NOT tampering on their own. This object exposes the raw coverage so callers can apply their own policy (e.g. flag a lone signature that does not reach %%EOF, or trailing bytes that are not even a well-formed incremental update).

Constructors

PdfSignatureByteRangeCoverage({required int fileLength, required int signedLength, required bool startsAtDocumentStart, required int unsignedTrailingBytes, required bool? trailingBytesAreIncrementalUpdate})
const

Properties

coversEntireDocument → bool
Whether this signature protects the file end-to-end (starts at 0 and leaves no unsigned trailing bytes).
no setter
fileLength → int
Total size of the PDF file, in bytes.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
signedLength → int
Offset up to which the /ByteRange protects the document (start2 + len2 of the range). Bytes beyond this offset are not covered by this signature.
final
startsAtDocumentStart → bool
Whether the /ByteRange begins at offset 0. A well-formed PDF signature always starts at the very beginning of the file; false means the leading bytes are unsigned and the document is malformed or tampered — there is no legitimate reason for a non-zero start.
final
trailingBytesAreIncrementalUpdate → bool?
When unsignedTrailingBytes is > 0, whether the trailing region looks like a well-formed PDF incremental update (it contains a startxref and a terminating %%EOF). null when there are no trailing bytes. false signals raw appended data that is not part of the PDF revision structure — a strong tampering indicator.
final
unsignedTrailingBytes → int
Number of bytes after signedLength that this signature does not protect. Expected to be > 0 for every signature except the outermost one, because later revisions are appended as incremental updates.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited