SetSignProcessIgnorePermissions

Security and Signatures

Description

Lets a signing process sign even where an earlier certification or field lock forbids the new signature

Syntax

Delphi

Function TPDFlib.SetSignProcessIgnorePermissions(SignProcessID, Ignore: Integer): Integer;

Parameters

SignProcessIDA signing process ID returned by NewSignProcessFromFile, NewSignProcessFromStream or NewSignProcessFromString
Ignore0 = refuse a signature that an existing certification or field lock forbids (default); 1 = sign anyway

Return values

0The process ID is invalid or Ignore is out of range
1The setting was stored

Remarks

Before signing, the process reads the signatures already in the document. When one of them certifies the document at permission level 1, or carries a field lock (FieldMDP) that covers the field about to be signed, the process stops with result 17 (GetSignProcessResult) and leaves the output unwritten, because signing would make the earlier signature read as modified in every conforming viewer (ISO 32000-2 §12.8.2.2 and §12.8.2.4)

Document time stamps are permitted at every level and are never refused. Certification levels 2 and 3 permit further signatures in fields no lock covers

Set Ignore to 1 only when breaking the earlier signature is intended, for example to produce test material; GetSignatureModificationVerdict then reports the earlier signature as modified

Example

ID:= PDF.NewSignProcessFromFile('certified.pdf', '');
PDF.SetSignProcessField(ID, 'Approver');
PDF.SetSignProcessPFXFromFile(ID, 'signer.pfx', 'secret');
PDF.EndSignProcessToFile(ID, 'approved.pdf');
if PDF.GetSignProcessResult(ID)= 17 then
  ShowMessage('the certification or a field lock forbids this signature');
PDF.ReleaseSignProcess(ID);

See also

SetSignProcessField, SetSignProcessDocMDP, TPDFlibSignatureVerifier