java.lang.Object
org.sejda.sambox.pdmodel.encryption.ProtectionPolicy
- Direct Known Subclasses:
PublicKeyProtectionPolicy,StandardProtectionPolicy
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final shortprivate short -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionshortGet the length of the secrete key that will be used to encrypt document data.voidsetEncryptionKeyLength(int l) set the length in (bits) of the secret key that will be used to encrypt document data.
-
Field Details
-
DEFAULT_KEY_LENGTH
private static final short DEFAULT_KEY_LENGTH- See Also:
-
encryptionKeyLength
private short encryptionKeyLength
-
-
Constructor Details
-
ProtectionPolicy
public ProtectionPolicy()
-
-
Method Details
-
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 short 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.
-