jPod PDF library

de.intarsys.pdf.crypt
Class SystemSecurityHandlerV4

java.lang.Object
  extended by de.intarsys.pdf.crypt.SystemSecurityHandler
      extended by de.intarsys.pdf.crypt.SystemSecurityHandlerV4
All Implemented Interfaces:
ISystemSecurityHandler

public class SystemSecurityHandlerV4
extends SystemSecurityHandler

The ISystemSecurityHandler implementing /V 4 of the PDF spec.

The crypt handlers are created lazy and never changed - it is unwise to change any encryption parameters afterwards!


Field Summary
static COSName CN_AESV2
           
static COSName CN_CryptFilter
           
static COSName CN_None
           
static COSName CN_V2
           
static COSName DK_CFM
           
static COSName DK_NAME
           
static COSName DK_TYPE
           
 
Fields inherited from class de.intarsys.pdf.crypt.SystemSecurityHandler
DEFAULT_LENGTH
 
Method Summary
 void cosAddCryptFilter(COSName name, COSDictionary cryptFilterDict)
           
 COSDictionary cosGetCryptFilters()
           
 void cosRemoveCryptFilter(COSName name)
           
 byte[] decryptFile(COSObjectKey key, COSDictionary dict, byte[] bytes)
           
 byte[] decryptStream(COSObjectKey key, COSDictionary dict, byte[] bytes)
           
 byte[] decryptString(COSObjectKey key, byte[] bytes)
           
 byte[] encryptFile(COSObjectKey key, COSDictionary dict, byte[] bytes)
           
 byte[] encryptStream(COSObjectKey key, COSDictionary dict, byte[] bytes)
           
 byte[] encryptString(COSObjectKey key, byte[] bytes)
           
 ICryptHandler getCryptHandler(COSName name)
           
 int getLength()
          The length of the encryption key in bits.
 int getVersion()
           
 void setEncryptionFilterStream(COSName name)
           
 void setEncryptionFilterString(COSName name)
           
 void setEncryptionMethodAES(COSName filterName)
           
 void setEncryptionMethodArcFour(COSName filterName)
           
 void setEncryptionMethodNone(COSName filterName)
           
 void setEncryptMetadata(boolean value)
           
 
Methods inherited from class de.intarsys.pdf.crypt.SystemSecurityHandler
attach, authenticate, cosGetEncryption, createFromSt, createNewV1, createNewV2, createNewV4, detach, getContextObject, getEncryption, getSecurityHandler, initialize, popContextObject, pushContextObject, setLength, setSecurityHandler, stGetDoc, updateTrailer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CN_AESV2

public static final COSName CN_AESV2

CN_CryptFilter

public static final COSName CN_CryptFilter

CN_None

public static final COSName CN_None

CN_V2

public static final COSName CN_V2

DK_CFM

public static final COSName DK_CFM

DK_NAME

public static final COSName DK_NAME

DK_TYPE

public static final COSName DK_TYPE
Method Detail

cosAddCryptFilter

public void cosAddCryptFilter(COSName name,
                              COSDictionary cryptFilterDict)

cosGetCryptFilters

public COSDictionary cosGetCryptFilters()

cosRemoveCryptFilter

public void cosRemoveCryptFilter(COSName name)

decryptFile

public byte[] decryptFile(COSObjectKey key,
                          COSDictionary dict,
                          byte[] bytes)
                   throws COSSecurityException
Throws:
COSSecurityException

decryptStream

public byte[] decryptStream(COSObjectKey key,
                            COSDictionary dict,
                            byte[] bytes)
                     throws COSSecurityException
Throws:
COSSecurityException

decryptString

public byte[] decryptString(COSObjectKey key,
                            byte[] bytes)
                     throws COSSecurityException
Throws:
COSSecurityException

encryptFile

public byte[] encryptFile(COSObjectKey key,
                          COSDictionary dict,
                          byte[] bytes)
                   throws COSSecurityException
Throws:
COSSecurityException

encryptStream

public byte[] encryptStream(COSObjectKey key,
                            COSDictionary dict,
                            byte[] bytes)
                     throws COSSecurityException
Throws:
COSSecurityException

encryptString

public byte[] encryptString(COSObjectKey key,
                            byte[] bytes)
                     throws COSSecurityException
Throws:
COSSecurityException

getCryptHandler

public ICryptHandler getCryptHandler(COSName name)
                              throws COSSecurityException
Throws:
COSSecurityException

getLength

public int getLength()
Description copied from interface: ISystemSecurityHandler
The length of the encryption key in bits.

Specified by:
getLength in interface ISystemSecurityHandler
Overrides:
getLength in class SystemSecurityHandler
Returns:
The length of the encryption key in bits.

getVersion

public int getVersion()
Specified by:
getVersion in class SystemSecurityHandler

setEncryptionFilterStream

public void setEncryptionFilterStream(COSName name)

setEncryptionFilterString

public void setEncryptionFilterString(COSName name)

setEncryptionMethodAES

public void setEncryptionMethodAES(COSName filterName)

setEncryptionMethodArcFour

public void setEncryptionMethodArcFour(COSName filterName)

setEncryptionMethodNone

public void setEncryptionMethodNone(COSName filterName)

setEncryptMetadata

public void setEncryptMetadata(boolean value)

jPod PDF library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.