Signature Transform Methods and Permissions
HotPDF can author DocMDP and FieldMDP permission structures, then inspect and classify every standard signature transform method in a loaded document
Producer API
procedure AddCertificationSignatureField(
const FieldName: AnsiString;
Rectangle: TRect;
Permission: THPDFDocMDPPermission;
ContentsBytes: Integer = 8192;
const SubFilter: AnsiString = 'adbe.pkcs7.detached';
const Reason: AnsiString = '';
const Location: AnsiString = '';
const ContactName: AnsiString = '';
Flags: THPDFFormFieldFlags = []);
procedure ConfigureCertificationSignature(
const FieldName: AnsiString;
Permission: THPDFDocMDPPermission);
procedure AttachSignatureFieldLock(
const FieldName: AnsiString;
Action: THPDFFieldLockAction;
const Fields: array of AnsiString);
AddCertificationSignatureField combines signed-placeholder creation with certification configuration
ConfigureCertificationSignature is for an existing authored signed placeholder and requires that field to be the first field carrying a signature dictionary
A document can contain only one certification signature, so a second configuration request is rejected before the object graph is changed
These APIs negotiate PDF 1.5 output automatically
DocMDP permission levels
| Value | Certification permission |
|---|---|
dmpNoChanges | No changes are permitted after certification |
dmpFormFillAndSign | Form filling, template instantiation, and signing are permitted |
dmpFormFillSignAndAnnotate | The preceding changes plus annotation creation, deletion, and modification are permitted |
dmpNone is reserved for inspection results without a DocMDP transform and is rejected by producer methods
Field-lock scopes
| Value | Fields argument | Effect after signing |
|---|---|---|
flaAll | Must be empty | Locks every form field |
flaInclude | One or more unique field names | Locks only the listed fields |
flaExclude | One or more unique field names | Locks every field except the listed fields |
AttachSignatureFieldLock rejects empty names, duplicate names, invalid action values, an incompatible Fields shape, an unsigned target field, or a field that already carries a lock or FieldMDP policy
For Windows loaded-document revision analysis, a lock naming a nonterminal parent protects changed descendant values, and a parent Ff update is checked against the actual effective masks of its descendants even when no child dictionary or appearance stream is rewritten
An unchanged child with an explicit local Ff override is not classified as an inherited flag modification merely because its parent changes; permitted unlocked parent and sibling updates remain available through authenticated FDF interchange
Revision analysis also compares each terminal field's effective V through its real parent chain, so a changed inherited value is checked against Include and Exclude FieldMDP scopes even when the terminal dictionary is not rewritten; a local value override remains authoritative, and an explicit local V null ends value inheritance, unlike an Ff null that continues flag inheritance
Equivalent literal, hex and indirect value representations are compared semantically, while a changed indirect value remains a modification; the current acceptance record (Tests/AcroForm/NativeParentFieldFlags/CurrentAcceptance.json) includes eight inherited-value controls with 206 native and 309 independent reader checks on each of four Windows targets
These effective-value checks apply to loaded-document signature revision analysis and do not extend FDF import to nonterminal parent V targets
Emitted structure
- The certification signature carries a direct
/Referencearray containing a direct DocMDP signature-reference dictionary and direct transform parameters - The Catalog
/Perms /DocMDPentry points to the same indirect signature dictionary - The field
/Lockentry points to an indirect/Type /SigFieldLockdictionary - The lock scope is copied into a direct FieldMDP signature reference and its
/Dataentry points to the indirect Catalog root - The signature dictionary marks transform references as critical through
/V 1
Delphi example
var
LockedFields: THPDFAnsiStringArray;
begin
HotPDF.CurrentPage.AddTextField(
'InternalCode', '', Rect(40, 80, 220, 108));
HotPDF.CurrentPage.AddCertificationSignatureField(
'CertSig', Rect(40, 140, 260, 190),
dmpFormFillAndSign, 8192,
'adbe.pkcs7.detached', 'Document approval');
SetLength(LockedFields, 1);
LockedFields[0] := 'InternalCode';
HotPDF.CurrentPage.AttachSignatureFieldLock(
'CertSig', flaInclude, LockedFields);
end;
Loaded inspection
function GetLoadedSignaturePermissions(
SigIndex: Integer;
out Info: THPDFSignaturePermissionInfo): Boolean;
The reader reports the complete transform set, reference count, DocMDP permission, SigFieldLock and FieldMDP scopes, UR usage rights, Catalog UR or UR3 source, Identity object scope, unknown methods, structural validity, and a diagnostic issue string
It verifies required direct and indirect shapes, Catalog /Perms targets, transform versions, duplicate references, UR versus UR3 restrictions, and the optional DocMDP /P 2 default
If both SigFieldLock and FieldMDP are present, their actions and field lists must agree
Identity scope traversal is cycle-safe and bounded to 64 levels and 100000 indirect objects, while inspection never executes JavaScript, actions, or signature content
Standard transform coverage
| Method | Reported policy |
|---|---|
DocMDP | Certification permission and matching Catalog /Perms /DocMDP target |
UR | Document, annotation, form, signature, and embedded-file rights plus legacy /UR or byte-range /UR3 source |
FieldMDP | All, Include, or Exclude field-lock scope and copied SigFieldLock agreement |
Identity | Cycle-safe transitive object numbers reachable from the required indirect /Data root |
Unknown method names are retained in UnknownTransformMethods and make the permission structure invalid so a critical transform cannot be overlooked
Validation boundary
GetLoadedSignaturePermissions reports policy structure only
VerifyLoadedSignature continues to report cryptographic integrity separately
AnalyzeLoadedSignatureRevisions performs revision-by-revision semantic change analysis for byte-range DocMDP, FieldMDP, UR3, and Identity policies, while deprecated non-byte-range UR object-digest signatures remain available to structural inspection
SaveIncrementalUpdateAuthenticated turns inspection into enforcement: it reads policies from their signed snapshots, authenticates the controlling signatures, validates all later revisions, and publishes through atomic replacement only after every policy succeeds
Performance
Producer validation scans only authored AcroForm fields and the small signature-reference array, while loaded inspection reads only the selected signature, its lock, its references, and the Catalog permission entry
No page content, image stream, font program, or unrelated indirect object is decoded