Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.encryption

public Class PDCryptFilterDictionary

extends Object
implements COSObjectable
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.pdmodel.common.COSObjectable
Imports
org.apache.pdfbox.cos.COSBase, .COSBoolean, .COSDictionary, .COSName, org.apache.pdfbox.pdmodel.common.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

Modifier and TypeField and Description
protected COSDictionary
cryptFilterDictionary

COS crypt filter dictionary.

Constructor Summary

AccessConstructor and Description
public
PDCryptFilterDictionary()

creates a new empty crypt filter dictionary.

public
PDCryptFilterDictionary(COSDictionary
the low level dictionary that will be managed by the newly created object
d
)

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

Method Summary

Modifier and TypeMethod and Description
public COSDictionary

Returns:

The COS dictionary that this object wraps.
getCOSObject
()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

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

public COSName

Returns:

the name of the crypt filter method.
getCryptFilterMethod
()

This will return the crypt filter method.

public int

Returns:

The length in bits for the encryption algorithm
getLength
()

This will return the Length entry of the crypt filter dictionary.

public boolean

Returns:

true if EncryptMetaData is explicitly set (the default is true)
isEncryptMetaData
()

Will get the EncryptMetaData dictionary info.

public void
setCryptFilterMethod(COSName
name of the crypt filter method.
cfm
)

This will set the crypt filter method.

public void
setEncryptMetaData(boolean
true if EncryptMetaData shall be set.
encryptMetaData
)

Set the EncryptMetaData dictionary info.

public void
setLength(int
The new key length.
length
)

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cryptFilterDictionaryback to summary
protected COSDictionary cryptFilterDictionary

COS crypt filter dictionary.

Constructor Detail

PDCryptFilterDictionaryback to summary
public PDCryptFilterDictionary()

creates a new empty crypt filter dictionary.

PDCryptFilterDictionaryback to summary
public PDCryptFilterDictionary(COSDictionary d)

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

Parameters
d:COSDictionary

the low level dictionary that will be managed by the newly created object

Method Detail

getCOSObjectback to summary
public COSDictionary getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

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

Returns:COSDictionary

The COS dictionary that this object wraps.

Annotations
@Override
getCryptFilterMethodback to summary
public COSName getCryptFilterMethod()

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

Returns:COSName

the name of the crypt filter method.

getLengthback to summary
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:int

The length in bits for the encryption algorithm

isEncryptMetaDataback to summary
public boolean isEncryptMetaData()

Will get the EncryptMetaData dictionary info.

Returns:boolean

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

setCryptFilterMethodback to summary
public void setCryptFilterMethod(COSName cfm)

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

Parameters
cfm:COSName

name of the crypt filter method.

setEncryptMetaDataback to summary
public void setEncryptMetaData(boolean encryptMetaData)

Set the EncryptMetaData dictionary info.

Parameters
encryptMetaData:boolean

true if EncryptMetaData shall be set.

setLengthback to summary
public void setLength(int length)

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

Parameters
length:int

The new key length.