Class ProtectionPolicy
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.encryption.ProtectionPolicy
-
- Direct Known Subclasses:
PublicKeyProtectionPolicy
,StandardProtectionPolicy
public abstract class ProtectionPolicy extends java.lang.Object
This class represents the protection policy to apply to a document. Objects implementing this abstract class can be passed to the protect method of PDDocument to protect a document.- See Also:
PDDocument.protect(ProtectionPolicy)
-
-
Field Summary
Fields Modifier and Type Field Description private static int
DEFAULT_KEY_LENGTH
private int
encryptionKeyLength
-
Constructor Summary
Constructors Constructor Description ProtectionPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getEncryptionKeyLength()
Get the length of the secrete key that will be used to encrypt document data.void
setEncryptionKeyLength(int l)
set the length in (bits) of the secret key that will be used to encrypt document data.
-
-
-
Field Detail
-
DEFAULT_KEY_LENGTH
private static final int DEFAULT_KEY_LENGTH
- See Also:
- Constant Field Values
-
encryptionKeyLength
private int encryptionKeyLength
-
-
Method Detail
-
setEncryptionKeyLength
public void setEncryptionKeyLength(int l)
set the length in (bits) of the secret key that will be used to encrypt document data. The default value is 40 bits, which provides a low security level but is compatible with old versions of Acrobat Reader.- Parameters:
l
- the length in bits (must be 40, 128 or 256)
-
getEncryptionKeyLength
public int getEncryptionKeyLength()
Get the length of the secrete key that will be used to encrypt document data.- Returns:
- The length (in bits) of the encryption key.
-
-