12
Security
Digitally Signing PDF Documents
Getting Signature Information from Another User
You may maintain a list of trusted user identities by adding the certificates contained within
FDF files sent to you by other users. You may also obtain signature information from an FDF
file by invoking the
FDF
object’s
signatureValidate
method, which returns a
signatureInfo
object, as shown in the example below:
// Open the FDF file sent to you by the other user:
var fdf = app.openFDF("/C/myDoc.fdf");
// Obtain the security handler:
var engine = security.getHandler("Adobe.PPKLite");
// Check to see if the FDF has been signed:
if (fdf.isSigned)
{
// Obtain the other user’s signature info:
sigInfo = fdf.signatureValidate({
oSig: engine,
bUI: true
});
// Display the signature status and description:
console.println("Signature Status: " + sigInfo.status);
console.println("Description: " + sigInfo.statusText);
}
else
console.println("This FDF was not signed.");
Removing Signatures
To remove a signature field, invoke the
doc
object’s
removeField
method. In the
example below,
mySignatureField
is removed:
var f = this.getField("mySignatureField");
this.removeField(f);
Certifying a Document
When applying an author signature to certify a document, check
trustFlags
, which is a
read-only property of the
signatureInfo
object. If its value is
2
, the signer is trusted for
certifying documents.
208
Acrobat JavaScript Scripting Guide