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 when the MAC checked out and specific failure states otherwise |
ByteRangeLength | Number of file bytes covered by the MAC's /ByteRange |
MACLength | Length of the encoded MAC value |
DigestAlgorithm | Digest algorithm the checked MAC was built with |
PolicyProfile | THPDFPDFMACPolicyProfile under which the MAC was evaluated |
PolicyAccepted | true when the supplied options' digest and AES-GCM policy accepted the MAC |
UsedAESGCM | true when the MAC payload was AES-GCM protected |
Message | Human-readable outcome text, for example that the MAC is valid, or the reason it is not |
Location | THPDFPDFMACLocation: standalone MAC or one attached to a signature |
SignatureObjectNumber / SignatureGeneration | Object reference of the signature the MAC attaches to, meaningful when Location reports an attached MAC |
SignatureDigestMatched | true when an attached MAC's digest matched its signature's byte digest |
FullFileCoverage | true when the byte range spans the entire file |
PermissionsAuthenticated | true when the document's permission bits were covered by the MAC |
MACRequiredByPermissions | true when the document's permissions demand a MAC, so 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 when the function returnsfalse - Check
Statusfirst, thenPolicyAcceptedto distinguish a cryptographically good MAC that fails your profile from a broken one - For attached MACs, read
SignatureObjectNumbertogether withSignatureDigestMatchedto confirm the MAC covers the same bytes the signature signed