Home » pdfbox-1.1.0-src » org.apache.pdfbox.pdmodel.encryption » [javadoc | source]
public class: StandardProtectionPolicy [javadoc | source]
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();
StandardProtectionPolicy policy = new StandardProtectionPolicy(owner_pwd, user_pwd, ap);
 public 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.
    ownerPass - The owner's password.
    userPass - The users's password.
    perms - The access permissions given to the user.
Method from org.apache.pdfbox.pdmodel.encryption.StandardProtectionPolicy Summary:
getOwnerPassword,   getPermissions,   getUserPassword,   setOwnerPassword,   setPermissions,   setUserPassword
Methods from org.apache.pdfbox.pdmodel.encryption.ProtectionPolicy:
getEncryptionKeyLength,   setEncryptionKeyLength
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.pdfbox.pdmodel.encryption.StandardProtectionPolicy Detail:
 public String getOwnerPassword() 
    Getter of the property ownerPassword.
 public AccessPermission getPermissions() 
    Getter of the property permissions.
 public String getUserPassword() 
    Getter of the property userPassword.
 public  void setOwnerPassword(String ownerPass) 
    Setter of the property ownerPassword.
 public  void setPermissions(AccessPermission perms) 
    Setter of the property permissions.
 public  void setUserPassword(String userPass) 
    Setter of the property userPassword.