TPLSignatureByteRange
Security and signatures
Description
TPLSignatureByteRange is the fixed four-element Int64 array that mirrors the /ByteRange entry of a signature dictionary: element 0 is the offset of the first signed range, element 1 its length, element 2 the offset of the second signed range and element 3 its length. The file bytes between offset [1] and offset [2] form the excluded gap that holds the /Contents hexadecimal string.
The audit helpers take the range by value and validate it before any read, so parsed PDF integers can be passed straight through. TPDFlibSignatureByteRange in the Enterprise verification unit is an alias of this type.
Syntax
Delphi
TPLSignatureByteRange = Array [0..3] Of Int64;Fields
| [0] | Offset of the first signed range; a conforming signature starts at offset 0 |
|---|---|
| [1] | Length of the first signed range, which is also the offset where the excluded gap starts |
| [2] | Offset of the second signed range and therefore the end of the excluded gap |
| [3] | Length of the second signed range, so [2] + [3] is the signed revision length |
Remarks
PLCheckSignatureByteRange rejects the range unless element 0 is 0, element 1 is non-negative, element 2 is greater than element 1, element 3 is positive and both ranges stay within the document; PLAuditSignatureSource applies the same bounds.
The gap must be at least two bytes wide, must start with < and end with >, and its hex digits must decode to exactly the passed Contents, reservation padding included.
The type is a plain fixed array: assignment copies four values and the caller owns no additional memory.