DynamicPDF by ceTe Software

com.cete.dynamicpdf.io
Class Encrypter

java.lang.Object
  |
  +--com.cete.dynamicpdf.io.Encrypter

public class Encrypter
extends java.lang.Object

Represents an Encrypter class used for encryption of the document.


Constructor Summary
Encrypter(byte[] owner, byte[] user, byte[] key, int privileges)
          Initializes a new instance of the Encrypter class.
 
Method Summary
 void draw(DocumentWriter writer)
          Draws the encrypter dictionary to the given DocumentWriter object.
 void encrypt(byte[] data, int objectNumber)
          Encrypts the data found in the data byte array.
 void encrypt(byte[] data, int dataLength, int objectNumber)
          Encrypts the data found in the data byte array.
 byte[] encryptToByte(byte[] data, int objectNumber)
          Encrypts the data found in the data byte array to a new byte array.
 byte[] encryptToByte(byte[] data, int start, int length, int objectNumber)
          Encrypts the data found in the data byte array to a new byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encrypter

public Encrypter(byte[] owner,
                 byte[] user,
                 byte[] key,
                 int privileges)
Initializes a new instance of the Encrypter class.

Parameters:
owner - byte array Encrypted owner password.
user - byte array Encrypted user password.
key - byte array Encryption key.
privileges - PDF value of privileges.
Method Detail

draw

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

Parameters:
writer - the DocumentWriter object to receive the output.
See Also:
DocumentWriter

encrypt

public void encrypt(byte[] data,
                    int objectNumber)
Encrypts the data found in the data byte array. The data is encrypted in place and the array is modified.

Parameters:
data - byte[] Data to encrypt.
objectNumber - int object number of the PDF object containing the data.

encrypt

public void encrypt(byte[] data,
                    int dataLength,
                    int objectNumber)
Encrypts the data found in the data byte array. The data is encrypted in place and the array is modified.

Parameters:
data - byte[] Data to encrypt.
dataLength - int length of the data to encrypt.
objectNumber - int object number of the PDF object containing the data.

encryptToByte

public byte[] encryptToByte(byte[] data,
                            int objectNumber)
Encrypts the data found in the data byte array to a new byte array.

Parameters:
data - byte array containing data to encrypt.
objectNumber - int object number of the PDF object containing the data.
Returns:
A byte array containing the encrypted data.

encryptToByte

public byte[] encryptToByte(byte[] data,
                            int start,
                            int length,
                            int objectNumber)
Encrypts the data found in the data byte array to a new byte array.

Parameters:
data - byte array containing data to encrypt.
start - Start of the data to encrypt.
length - Length of the data to encrypt.
objectNumber - int object number of the PDF object containing the data.
Returns:
A byte array containing the encrypted data.

DynamicPDF by ceTe Software

API Reference for DynamicPDF™ for Java generated on December 20, 2005
© Copyright 2005, ceTe Software