org.apache.fop.pdf
Class PDFEncryption

java.lang.Object
  extended byorg.apache.fop.pdf.PDFObject
      extended byorg.apache.fop.pdf.PDFEncryption

public class PDFEncryption
extends PDFObject

class representing a /Filter /Standard object.


Field Summary
static int PERMISSION_COPY_CONTENT
          Value of content extraction permission
static int PERMISSION_EDIT_ANNOTATIONS
          Value of annotation editting permission
static int PERMISSION_EDIT_CONTENT
          Value of content editting permission
static int PERMISSION_PRINT
          Value of PRINT permission
 
Fields inherited from class org.apache.fop.pdf.PDFObject
generation, number
 
Constructor Summary
PDFEncryption(int number)
          create a /Filter /Standard object.
 
Method Summary
 byte[] encryptData(byte[] data, int number, int generation)
          This method encrypts the passed data using the generated keys.
static boolean encryptionAvailable()
           
 byte[] getFileID()
          Returns the document file ID
 java.lang.String getFileID(int index)
          This method returns the indexed file ID
 java.lang.String getOwnerPassword()
          Returns the owner password for the PDF
 java.lang.String getUserPassword()
          Returns the current user password
 void init()
          This method initializes the encryption algorithms and values
 PDFFilter makeFilter(int number, int generation)
          Creates PDFFilter for the encryption object
 void setAllowCopyContent(boolean value)
          Set whether the document will allow the content to be extracted
 void setAllowEditAnnotation(boolean value)
          Set whether the document will allow annotation modificcations
 void setAllowEditContent(boolean value)
          Set whether the document will allow content editting
 void setAllowPrint(boolean value)
          Set whether the document will allow printing.
 void setOwnerPassword(java.lang.String value)
          Sets the owner password for the PDF
 void setUserPassword(java.lang.String value)
          This method allows the setting of the user password
 byte[] toPDF()
          represent the object in PDF
 
Methods inherited from class org.apache.fop.pdf.PDFObject
getNumber, output, referencePDF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERMISSION_PRINT

public static final int PERMISSION_PRINT
Value of PRINT permission

See Also:
Constant Field Values

PERMISSION_EDIT_CONTENT

public static final int PERMISSION_EDIT_CONTENT
Value of content editting permission

See Also:
Constant Field Values

PERMISSION_COPY_CONTENT

public static final int PERMISSION_COPY_CONTENT
Value of content extraction permission

See Also:
Constant Field Values

PERMISSION_EDIT_ANNOTATIONS

public static final int PERMISSION_EDIT_ANNOTATIONS
Value of annotation editting permission

See Also:
Constant Field Values
Constructor Detail

PDFEncryption

public PDFEncryption(int number)
create a /Filter /Standard object.

Parameters:
number - the object's number
Method Detail

setUserPassword

public void setUserPassword(java.lang.String value)
This method allows the setting of the user password

Parameters:
value - The string to use as the user password. It may be blank but not null.

getUserPassword

public java.lang.String getUserPassword()
Returns the current user password

Returns:
The user password

setOwnerPassword

public void setOwnerPassword(java.lang.String value)
Sets the owner password for the PDF

Parameters:
value - The owner password

getOwnerPassword

public java.lang.String getOwnerPassword()
Returns the owner password for the PDF

Returns:
The owner password

setAllowPrint

public void setAllowPrint(boolean value)
Set whether the document will allow printing.

Parameters:
value - The new permision value

setAllowCopyContent

public void setAllowCopyContent(boolean value)
Set whether the document will allow the content to be extracted

Parameters:
value - The new permission value

setAllowEditContent

public void setAllowEditContent(boolean value)
Set whether the document will allow content editting

Parameters:
value - The new permission value

setAllowEditAnnotation

public void setAllowEditAnnotation(boolean value)
Set whether the document will allow annotation modificcations

Parameters:
value - The new permission value

getFileID

public byte[] getFileID()
Returns the document file ID

Returns:
The file ID

getFileID

public java.lang.String getFileID(int index)
This method returns the indexed file ID

Parameters:
index - The index to access the file ID
Returns:
The file ID

init

public void init()
This method initializes the encryption algorithms and values


encryptData

public byte[] encryptData(byte[] data,
                          int number,
                          int generation)
This method encrypts the passed data using the generated keys.

Parameters:
data - The data to be encrypted
number - The block number
generation - The block generation
Returns:
The encrypted data

makeFilter

public PDFFilter makeFilter(int number,
                            int generation)
Creates PDFFilter for the encryption object

Parameters:
number - The object number
generation - The objects generation
Returns:
The resulting filter

toPDF

public byte[] toPDF()
             throws java.lang.IllegalStateException
represent the object in PDF

Returns:
the PDF
Throws:
java.lang.IllegalStateException

encryptionAvailable

public static boolean encryptionAvailable()


Copyright ? 1999-2003 Apache Software Foundation. All Rights Reserved.