TPLSignatureSourceBudget
Security and signatures
Description
TPLSignatureSourceBudget accumulates the work a source audit performed: bytes actually read, bytes scanned token by token, and parsed nodes. Passing the same record to several PLAuditSignatureSource calls turns the per-call limits into a document-wide allowance, which is how the Enterprise PDF/A audit bounds a file with many signatures.
The audit copies the caller's counters in, adds its own work and writes the totals back, including for incomplete audits, so a retry cannot quietly start from zero.
Syntax
Delphi
TPLSignatureSourceBudget = record
ReadBytes, ScannedBytes: Int64;
Nodes: Integer;
end;Fields
| ReadBytes | Bytes fetched from the source in 4 KiB chunks, smaller at a boundary; each read is charged even when only one byte is needed |
|---|---|
| ScannedBytes | Bytes inspected by the parser, counted per character access; decoding and predictor work is charged here as well |
| Nodes | Parsed object nodes plus locator path steps consumed by the audit |
Remarks
Zero the record before the first call. The overloads without a budget parameter create an internal one that starts at zero and is discarded on return.
ReadBytes and ScannedBytes are each checked against Limits.MaxBytes separately, so one allowance is not split between reading and scanning.
Each check happens before the work is charged, so a counter never exceeds its configured limit; the audit stops and reports incomplete instead.
A fresh budget for each call gives per-call limits only. Reusing one record is what makes the limit aggregate, and it is the caller's choice.
All three counters are plain integers with no managed members, so the record can be copied, stored and reported as-is.