Create a object by using its constructor and passing the java.io.FileInputStream object.
#Adobe pdf reader password
You can save the password-encrypted PDF document as a PDF file.Įncrypt a PDF document using the Java APIĮncrypting a PDF document using the web service APIĮncrypting PDF Documents with Certificates Encrypt a PDF document using the Java APIĮncrypt a PDF document with a password by using the Encryption API (Java): Save the encrypted PDF document as a PDF file Permissions are specified as PasswordEncryptionPermission enumeration values.Īfter you retrieve an unsecured PDF document and set encryption run-time values, you can add a password to the PDF document. For example to successfully extract form data, you must set the following permissions: By specifying permissions, you can control the actions that a user who opens a password-encrypted PDF document is allowed to perform. When encrypting a PDF document, you can specify permissions that are associated with the secured document. If you encrypt only the document’s attachments, a user is prompted for a password when they attempt to access the file attachments. You can encrypt the entire PDF document, everything except for the document’s metadata, or just the document’s attachments. You must specify the PDF document resources to encrypt. Password values are case sensitive, and these two password values cannot be the same values. The second password value, named the master password value, is used to remove encryption from the PDF document. The first password value is used to encrypt the PDF document and must be specified when opening the PDF document. To encrypt a PDF document with a password, you specify four values, including two password values. If you attempt to secure a PDF document that is already encrypted, you cause an exception.
You must obtain an unencrypted PDF document to encrypt the document with a password. To programmatically perform an Encryption service operation, you must create an Encryption service client.
(See Unlocking Encrypted PDF Documents.)ĭetermine the encryption type of a secured PDF document. For example, after a password-encrypted PDF document is unlocked, you can apply a digital signature to it. Unlock the PDF document so that other service operations can be performed. (See Removing Certificate Based Encryption.) Remove certificate-based encryption from a PDF document. Remove password-based encryption from a PDF document. (See Encrypting PDF Documents with Certificates.) (See Encrypting PDF Documents with a Password.)Įncrypt a PDF document with a certificate. You can accomplish these tasks using the Encryption service:Įncrypt a PDF document with a password. Likewise, if a PDF document is encrypted with a certificate, the user must decrypt the PDF document with the public key that corresponds to the certificate (private key) that was used to encrypt the PDF document. If a PDF document is encrypted with a password, the user must specify the open password before the document can be viewed in Adobe Reader or Adobe Acrobat. An authorized user can decrypt the document to obtain access to the contents. When a document is encrypted, its contents become unreadable. The Encryption service lets you encrypt and decrypt documents.