
Adobe Acrobat SDK
Working with Acrobat Extended APIs
Developing Plug-ins and Applications
Understanding the process 234
Revalidating signatures
If the user reopens the file, the signatures must be validated. If the user asks to validate one or more
signature fields, the digital signature plug-in sequences through them one at a time. Your
DSValidateSignProc
callback method must perform the following tasks:
●
Recalculate any document digest that it desires, using the
DigSigFileGetEOF
,
DigSigFileSetPos
, and
DigSigFileRead
callbacks; or it may use the
DigSigMD5ByteRange
callback.
●
Compare this result to the stored one, and do any other method-specific checks it desires.
●
Optionally do a validation against some stored (network) registry.
●
Update the
/AP
/N
value in the signature annotation dictionary to show doublechecked/pass/fail
symbol.
●
Return doublechecked/pass/fail.
The user may open more than one document at a time, and may switch between open documents.
Additional available callbacks
The user may ask to show a signature panel containing summary information for each signature in an
open document. If multiple documents are open, there may be multiple panels, or a single panel may be
repainted as the user switches between documents. DigSig manages updating the panel(s), but may call
the respective method plug-in for each signature to get information to display on the panel. For each
signature, the signature panel has two levels of detail:
1. CLOSED displays a doublechecked/pass/fail/unknown/blank icon and a line of text for each signature
field in the document. The default text is the name of the person signing and the date and time of
signing, displayed in a language-independent way.
2. The digital signature plug-in calls
dsGetValidState
to choose which icon to show.
3. OPEN displays an icon and line of text for each signature, then indented lines of further text, currently
consisting of the name of the signer, date and time of signing, location of signing, reason for signing,
and signing method.
4. The digital signature calls
dsGetValidState
to choose which icon to show.
5. Your plug-in may update the signature panel for a document asynchronously (it might be doing
validation as a background or idle-loop task). To do this, use the
DigSigUpdatePanel
callback.
Additional plug-in support
Whenever a signature is created or verified, the plug-in may optionally alter the appearance of the
signature in the document, for the purpose of displaying or printing. For example, it could change an
overprinted question mark on an unverified signature to an underprinted logo for a verified signature. To
help with this, DigSig provides an HFT callback
DigSigGetStdXObj
that returns an XObject for a blank
appearance, a question mark, or a cross. These are suitable as targets of the Do operator in a signature’s
appearance stream.
To avoid saving a signature to a file with an appearance of valid (rather than unvalidated), just before each
file save, DigSig loops through all the signature fields and calls the specific method’s
dsUnValidateSig
entry. This routine restores the signature’s appearance to the unvalidated state.