public class PdfEncryption extends Object
Modifier and Type | Field and Description |
---|---|
static int |
AES_128 |
static int |
AES_256 |
protected PdfPublicKeySecurityHandler |
publicKeyHandler
The public key security handler for certificate encryption
|
static int |
STANDARD_ENCRYPTION_128 |
static int |
STANDARD_ENCRYPTION_40 |
Constructor and Description |
---|
PdfEncryption() |
PdfEncryption(PdfEncryption enc) |
Modifier and Type | Method and Description |
---|---|
void |
addRecipient(Certificate cert, int permission) |
int |
calculateStreamSize(int n) |
byte[] |
computeUserPassword(byte[] ownerPassword)
Computes user password if standard encryption handler is used with Standard40, Standard128 or AES128 algorithm (Revision 2 - 4).
|
static byte[] |
createDocumentId() |
static PdfObject |
createInfoId(byte[] id, boolean modified) |
byte[] |
decryptByteArray(byte[] b) |
byte[] |
encryptByteArray(byte[] b) |
int |
getCryptoMode() |
StandardDecryption |
getDecryptor() |
PdfDictionary |
getEncryptionDictionary() |
OutputStreamEncryption |
getEncryptionStream(OutputStream os) |
PdfObject |
getFileID(boolean modified) |
long |
getPermissions() |
boolean |
isEmbeddedFilesOnly()
Indicates if only the embedded files have to be encrypted.
|
boolean |
isMetadataEncrypted() |
boolean |
readKey(PdfDictionary enc, byte[] password) |
void |
setCryptoMode(int mode, int kl) |
void |
setHashKey(int number, int generation) |
void |
setKey(byte[] key) |
void |
setupAllKeys(byte[] userPassword, byte[] ownerPassword, int permissions) |
void |
setupByEncryptionKey(byte[] key, int keylength) |
void |
setupByOwnerPassword(byte[] documentID, byte[] ownerPassword, byte[] userKey, byte[] ownerKey, long permissions) |
void |
setupByUserPassword(byte[] documentID, byte[] userPassword, byte[] ownerKey, long permissions) |
public static final int STANDARD_ENCRYPTION_40
public static final int STANDARD_ENCRYPTION_128
public static final int AES_128
public static final int AES_256
protected PdfPublicKeySecurityHandler publicKeyHandler
public PdfEncryption()
public PdfEncryption(PdfEncryption enc)
public void setCryptoMode(int mode, int kl)
public int getCryptoMode()
public boolean isMetadataEncrypted()
public long getPermissions()
public boolean isEmbeddedFilesOnly()
public void setupAllKeys(byte[] userPassword, byte[] ownerPassword, int permissions)
public boolean readKey(PdfDictionary enc, byte[] password) throws BadPasswordException
BadPasswordException
public static byte[] createDocumentId()
public void setupByUserPassword(byte[] documentID, byte[] userPassword, byte[] ownerKey, long permissions)
public void setupByOwnerPassword(byte[] documentID, byte[] ownerPassword, byte[] userKey, byte[] ownerKey, long permissions)
public void setKey(byte[] key)
public void setupByEncryptionKey(byte[] key, int keylength)
public void setHashKey(int number, int generation)
public static PdfObject createInfoId(byte[] id, boolean modified) throws IOException
IOException
public PdfDictionary getEncryptionDictionary()
public PdfObject getFileID(boolean modified) throws IOException
IOException
public OutputStreamEncryption getEncryptionStream(OutputStream os)
public int calculateStreamSize(int n)
public byte[] encryptByteArray(byte[] b)
public StandardDecryption getDecryptor()
public byte[] decryptByteArray(byte[] b)
public void addRecipient(Certificate cert, int permission)
public byte[] computeUserPassword(byte[] ownerPassword)
ownerPassword
- owner password of the encrypted document.
Copyright © 1998–2018. All rights reserved.