THPDFPDFMACValidationInfo Record
Full result of a PDF MAC validation: status and message, byte-range and MAC lengths, digest and policy details, AES-GCM usage, MAC location, signature linkage and permission-coverage flags
Declaration
THPDFPDFMACValidationInfo= record
Status: THPDFPDFMACStatus;
ByteRangeLength: Int64;
MACLength: Integer;
DigestAlgorithm: THPDFPDFMACDigestAlgorithm;
PolicyProfile: THPDFPDFMACPolicyProfile;
PolicyAccepted: boolean;
UsedAESGCM: boolean;
Message: string;
Location: THPDFPDFMACLocation;
SignatureObjectNumber: Integer;
SignatureGeneration: Integer;
SignatureDigestMatched: boolean;
FullFileCoverage: boolean;
PermissionsAuthenticated: boolean;
MACRequiredByPermissions: boolean;
end;
Unit
HPDFDoc
Fields
| Field | Purpose |
|---|---|
Status | THPDFPDFMACStatus verdict, pmsValid where the MAC checked out and specific failure states otherwise |
ByteRangeLength | Number of file bytes that the MAC's /ByteRange covers |
MACLength | Length of the MAC value as encoded |
DigestAlgorithm | Digest algorithm with which the checked MAC was built |
PolicyProfile | THPDFPDFMACPolicyProfile under which the MAC was assessed |
PolicyAccepted | true where the supplied options' digest and AES-GCM policy accepted the MAC |
UsedAESGCM | true where the MAC payload was AES-GCM protected |
Message | Human-readable outcome text stating, for instance, that the MAC is valid, or the reason it is not |
Location | THPDFPDFMACLocation: a standalone MAC or one attached to a signature |
SignatureObjectNumber / SignatureGeneration | Object reference of the signature to which the MAC attaches, meaningful when Location reports an attached MAC |
SignatureDigestMatched | true where an attached MAC's digest matched its signature's byte digest |
FullFileCoverage | true where the byte range spans the whole file |
PermissionsAuthenticated | true where the document's permission bits were covered by the MAC |
MACRequiredByPermissions | true where the document's permissions demand a MAC, so that a missing one is itself a validation failure |
Usage notes
- Filled by
THotPDF.ValidatePDFMACand by the per-revision validator; the record is reset before use, so inspect it even where the function returnsfalse - Check
Statusfirst, thenPolicyAcceptedso as to distinguish a cryptographically sound MAC that fails your profile from a broken one - For attached MACs, read
SignatureObjectNumbertogether withSignatureDigestMatchedto confirm the MAC covers the same bytes that the signature signed