Package com.pdftools.toolbox.pdf
Class Encryption
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.pdf.Encryption
-
public class Encryption extends NativeObject
The password and permissions that should be applied to a document, when it is created using theDocument.create(com.pdftools.toolbox.sys.Stream, com.pdftools.toolbox.pdf.Conformance, com.pdftools.toolbox.pdf.Encryption)orDocument.createWithFdf(com.pdftools.toolbox.sys.Stream, com.pdftools.toolbox.sys.Stream, com.pdftools.toolbox.pdf.Conformance, com.pdftools.toolbox.pdf.Encryption)methods. The encryption algorithm (e.g., MD4, AES) will be the highest level of encryption that is supported for the documentDocument.getConformance(). Note that encryption is not permitted for any PDF/A levelDocument.getConformance().
-
-
Constructor Summary
Constructors Constructor Description Encryption(java.lang.String userPassword, java.lang.String ownerPassword, java.util.EnumSet<Permission> permissions)ThegetUserPassword()may be used to open the document with the permissions defined by thegetPermissions()parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetOwnerPassword()The owner password opens the document with no access restrictions.java.util.EnumSet<Permission>getPermissions()The permissions that will be granted to a user who opens the document using thegetUserPassword().java.lang.StringgetUserPassword()The user password opens the document with the permissions defined by thegetPermissions()parameter.voidsetOwnerPassword(java.lang.String value)The owner password opens the document with no access restrictions.voidsetPermissions(java.util.EnumSet<Permission> value)The permissions that will be granted to a user who opens the document using thegetUserPassword().voidsetUserPassword(java.lang.String value)The user password opens the document with the permissions defined by thegetPermissions()parameter.-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Constructor Detail
-
Encryption
public Encryption(java.lang.String userPassword, java.lang.String ownerPassword, java.util.EnumSet<Permission> permissions)ThegetUserPassword()may be used to open the document with the permissions defined by thegetPermissions()parameter. ThegetOwnerPassword()may be used to open the document with no access restrictions. ThegetPermissions()may benull(all permissions), or a concatenation of the allowedPermissionvalues.- Parameters:
userPassword-ownerPassword-permissions-- Throws:
java.lang.IllegalArgumentException- ifpermissionsisnull
-
-
Method Detail
-
getUserPassword
public java.lang.String getUserPassword()
The user password opens the document with the permissions defined by thegetPermissions()parameter.
-
setUserPassword
public void setUserPassword(java.lang.String value)
The user password opens the document with the permissions defined by thegetPermissions()parameter.
-
getOwnerPassword
public java.lang.String getOwnerPassword()
The owner password opens the document with no access restrictions.
-
setOwnerPassword
public void setOwnerPassword(java.lang.String value)
The owner password opens the document with no access restrictions.
-
getPermissions
public java.util.EnumSet<Permission> getPermissions()
The permissions that will be granted to a user who opens the document using thegetUserPassword(). The value is either null (all permissions), or a concatenation of the allowedPermissionvalues.
-
setPermissions
public void setPermissions(java.util.EnumSet<Permission> value)
The permissions that will be granted to a user who opens the document using thegetUserPassword(). The value is either null (all permissions), or a concatenation of the allowedPermissionvalues.- Throws:
java.lang.IllegalArgumentException- ifvalueisnull
-
-