12
Security
Security Essentials
Security Essentials
Acrobat JavaScript provides a number of objects that support security. These are managed
by the
security
,
securityPolicy
, and
securityHandler
objects for managing
certificates, security policies, and signatures. The
certificate
,
directory
,
signatureInfo
, and
dirConnection
objects are used to manage digital signatures
and access the user certificates.
Methods for Adding Security to PDF Documents
The general procedures for applying various types of security to a PDF document are
described below. Details and examples are provided in the later sections of this chapter.
Passwords and Restrictions
The basic way to protect a document from unauthorized access is to encrypt it for a list of
authorized recipients using the
doc
object’s
encryptForRecipients
method. This
essentially requires that the authorized recipients use a private key or credential to gain
access to it. Restrictions may be applied so that the recipients’ access to the document may
be controlled.
Certifying Documents
The author signature for a document is what makes modification detection and prevention
(mdp) possible. When this type of signature is applied, it is possible to certify the document,
which means that you will specify information about its contents and the types of changes
that are allowed in order for the document to remain certified.
To apply an author signature to a document, create an author signature field using the
doc
object’s
addField
method. Then sign the field using the
field
object’s
signatureSign
method, in which you will provide parameters containing the security
handler, a
signatureInfo
object containing an
mdp
property value other than
allowAll
, and a legal attest explaining why certain legal warnings are embedded in the
document. The
signatureInfo
object has properties common to all security handlers.
These properties are described below in
Table 12.1:
T
ABLE
12.1
SignatureInfo Properties
Property
Description
Software build and version for the signature
Date and time of the signature
Security handler name specified in the
Filter
attribute
in the signature dictionary
Security handler name specified by
handlerName
Security handler name specified by
handlerName
buildInfo
date
handlerName
handlerUserName
handlerUIName
202
Acrobat JavaScript Scripting Guide