GetSignatureModificationVerdictA
Digital signatures
Requires the Small Business edition — in Delphi, C++Builder and Lazarus code create the library as TPDFlibSmallBusiness (unit PDFlibSmallBusiness) or TPDFlibEnterprise; the Small Business and Enterprise DLL and ActiveX builds provide it unchanged; the Single edition keeps the method, which returns 0 and sets LastErrorCode to 901 (PDFLIB_ERROR_SMALLBUSINESS_REQUIRED)
Description
The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to GetSignatureModificationVerdict and string arguments are interpreted using the current SetAnsiMode code page
Says whether the updates appended after a signature were ones the document's certification level allows
Syntax
Delphi
Function DLGetSignatureModificationVerdictA(InstanceID: Integer; InputFile: PAnsiChar; Password: PAnsiChar; FieldName: PAnsiChar): Integer;
DLL
int DLGetSignatureModificationVerdictA(int InstanceID, const char* InputFile, const char* Password, const char* FieldName);
Parameters
| InputFile | The signed document |
|---|---|
| Password | The password to open it, or an empty string |
| FieldName | The signature field to judge |
Return values
| 1 | Nothing was appended after the signature |
|---|---|
| 2 | Only changes the certification level permits were appended |
| 3 | Something the level does not permit was appended |
| 4 | The answer could not be determined |
| 5 | The signature does not end on a revision boundary, so bytes sit inside the range it claims to cover |
| 0 | The file or the field could not be read |
Remarks
ISO 32000-1 §12.8.2.2 gives a certifying signature a permission level: 1 permits no later change at all, 2 additionally permits filling form fields and signing, 3 additionally permits annotations. Validation material and document time stamps are permitted at every level, so promoting a signature to long-term validation never reads as tampering
A result of 4 is not approval — it is returned when a certification's own structure could not be verified, when a field lock is present and which fields the later updates touched cannot be traced, when a later revision holds something that could not be read, and when the file carries bytes past the signed range that form no recognisable revision. In each of those cases something material is unknown, and treating it as permitted would be the wrong way to be wrong
A field lock (FieldMDP) binds only the updates after the revision its own signature closed (ISO 32000-2 §12.8.2.4): filling a field before it was locked, or the locking signature's own changes, are not held against it. A signature value, SigFlags or Perms change that names no field is attributed to the signature applied in the same revision, so countersigning a field outside the lock reads as permitted
GetSignatureModificationDetail names the revision and the kind of change behind the answer, and GetSignatureEffectiveMDPLevel reports the level applied
Example
case PDF.GetSignatureModificationVerdict('signed.pdf', '', 'Signature1') of
1, 2: ShowMessage('the signature still covers the document');
3: ShowMessage('not allowed: '+ PDF.GetSignatureModificationDetail);
else
ShowMessage('undetermined: '+ PDF.GetSignatureModificationDetail);
end;See also
GetSignatureEffectiveMDPLevel, GetSignatureModificationDetail, GetSignatureRevisionIndex, GetDocumentRevisionKind