THotPDF.SaveIncrementalUpdateAuthenticated Method

Authenticates signed revision policies, rejects prohibited changes, and atomically publishes an incremental update

Declarations

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

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

Workflow

  1. Writes the pending incremental revision to a unique candidate in the target directory
  2. Loads every policy from the exact revision protected by its signature byte range
  3. Authenticates each policy-bearing CMS signature and optionally validates its certificate path
  4. Classifies every later revision and enforces DocMDP, FieldMDP, UR or UR3, Identity, and unknown-transform decisions
  5. Publishes the accepted candidate with a write-through atomic replacement

A rejection deletes the candidate and leaves an existing target byte-for-byte unchanged

Options

MemberPurpose
AuthenticationipaCryptographic requires a valid CMS byte-range signature, while ipaTrustedCertificate additionally requires cvsTrusted from certificate path and revocation validation
RequireSignaturePolicyRejects documents without an authenticated transform policy when True, which is the default
CertificateValidationTrust anchors, intermediates, offline revocation evidence, validation time, purpose, and algorithm policy used by trusted-certificate mode

Result details

THPDFAuthenticatedIncrementalUpdateInfo reports the final status, failing signature index, signature and certificate status, total signature count, authenticated policy count, and a diagnostic issue

Important statuses include aiusAccepted, aiusNoSignaturePolicy, aiusSignatureInvalid, aiusCertificateUntrusted, aiusPolicyMalformed, aiusPolicyViolation, and aiusCommitFailed

Usage

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;

Security boundary

Existing signature fields and widgets without a local field type retain only the V, AP, AS and M filling/signing change profile; changing Ff or another metadata key is structural and cannot be admitted merely because the field is a signature or inherits its type

A save refusal leaves caller-owned in-memory edits and transactions intact; explicitly roll back or repair them before retrying, as described in signed field metadata classification

Related APIs