DynamicPDF by ceTe Software

com.cete.dynamicpdf
Class Security

java.lang.Object
  extended by com.cete.dynamicpdf.Security
Direct Known Subclasses:
Aes128Security, Aes256Security, RC4128Security, RC440Security

public abstract class Security
extends java.lang.Object

Base class from which all security classes are derived.

Licensing:
This property is a DynamicPDF Generator Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:


Field Summary
protected static byte[] text_Filter
           
protected static byte[] text_Length
           
protected static byte[] text_Standard
           
 
Constructor Summary
protected Security()
          Initializes a new instance of the Security class.
protected Security(java.lang.String password)
          Initializes a new instance of the Security class.
protected Security(java.lang.String ownerPassword, java.lang.String userPassword)
          Initializes a new instance of the Security class.
 
Method Summary
protected  byte[] binPassword(java.lang.String password)
          Gets a byte array of the password padded with the PDF padding array.
abstract  void draw(DocumentWriter writer, Encrypter encrypter)
          Draws the encrypter dictionary to the given DocumentWriter object.
 boolean getAllowCopy()
          Gets if text and images can be copied to the clipboard by the user.
 boolean getAllowEdit()
          Gets if the document can be edited by the user.
 boolean getAllowPrint()
          Gets if the document can be printed by the user.
 boolean getAllowUpdateAnnotsAndFields()
          Gets if annotations and form fields can be added, edited and modified by the user.
abstract  Encrypter getEncrypter(byte[] id)
          Gets an Encrypter object to be used for encrypting the document.
protected static byte[] getFiller()
          Gets the byte array specified by Adobe to use as a filler for passwords.
 java.lang.String getOwnerPassword()
          Gets the owner password.
 java.lang.String getUserPassword()
          Gets the user password.
 void setAllowCopy(boolean allowCopy)
          Sets if text and images can be copied to the clipboard by the user.
 void setAllowEdit(boolean allowEdit)
          Sets if the document can be edited by the user.
 void setAllowPrint(boolean allowPrint)
          Sets if the document can be printed by the user.
 void setAllowUpdateAnnotsAndFields(boolean allowUpdateAnnotsAndFields)
          Sets if annotations and form fields can be added, edited and modified by the user.
 void setOwnerPassword(java.lang.String ownerPassword)
          Sets the owner password.
 void setUserPassword(java.lang.String userPassword)
          Sets the user password.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

text_Filter

protected static byte[] text_Filter

text_Standard

protected static byte[] text_Standard

text_Length

protected static byte[] text_Length
Constructor Detail

Security

protected Security()
Initializes a new instance of the Security class.


Security

protected Security(java.lang.String ownerPassword,
                   java.lang.String userPassword)
Initializes a new instance of the Security class.

Parameters:
ownerPassword - the String indicating owner password.
userPassword - the String indicating user password.

Security

protected Security(java.lang.String password)
Initializes a new instance of the Security class.

Parameters:
password - the String specifying owner and user password.
Method Detail

setOwnerPassword

public void setOwnerPassword(java.lang.String ownerPassword)
Sets the owner password.

Parameters:
ownerPassword - the String specifying owner password.

getOwnerPassword

public java.lang.String getOwnerPassword()
Gets the owner password.

Returns:
the String specifying owner password.

setUserPassword

public void setUserPassword(java.lang.String userPassword)
Sets the user password.

Parameters:
userPassword - the String specifying user password.

getUserPassword

public java.lang.String getUserPassword()
Gets the user password.

Returns:
the String specifying user password.

setAllowPrint

public void setAllowPrint(boolean allowPrint)
Sets if the document can be printed by the user.

Parameters:
allowPrint - boolean indicating if the document can be printed by the user.

getAllowPrint

public boolean getAllowPrint()
Gets if the document can be printed by the user.

Returns:
boolean indicating if the document can be printed by the user.

setAllowEdit

public void setAllowEdit(boolean allowEdit)
Sets if the document can be edited by the user.

Parameters:
allowEdit - boolean specifying if the document can be edited by the user.

getAllowEdit

public boolean getAllowEdit()
Gets if the document can be edited by the user.

Returns:
boolean specifying if the document can be edited by the user.

setAllowCopy

public void setAllowCopy(boolean allowCopy)
Sets if text and images can be copied to the clipboard by the user.

Parameters:
allowCopy - boolean indicating if text and images can be copied to the clipboard by the user.

getAllowCopy

public boolean getAllowCopy()
Gets if text and images can be copied to the clipboard by the user.

Returns:
boolean indicating if text and images can be copied to the clipboard by the user.

setAllowUpdateAnnotsAndFields

public void setAllowUpdateAnnotsAndFields(boolean allowUpdateAnnotsAndFields)
Sets if annotations and form fields can be added, edited and modified by the user.

Parameters:
allowUpdateAnnotsAndFields - boolean indicating if annotations and form fields can be added, edited and modified by the user.

getAllowUpdateAnnotsAndFields

public boolean getAllowUpdateAnnotsAndFields()
Gets if annotations and form fields can be added, edited and modified by the user.

Returns:
boolean indicating if annotations and form fields can be added, edited and modified by the user.

draw

public abstract void draw(DocumentWriter writer,
                          Encrypter encrypter)
Draws the encrypter dictionary to the given DocumentWriter object.

Parameters:
writer - the DocumentWriter object to receive the output.
encrypter - the Encrypter object used to encrypt the document.
See Also:
DocumentWriter, Encrypter

getEncrypter

public abstract Encrypter getEncrypter(byte[] id)
Gets an Encrypter object to be used for encrypting the document.

Parameters:
id - byte array ID of the current PDF document.
Returns:
An Encrypter.
See Also:
Encrypter

binPassword

protected byte[] binPassword(java.lang.String password)
Gets a byte array of the password padded with the PDF padding array.

Parameters:
password - the String password.
Returns:
A byte array representing the password.

getFiller

protected static byte[] getFiller()
Gets the byte array specified by Adobe to use as a filler for passwords.

Returns:
byte array specified by Adobe to use as a filler for passwords.

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.07 for Java generated on Aug 12, 2020
© Copyright 2020, ceTe Software