Adding A Security Handler - Adobe ACROBAT SDK 8.1 Manual

Developing plug-ins and applications
Table of Contents

Advertisement

Adobe Acrobat SDK
Developing Plug-ins and Applications
A security handler supports two passwords:
A user password that enables a user to open and read a protected document with whatever
permissions the owner chose
An owner password that allows a document's owner to also change the permissions granted to users
You can use the Acrobat core API's built-in security handler or write your own security handlers to perform
user authorization (for example, by the presence of a specific hardware key or file, or by reading a
magnetic card reader).
Security handlers are responsible for performing the following tasks:
Setting permissions on a file
Authorizing access to a file
Setting up a file's encryption and decryption keys
Maintaining the encryption dictionary of the PDF file containing the document
Security handlers are used in the following situations:
A document is opened. The security handler determines whether a user is authorized to open the file
and sets up the decryption key that is used to decrypt the PDF file.
A document is saved. The security handler sets up the encryption key and writes extra security-related
information into the PDF file's encryption dictionary.
A user attempts to change a document's security settings. The security handler determines whether
the user is permitted to perform this task.
A document may have zero, one, or two security handlers associated with it. A document has zero security
handlers if no security is used on the file. When security is applied to a file, or the user selects a different
security handler for a secured file, the newly-chosen security handler is not put in place immediately.
Instead this new security handler is simply associated with the document; it is a pending security handler
until the document is saved.
The new security handler is not put in place immediately because it is responsible for decrypting the
contents of the document's encryption dictionary, and that dictionary is re-encrypted in the correct
format for the new security handler only when the document is saved. As a result, a document may have
both a current and a new security handler associated with it.
A security handler has two names: one that is placed in each PDF file that is saved by the handler (for
example, ADBE_Crypt), and another name that Acrobat can use in any user interface items in which the
security handler appears (for example, Acrobat Developer Technologies default encryption). This is similar
to the two-name scheme used for menu items: a language-independent name that the application logic
can refer to regardless of the user interface language, and another name that appears in the user interface.
For information, see

Adding a security handler

You can add a security handler by performing the following tasks:
Writing a set of callback routines to perform security-related functions.
Specifying the callbacks in a
Registering the handler by passing the structure to
"Adding menu commands to menus" on page
PDCryptHandlerRec
Working with Document Security
90.
structure.
PDRegisterCryptHandlerEx
Adding a security handler
.
155

Advertisement

Table of Contents
loading

Table of Contents