org.apache.pdfbox.pdmodel.encryption

## Class PDCryptFilterDictionary

- java.lang.Object
- - org.apache.pdfbox.pdmodel.encryption.PDCryptFilterDictionary

All Implemented Interfaces:
  COSObjectable

    public class PDCryptFilterDictionary
    extends Object
    implements COSObjectable

This class is a specialized view of the crypt filter dictionary of a PDF document. It contains a low level dictionary (COSDictionary) and provides the methods to manage its fields.

### Field Summary

Fields
`protected COSDictionary` `cryptFilterDictionary` COS crypt filter dictionary.

### Constructor Summary

Constructors
Constructor and Description
`PDCryptFilterDictionary()` creates a new empty crypt filter dictionary.
`PDCryptFilterDictionary(COSDictionary d)` creates a new crypt filter dictionary from the low level dictionary provided.

### Method Summary

All Methods Instance Methods Concrete Methods
`COSDictionary` `getCOSObject()` This will get the dictionary associated with this crypt filter dictionary.
`COSName` `getCryptFilterMethod()` This will return the crypt filter method.
`int` `getLength()` This will return the Length entry of the crypt filter dictionary. The length in bits for the crypt filter algorithm.
`boolean` `isEncryptMetaData()` Will get the EncryptMetaData dictionary info.
`void` `setCryptFilterMethod(COSName cfm)` This will set the crypt filter method.
`void` `setEncryptMetaData(boolean encryptMetaData)` Set the EncryptMetaData dictionary info.
`void` `setLength(int length)` This will set the number of bits to use for the crypt filter algorithm.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### cryptFilterDictionary

    protected COSDictionary cryptFilterDictionary

COS crypt filter dictionary.

### Constructor Detail

#### PDCryptFilterDictionary

    public PDCryptFilterDictionary()

creates a new empty crypt filter dictionary.

#### PDCryptFilterDictionary

    public PDCryptFilterDictionary(COSDictionary d)

creates a new crypt filter dictionary from the low level dictionary provided.

Parameters:
  `d` - the low level dictionary that will be managed by the newly created object

### Method Detail

#### getCOSObject

    public COSDictionary getCOSObject()

This will get the dictionary associated with this crypt filter dictionary.

Specified by:
  `getCOSObject` in interface `COSObjectable`
Returns:
  The COS dictionary that this object wraps.

#### setLength

    public void setLength(int length)

This will set the number of bits to use for the crypt filter algorithm.

Parameters:
  `length` - The new key length.

#### getLength

    public int getLength()

This will return the Length entry of the crypt filter dictionary.
The length in bits for the crypt filter algorithm. This will return a multiple of 8.

Returns:
  The length in bits for the encryption algorithm

#### setCryptFilterMethod

    public void setCryptFilterMethod(COSName cfm)

This will set the crypt filter method. Allowed values are: NONE, V2, AESV2, AESV3

Parameters:
  `cfm` - name of the crypt filter method.

#### getCryptFilterMethod

    public COSName getCryptFilterMethod()

This will return the crypt filter method. Allowed values are: NONE, V2, AESV2, AESV3

Returns:
  the name of the crypt filter method.

#### isEncryptMetaData

    public boolean isEncryptMetaData()

Will get the EncryptMetaData dictionary info.

Returns:
  true if EncryptMetaData is explicitly set (the default is true)

#### setEncryptMetaData

    public void setEncryptMetaData(boolean encryptMetaData)

Set the EncryptMetaData dictionary info.

Parameters:
  `encryptMetaData` - true if EncryptMetaData shall be set.