public final class StandardProtectionPolicy extends ProtectionPolicy
user_pwd
will not be
able to modify the document.
AccessPermission ap = new AccessPermission(); ap.setCanModify(false); StandardProtectionPolicy policy = new StandardProtectionPolicy(owner_pwd, user_pwd, ap); doc.protect(policy);
Constructor | Description |
---|---|
StandardProtectionPolicy(java.lang.String ownerPassword,
java.lang.String userPassword,
AccessPermission permissions) |
Creates an new instance of the standard protection policy
in order to protect a PDF document with passwords.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
getOwnerPassword() |
Returns the owner password.
|
AccessPermission |
getPermissions() |
Returns the access permissions
|
java.lang.String |
getUserPassword() |
Returns the user password.
|
boolean |
isPreferAES() |
Tell whether AES encryption is preferred when several encryption methods are available for
the chosen key length.
|
void |
setOwnerPassword(java.lang.String ownerPassword) |
Sets the owner password
|
void |
setPermissions(AccessPermission permissions) |
Sets the access permissions
|
void |
setPreferAES(boolean preferAES) |
Set whether AES encryption is preferred when several encryption methods are available for the
chosen key length.
|
void |
setUserPassword(java.lang.String userPassword) |
Sets the user password.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEncryptionKeyLength, setEncryptionKeyLength
public StandardProtectionPolicy(java.lang.String ownerPassword, java.lang.String userPassword, AccessPermission permissions)
ownerPassword
- The owner's password.userPassword
- The users's password.permissions
- The access permissions given to the user.public AccessPermission getPermissions()
public void setPermissions(AccessPermission permissions)
permissions
- the new access permissionspublic java.lang.String getOwnerPassword()
public void setOwnerPassword(java.lang.String ownerPassword)
ownerPassword
- the new owner passwordpublic java.lang.String getUserPassword()
public void setUserPassword(java.lang.String userPassword)
userPassword
- the new user passwordpublic boolean isPreferAES()
public void setPreferAES(boolean preferAES)
preferAES
- Copyright © 2002–2018. All rights reserved.