org.apache.pdfbox.pdmodel.PDDocument#protect(ProtectionPolicy)
| Modifier and Type | Field and Description |
|---|---|
| private static final short | |
| private short | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The length (in bits) of the encryption key.Get the length of the secrete key that will be used to encrypt document data. |
| public boolean | Returns: true if AES encryption is preferredTell whether AES encryption is preferred when several encryption methods are available for the chosen key length. |
| public void | setEncryptionKeyLength(int
the length in bits (must be 40, 128 or 256) l)set the length in (bits) of the secret key that will be used to encrypt document data. |
| public void | setPreferAES(boolean
indicates whether AES encryption is preferred or not preferAES)Set whether AES encryption is preferred when several encryption methods are available for the chosen key length. |
| DEFAULT_KEY_LENGTH | back to summary |
|---|---|
| private static final short DEFAULT_KEY_LENGTH | |
| encryptionKeyLength | back to summary |
|---|---|
| private short encryptionKeyLength | |
| preferAES | back to summary |
|---|---|
| private boolean preferAES | |
| ProtectionPolicy | back to summary |
|---|---|
| public ProtectionPolicy() | |
| getEncryptionKeyLength | back to summary |
|---|---|
| public int getEncryptionKeyLength() Get the length of the secrete key that will be used to encrypt document data.
| |
| isPreferAES | back to summary |
|---|---|
| public boolean isPreferAES() Tell whether AES encryption is preferred when several encryption methods are available for the chosen key length. The default is false. This setting is only relevant if the key length is 128 bits.
| |
| setEncryptionKeyLength | back to summary |
|---|---|
| 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.
| |
| setPreferAES | back to summary |
|---|---|
| public void setPreferAES(boolean preferAES) Set whether AES encryption is preferred when several encryption methods are available for the chosen key length. The default is false. This setting is only relevant if the key length is 128 bits.
| |