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 and 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(Object obj,
long objNum,
long genNum)
Deprecated.
This will dispatch to the correct method.
|
void |
DocumentEncryption.decryptDocument(String password)
Deprecated.
This will decrypt the document.
|
void |
PDFEncryption.encryptData(long objectNumber,
long genNumber,
byte[] key,
InputStream data,
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 and Description |
---|---|
void |
PDDocument.decrypt(String password)
This will decrypt a document.
|
void |
PDDocument.encrypt(String ownerPassword,
String userPassword)
This will mark a document to be encrypted.
|
boolean |
PDDocument.isOwnerPassword(String password)
Deprecated.
|
boolean |
PDDocument.isUserPassword(String password)
Deprecated.
|
void |
PDDocument.openProtection(DecryptionMaterial pm)
Tries to decrypt the document in memory using the provided decryption material.
|
Modifier and Type | Method and 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 |
StandardSecurityHandler.decryptDocument(PDDocument doc,
DecryptionMaterial decryptionMaterial)
Decrypt the document.
|
abstract void |
SecurityHandler.decryptDocument(PDDocument doc,
DecryptionMaterial mat)
Prepare the document for decryption.
|
void |
PublicKeySecurityHandler.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,
InputStream data,
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. This function is
just here for compatibility reasons and will be removed in the future.
|
void |
SecurityHandler.encryptData(long objectNumber,
long genNumber,
InputStream data,
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(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(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 |
StandardSecurityHandler.prepareDocumentForEncryption(PDDocument doc)
Prepare document for encryption.
|
abstract void |
SecurityHandler.prepareDocumentForEncryption(PDDocument doc)
Prepare the document for encryption.
|
void |
PublicKeySecurityHandler.prepareDocumentForEncryption(PDDocument doc)
Prepare the document for encryption.
|
void |
StandardSecurityHandler.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 |
PublicKeySecurityHandler.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.
|
Copyright © 2002-2015 The Apache Software Foundation. All Rights Reserved.