|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pdfbox.pdmodel.encryption.ProtectionPolicy
org.pdfbox.pdmodel.encryption.StandardProtectionPolicy
public class StandardProtectionPolicy
This class represents the protection policy to add to a document
for password-based protection.
The following example shows how to protect a PDF document with password.
In this example, the document will be protected so that someone opening
the document with the user password 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 Summary | |
---|---|
StandardProtectionPolicy(java.lang.String ownerPass,
java.lang.String userPass,
AccessPermission perms)
Creates an new instance of the standard protection policy in order to protect a PDF document with passwords. |
Method Summary | |
---|---|
java.lang.String |
getOwnerPassword()
Getter of the property ownerPassword. |
AccessPermission |
getPermissions()
Getter of the property permissions. |
java.lang.String |
getUserPassword()
Getter of the property userPassword. |
void |
setOwnerPassword(java.lang.String ownerPass)
Setter of the property ownerPassword. |
void |
setPermissions(AccessPermission perms)
Setter of the property permissions. |
void |
setUserPassword(java.lang.String userPass)
Setter of the property userPassword. |
Methods inherited from class org.pdfbox.pdmodel.encryption.ProtectionPolicy |
---|
getEncryptionKeyLength, setEncryptionKeyLength |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StandardProtectionPolicy(java.lang.String ownerPass, java.lang.String userPass, AccessPermission perms)
ownerPass
- The owner's password.userPass
- The users's password.perms
- The access permissions given to the user.Method Detail |
---|
public AccessPermission getPermissions()
public void setPermissions(AccessPermission perms)
perms
- The permissions to set.public java.lang.String getOwnerPassword()
public void setOwnerPassword(java.lang.String ownerPass)
ownerPass
- The ownerPassword to set.public java.lang.String getUserPassword()
public void setUserPassword(java.lang.String userPass)
userPass
- The userPassword to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |