THPDFPDFMACOptions Record
選擇新增或驗證 PDF 訊息驗證碼時使用的 PDF MAC 原則設定檔、摘要演算法、允許的摘要集合與 AES-GCM 要求
宣告
THPDFPDFMACOptions= record
Profile: THPDFPDFMACPolicyProfile;
DigestAlgorithm: THPDFPDFMACDigestAlgorithm;
AllowedDigestAlgorithms: THPDFPDFMACDigestAlgorithms;
RequireAESGCM: boolean;
class function Compatibility: THPDFPDFMACOptions; static;
class function Modern: THPDFPDFMACOptions; static;
class function HighAssurance: THPDFPDFMACOptions; static;
class function Default: THPDFPDFMACOptions; static;
end;
單元
HPDFDoc
欄位
| 欄位 | 用途 |
|---|---|
Profile | 隨 MAC 記錄的 THPDFPDFMACPolicyProfile 標籤:pmppCompatibility、pmppModern、pmppHighAssurance 或 pmppCustom |
DigestAlgorithm | 建立 MAC 時用來做金鑰與計算的摘要;當設定檔只允許唯一一種摘要時,它也是預期的摘要 |
AllowedDigestAlgorithms | 驗證時接受的摘要集合,為較舊文件提供演算法靈活性 |
RequireAESGCM | 為 true 時,驗證會堅持 MAC 承載必須受 AES-GCM 保護 |
Compatibility | 類別工廠:以 SHA-256 為主,允許 SHA-2 與 SHA-3 集合,不要求 AES-GCM |
Modern | 類別工廠:以 SHA-384 為主,允許 SHA-384/SHA-512/SHA-3 集合,不要求 AES-GCM |
HighAssurance | 類別工廠:僅 SHA3-512 且要求 AES-GCM |
Default | 傳回 Compatibility 的類別工廠 |
使用說明
- 從四個類別工廠中挑一個,不要徒手拼記錄;只有自訂設定檔需要手動改欄位,而驗證會拒絕與自身設定檔標籤矛盾的選項
- 把記錄傳給
THotPDF.AddStandalonePDFMAC建立 MAC,或傳給THotPDF.ValidatePDFMAC與鏈/修訂版驗證器,在檢查時強制套用原則 - 必須在較舊工具鏈上完成驗證的文件用
Compatibility;強制要求後量子就緒的 SHA-3 與認證加密的場合用HighAssurance