Package | Description |
---|---|
org.apache.pdfbox.encryption |
These classes deal with encryption algorithms that are used in the PDF Document.
|
org.apache.pdfbox.pdmodel |
The PDModel package represents a high level API for creating and manipulating PDF documents.
|
org.apache.pdfbox.pdmodel.encryption |
The encryption package will handle the PDF document security handlers and the functionality of pluggable security handlers.
|
Modifier and Type | Method | Description |
---|---|---|
byte[] |
PDFEncryption.computeEncryptedKey(byte[] password,
byte[] o,
int permissions,
byte[] id,
int revision,
int length) |
Deprecated.
This will compute the encrypted key.
|
byte[] |
PDFEncryption.computeOwnerPassword(byte[] ownerPassword,
byte[] userPassword,
int revision,
int length) |
Deprecated.
This algorithm is taked from PDF Reference 1.4 Algorithm 3.3 Page 79.
|
byte[] |
PDFEncryption.computeUserPassword(byte[] password,
byte[] o,
int permissions,
byte[] id,
int revision,
int length) |
Deprecated.
This will compute the user password hash.
|
void |
DocumentEncryption.decrypt(java.lang.Object obj,
long objNum,
long genNum) |
Deprecated.
This will dispatch to the correct method.
|
void |
DocumentEncryption.decryptDocument(java.lang.String password) |
Deprecated.
This will decrypt the document.
|
void |
PDFEncryption.encryptData(long objectNumber,
long genNumber,
byte[] key,
java.io.InputStream data,
java.io.OutputStream output) |
Deprecated.
This will encrypt a piece of data.
|
byte[] |
PDFEncryption.getUserPassword(byte[] ownerPassword,
byte[] o,
int revision,
long length) |
Deprecated.
This will get the user password from the owner password and the documents o value.
|
void |
DocumentEncryption.initForEncryption() |
Deprecated.
This will encrypt the given document, given the owner password and user password.
|
boolean |
PDFEncryption.isOwnerPassword(byte[] ownerPassword,
byte[] u,
byte[] o,
int permissions,
byte[] id,
int revision,
int length) |
Deprecated.
This will tell if this is the owner password or not.
|
boolean |
PDFEncryption.isUserPassword(byte[] password,
byte[] u,
byte[] o,
int permissions,
byte[] id,
int revision,
int length) |
Deprecated.
This will tell if this is a valid user password.
|
Modifier and Type | Method | Description |
---|---|---|
void |
PDDocument.decrypt(java.lang.String password) |
This will decrypt a document.
|
void |
PDDocument.encrypt(java.lang.String ownerPassword,
java.lang.String userPassword) |
This will mark a document to be encrypted.
|
boolean |
PDDocument.isOwnerPassword(java.lang.String password) |
Deprecated.
|
boolean |
PDDocument.isUserPassword(java.lang.String password) |
Deprecated.
|
void |
PDDocument.openProtection(DecryptionMaterial pm) |
Tries to decrypt the document in memory using the provided decryption material.
|
Modifier and Type | Method | Description |
---|---|---|
byte[] |
StandardSecurityHandler.computeEncryptedKey(byte[] password,
byte[] o,
int permissions,
byte[] id,
int encRevision,
int length,
boolean encryptMetadata) |
Compute the encryption key.
|
byte[] |
StandardSecurityHandler.computeOwnerPassword(byte[] ownerPassword,
byte[] userPassword,
int encRevision,
int length) |
Compute the owner entry in the encryption dictionary.
|
byte[] |
StandardSecurityHandler.computeUserPassword(byte[] password,
byte[] o,
int permissions,
byte[] id,
int encRevision,
int length,
boolean encryptMetadata) |
This will compute the user password hash.
|
void |
SecurityHandler.decryptArray(COSArray array,
long objNum,
long genNum) |
This will decrypt an array.
|
void |
PublicKeySecurityHandler.decryptDocument(PDDocument doc,
DecryptionMaterial decryptionMaterial) |
Decrypt the document.
|
abstract void |
SecurityHandler.decryptDocument(PDDocument doc,
DecryptionMaterial mat) |
Prepare the document for decryption.
|
void |
StandardSecurityHandler.decryptDocument(PDDocument doc,
DecryptionMaterial decryptionMaterial) |
Decrypt the document.
|
void |
SecurityHandler.decryptStream(COSStream stream,
long objNum,
long genNum) |
This will decrypt a stream.
|
void |
SecurityHandler.decryptString(COSString string,
long objNum,
long genNum) |
This will decrypt a string.
|
void |
SecurityHandler.encryptData(long objectNumber,
long genNumber,
java.io.InputStream data,
java.io.OutputStream output) |
Deprecated.
While this works fine for RC4 encryption, it will never decrypt AES data You should use
encryptData(objectNumber, genNumber, data, output, decrypt) which can do everything.
|
void |
SecurityHandler.encryptData(long objectNumber,
long genNumber,
java.io.InputStream data,
java.io.OutputStream output,
boolean decrypt) |
Encrypt a set of data.
|
void |
SecurityHandler.encryptStream(COSStream stream,
long objNum,
long genNum) |
This will encrypt a stream, but not the dictionary as the dictionary is encrypted by visitFromString() in
COSWriter and we don't want to encrypt it twice.
|
void |
SecurityHandler.encryptString(COSString string,
long objNum,
long genNum) |
This will encrypt a string.
|
byte[] |
StandardSecurityHandler.getUserPassword(byte[] ownerPassword,
byte[] o,
int encRevision,
int length) |
Get the user password based on the owner password.
|
boolean |
StandardSecurityHandler.isOwnerPassword(byte[] ownerPassword,
byte[] u,
byte[] o,
int permissions,
byte[] id,
int encRevision,
int length,
boolean encryptMetadata) |
Check for owner password.
|
boolean |
StandardSecurityHandler.isOwnerPassword(java.lang.String password,
byte[] u,
byte[] o,
int permissions,
byte[] id,
int encRevision,
int length,
boolean encryptMetadata) |
Check for owner password.
|
boolean |
StandardSecurityHandler.isUserPassword(byte[] password,
byte[] u,
byte[] o,
int permissions,
byte[] id,
int encRevision,
int length,
boolean encryptMetadata) |
Check if a plaintext password is the user password.
|
boolean |
StandardSecurityHandler.isUserPassword(java.lang.String password,
byte[] u,
byte[] o,
int permissions,
byte[] id,
int encRevision,
int length,
boolean encryptMetadata) |
Check if a plaintext password is the user password.
|
void |
PublicKeySecurityHandler.prepareDocumentForEncryption(PDDocument doc) |
Prepare the document for encryption.
|
abstract void |
SecurityHandler.prepareDocumentForEncryption(PDDocument doc) |
Prepare the document for encryption.
|
void |
StandardSecurityHandler.prepareDocumentForEncryption(PDDocument doc) |
Prepare document for encryption.
|
void |
PublicKeySecurityHandler.prepareForDecryption(PDEncryptionDictionary encDictionary,
COSArray documentIDArray,
DecryptionMaterial decryptionMaterial) |
Prepares everything to decrypt the document.
|
abstract void |
SecurityHandler.prepareForDecryption(PDEncryptionDictionary encDictionary,
COSArray documentIDArray,
DecryptionMaterial decryptionMaterial) |
Prepares everything to decrypt the document.
|
void |
StandardSecurityHandler.prepareForDecryption(PDEncryptionDictionary encDictionary,
COSArray documentIDArray,
DecryptionMaterial decryptionMaterial) |
Prepares everything to decrypt the document.
|
protected void |
SecurityHandler.proceedDecryption() |
This method must be called by an implementation of this class to really proceed to decryption.
|