Class PDFDecrypterFactory
java.lang.Object
org.loboevolution.pdfview.decrypt.PDFDecrypterFactory
Produces a
PDFDecrypter
for documents given a (possibly non-existent)
Encrypt dictionary. Supports decryption of versions 1, 2 and 4 of the
password-based encryption mechanisms as described in PDF Reference version
1.7. This means that it supports RC4 and AES encryption with keys of
40-128 bits; esentially, password-protected documents with compatibility
up to Acrobat 8.
See "PDF Reference version 1.7, section 3.5: Encryption" Author Luke Kirby
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The name of the standard Identity CryptFilter -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic PDFDecrypter
createDecryptor
(PDFObject encryptDict, PDFObject documentId, PDFPassword password) Create a decryptor for a given encryption dictionary.static boolean
isFilterExist
(PDFObject encryptDict) isFilterExist.
-
Field Details
-
CF_IDENTITY
The name of the standard Identity CryptFilter- See Also:
-
-
Constructor Details
-
PDFDecrypterFactory
public PDFDecrypterFactory()
-
-
Method Details
-
createDecryptor
public static PDFDecrypter createDecryptor(PDFObject encryptDict, PDFObject documentId, PDFPassword password) throws IOException, EncryptionUnsupportedByPlatformException, EncryptionUnsupportedByProductException, PDFAuthenticationFailureException Create a decryptor for a given encryption dictionary. A check is immediately performed that the supplied password decrypts content described by the encryption specification.- Parameters:
encryptDict
- the Encrypt dict as found in the document's trailer. May be null, in which case theIdentityDecrypter
will be returned.documentId
- the object with key "ID" in the trailer's dictionary. Should always be present if Encrypt is.password
- the password to use; may benull
- Returns:
- The decryptor that should be used for all encrypted data in the PDF
- Throws:
IOException
- if any.EncryptionUnsupportedByPlatformException
- if any.EncryptionUnsupportedByProductException
- if any.PDFAuthenticationFailureException
- if any.
-
isFilterExist
isFilterExist.
- Parameters:
encryptDict
- the Encrypt dict as found in the document's trailer.- Returns:
- true if the Filter exist in the current dictionary
-