THotPDF.SaveIncrementalUpdateAuthenticated Method

驗證已簽署的修訂政策、拒絕被禁止的變更,並以原子方式發布增量更新

宣告

function SaveIncrementalUpdateAuthenticated(
  const TargetFile: TFileName;
  const Options: THPDFAuthenticatedIncrementalUpdateOptions;
  out Info: THPDFAuthenticatedIncrementalUpdateInfo
): Boolean; overload;

function SaveIncrementalUpdateAuthenticated(
  const TargetFile: TFileName;
  out Info: THPDFAuthenticatedIncrementalUpdateInfo
): Boolean; overload;

處理流程

  1. 把待寫入的增量修訂寫到目標目錄中唯一的候選檔
  2. 從由簽章位元組範圍保護的確切修訂載入每項政策
  3. 驗證每個帶政策的 CMS 簽章,並可選擇性驗證其憑證路徑
  4. 為每個後續修訂分類,並執行 DocMDP、FieldMDP、UR 或 UR3、Identity 與未知轉換的判定
  5. 以直寫式原子替換發布通過驗證的候選檔

遭拒絕時會刪除候選檔,既有目標檔則逐位元組保持不變

選項

成員用途
AuthenticationipaCryptographic 需要有效的 CMS 位元組範圍簽章,而 ipaTrustedCertificate 還需要憑證路徑與撤銷驗證得出 cvsTrusted
RequireSignaturePolicy設為 True(預設值)時,拒絕沒有已驗證轉換政策的檔案
CertificateValidation信任憑證模式所使用的信任錨、中繼憑證、離線撤銷證據、驗證時間、用途與演算法政策

結果細節

THPDFAuthenticatedIncrementalUpdateInfo 會回報最終狀態、失敗簽章索引、簽章與憑證狀態、簽章總數、已驗證政策數量,以及一則診斷問題

重要的狀態包括 aiusAccepted、aiusNoSignaturePolicy、aiusSignatureInvalid、aiusCertificateUntrusted、aiusPolicyMalformed、aiusPolicyViolation 與 aiusCommitFailed

範例

var
  Info: THPDFAuthenticatedIncrementalUpdateInfo;
begin
  PDF.BeginIncrementalUpdate('certified.pdf');
  PDF.SetLoadedFormFieldValueByName('CustomerName', 'Ada');
  if not PDF.SaveIncrementalUpdateAuthenticated('updated.pdf', Info) then
    raise Exception.Create(String(Info.Issue));
end;

安全須知

缺少本地欄位類型的既有簽章欄位與 widget,只適用 V、AP、AS 與 M 的填寫/簽署變更設定檔;變更 Ff 或其他中繼資料鍵屬於結構性變更,不能只因欄位是簽章或繼承其類型就獲准

儲存被拒時,呼叫端自有的記憶體內編輯與交易保持完整;重試之前請如 signed field metadata classification 所述,明確 rollback 或修復

相關 API