public 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 and Description |
---|
StandardProtectionPolicy(String ownerPass,
String userPass,
AccessPermission perms)
Creates an new instance of the standard protection policy
in order to protect a PDF document with passwords.
|
Modifier and Type | Method and Description |
---|---|
String |
getOwnerPassword()
Getter of the property ownerPassword.
|
AccessPermission |
getPermissions()
Getter of the property permissions.
|
String |
getUserPassword()
Getter of the property userPassword.
|
void |
setOwnerPassword(String ownerPass)
Setter of the property ownerPassword.
|
void |
setPermissions(AccessPermission perms)
Setter of the property permissions.
|
void |
setUserPassword(String userPass)
Setter of the property userPassword.
|
getEncryptionKeyLength, setEncryptionKeyLength
public StandardProtectionPolicy(String ownerPass, String userPass, AccessPermission perms)
ownerPass
- The owner's password.userPass
- The users's password.perms
- The access permissions given to the user.public AccessPermission getPermissions()
public void setPermissions(AccessPermission perms)
perms
- The permissions to set.public String getOwnerPassword()
public void setOwnerPassword(String ownerPass)
ownerPass
- The ownerPassword to set.public String getUserPassword()
public void setUserPassword(String userPass)
userPass
- The userPassword to set.Copyright © 2002-2016 The Apache Software Foundation. All Rights Reserved.