Security
Digitally Signing PDF Documents
12
Validating Signatures
To validate a signature, invoke the signature field’s
signatureValidate
method, which
returns one of the following integer validity status values:
●
●
●
●
●
●
-1
: not a signature field
0
: signature is blank
1
: unknown status
2
: signature is invalid
3
: signature is valid, identity of signer could not be verified
4
: signature and identity of signer are both valid
The method accepts two parameters:
oSig
: the security handler used to validate the signature (a
securityHandler
or
SignatureParameters
object)
●
bUI
: determines whether the user interface is shown when validating the data file
A
SignatureParameters
object contains two properties:
●
oSecHdlr
: the security handler object
●
bAltSecHdlr
: determines whether an alternate security handler may be used
In the following example,
mySignatureField
is analyzed for validity:
●
// Obtain the signature field:
var f = this.getField("mySignatureField");
// Validate the signature field:
var status = f.signatureValidate();
// Obtain the signature information
var sigInfo = f.signatureInfo();
// Check the
if (status <
var msg
else
var msg
status returned from the validation:
3)
= "Signature is not valid: " + sigInfo.statusText;
= "Signature is valid: " + sigInfo.statusText;
// Display the status message:
app.alert(msg);;
Using Approval Stamps
You may apply a stamp annotation to a document that indicates whether approval is
indicated. To do this, set the annotation’s
AP
property to either
Approved
or
NotApproved
, as shown in the example below:
Acrobat JavaScript Scripting Guide
209