PdfEncryptionDetails

Inheritance: java.lang.Object

public class PdfEncryptionDetails

Contains details for encrypting and access permissions for a PDF document.

To learn more, visit the Protect or Encrypt a Document documentation article.

Constructors

ConstructorDescription
PdfEncryptionDetails(String userPassword, String ownerPassword)Initializes an instance of this class.

Methods

MethodDescription
getOwnerPassword()Specifies the owner password for the encrypted PDF document.
getPermissions()Specifies the operations that are allowed to a user on an encrypted PDF document.
getUserPassword()Specifies the user password required for opening the encrypted PDF document.
setOwnerPassword(String value)Specifies the owner password for the encrypted PDF document.
setPermissions(int value)Specifies the operations that are allowed to a user on an encrypted PDF document.
setUserPassword(String value)Specifies the user password required for opening the encrypted PDF document.

PdfEncryptionDetails(String userPassword, String ownerPassword)

public PdfEncryptionDetails(String userPassword, String ownerPassword)

Initializes an instance of this class.

Parameters:

ParameterTypeDescription
userPasswordjava.lang.String
ownerPasswordjava.lang.String

getOwnerPassword()

public String getOwnerPassword()

Specifies the owner password for the encrypted PDF document.

Remarks:

The owner password allows the user to open an encrypted PDF document without any access restrictions specified in getPermissions() / setPermissions(int).

The owner password cannot be the same as the user password.

Returns: java.lang.String - The corresponding java.lang.String value.

getPermissions()

public int getPermissions()

Specifies the operations that are allowed to a user on an encrypted PDF document. The default value is PdfPermissions.DISALLOW_ALL.

Returns: int - The corresponding int value. The returned value is a bitwise combination of PdfPermissions constants.

getUserPassword()

public String getUserPassword()

Specifies the user password required for opening the encrypted PDF document.

Remarks:

The user password will be required to open an encrypted PDF document for viewing. The permissions specified in getPermissions() / setPermissions(int) will be enforced by the reader software.

The user password can be null or empty string, in this case no password will be required from the user when opening the PDF document. The user password cannot be the same as the owner password.

Returns: java.lang.String - The corresponding java.lang.String value.

setOwnerPassword(String value)

public void setOwnerPassword(String value)

Specifies the owner password for the encrypted PDF document.

Remarks:

The owner password allows the user to open an encrypted PDF document without any access restrictions specified in getPermissions() / setPermissions(int).

The owner password cannot be the same as the user password.

Parameters:

ParameterTypeDescription
valuejava.lang.StringThe corresponding java.lang.String value.

setPermissions(int value)

public void setPermissions(int value)

Specifies the operations that are allowed to a user on an encrypted PDF document. The default value is PdfPermissions.DISALLOW_ALL.

Parameters:

ParameterTypeDescription
valueintThe corresponding int value. The value must be a bitwise combination of PdfPermissions constants.

setUserPassword(String value)

public void setUserPassword(String value)

Specifies the user password required for opening the encrypted PDF document.

Remarks:

The user password will be required to open an encrypted PDF document for viewing. The permissions specified in getPermissions() / setPermissions(int) will be enforced by the reader software.

The user password can be null or empty string, in this case no password will be required from the user when opening the PDF document. The user password cannot be the same as the owner password.

Parameters:

ParameterTypeDescription
valuejava.lang.StringThe corresponding java.lang.String value.