multivalent.std.adaptor.pdf

Class SecurityHandler

public abstract class SecurityHandler extends Object implements Cloneable

Superclass for PDF security handler implementations. Encryption applies to all strings and streams in the document's PDF file, but not to other object types.

Version: $Revision: 1.6 $ $Date: 2003/08/17 08:40:17 $

Field Summary
static SecurityHandlerIDENTITY
Constructor Summary
SecurityHandler(Dict edict, COSSource coss)
Method Summary
abstract booleanauthOwner(String owner)
abstract booleanauthUser(String user)
Objectclone()
abstract byte[]computeKey(String password)
abstract byte[]decrypt(byte[] data, int off, int len)
Decrypts stream data of object objnum with generation gennum.
abstract byte[]encrypt(byte[] data, int off, int len)
Encrypts data of object objnum with generation gennum.
static SecurityHandlergetInstance(String filter, Dict shdict, COSSource coss)
java.lang.reflect.Constructor#newInstance(Object[]) for a description of the exceptions thrown.
abstract byte[]getKey()
CryptFilter may take key from a security handler and use in Adobe algorithms.
abstract booleanisAuthorized()
Returns true if a valid decryption password, either user or owner, been set?
static voidregister(String filterName, String className)
Registers the security handler className, which must be a subclass of Encrypt, for filterName.
abstract SecurityHandlerreset(int objnum, int gennum)
Resets for decrypting/encrypting another subobject of object at given number.

Field Detail

IDENTITY

public static final SecurityHandler IDENTITY

Constructor Detail

SecurityHandler

public SecurityHandler(Dict edict, COSSource coss)

Method Detail

authOwner

public abstract boolean authOwner(String owner)

authUser

public abstract boolean authUser(String user)

clone

public Object clone()

computeKey

public abstract byte[] computeKey(String password)

decrypt

public abstract byte[] decrypt(byte[] data, int off, int len)
Decrypts stream data of object objnum with generation gennum. Data is decrypted in place, which is to say the contents data are mutated.

Returns: handle to decrypted data, which is same handle as the passed data.

encrypt

public abstract byte[] encrypt(byte[] data, int off, int len)
Encrypts data of object objnum with generation gennum. Data is encrypted in place, which is to say the contents data are mutated.

Returns: handle to encrypted data, which is same handle as the passed data.

getInstance

public static SecurityHandler getInstance(String filter, Dict shdict, COSSource coss)
java.lang.reflect.Constructor#newInstance(Object[]) for a description of the exceptions thrown.

Throws: UnsupportedOperationException if filter not registered ClassNotFoundException if class name registered to filter is not the CLASSPATH ParseException if can't read parameters for filter

getKey

public abstract byte[] getKey()
CryptFilter may take key from a security handler and use in Adobe algorithms.

isAuthorized

public abstract boolean isAuthorized()
Returns true if a valid decryption password, either user or owner, been set?

register

public static void register(String filterName, String className)
Registers the security handler className, which must be a subclass of Encrypt, for filterName. For example, Adobe's standard security handler is registered (automatically by the system), with the call register("Standard", "multivalent.std.adaptor.pdf.SecurityHandlerStandard").

reset

public abstract SecurityHandler reset(int objnum, int gennum)
Resets for decrypting/encrypting another subobject of object at given number.