[ 
https://issues.apache.org/jira/browse/PDFBOX-4808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17078425#comment-17078425
 ] 

Tilman Hausherr edited comment on PDFBOX-4808 at 4/8/20, 4:04 PM:
------------------------------------------------------------------

You won't be able to inspect them before loading them. In Adobe Reader you can 
look at "properties", "security", "details" and you'll see the key length. The 
key length is in the /Encrypt dictionary, it is the /Length entry.

The "reasoning" is that java without strong encryption won't be able to decrypt 
these files.

If strong encryption is installed, you can see the key length with PDFDebugger:

 !screenshot-1.png! 


was (Author: tilman):
You won't be able to inspect them before loading them. In Adobe Reader you can 
look at "properties", "security", "details" and you'll see the key length. The 
key length is in the /Encryption dictionary, it is the /Length entry.

The "reasoning" is that java without strong encryption won't be able to decrypt 
these files.

If strong encryption is installed, you can see the key length with PDFDebugger:

 !screenshot-1.png! 

> Issue while merging documents
> -----------------------------
>
>                 Key: PDFBOX-4808
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4808
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Crypto
>    Affects Versions: 2.0.9
>            Reporter: Sunil
>            Priority: Major
>         Attachments: screenshot-1.png
>
>
>  
> I am trying PDFBox for merging multiple PDF documents. Code is below. I am 
> facing an issue. For a few PDF files i am getting "java.io.IOException: 
> java.security.InvalidKeyException: Illegal key size". I am not sure what is 
> going on. Could someone please help me ? 
> Could you please also let me know if PDFBox has restriction on 
> PDFstandards/types etc ?
>  
> {{    PDFMergerUtility PDFutility = new 
> PDFMergerUtility();ByteArrayOutputStream mergedPdf = new 
> ByteArrayOutputStream();PDFutility.addSources(pdfDocs);PDFutility.setDestinationStream(mergedPdf);PDFutility.mergeDocuments();}}
> {{}}
> Caused by: java.io.IOException: java.security.InvalidKeyException: Illegal 
> key size at 
> org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.computeEncryptedKeyRev56(StandardSecurityHandler.java:779)
>  at 
> org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.computeEncryptedKey(StandardSecurityHandler.java:681)
>  at 
> org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.prepareForDecryption(StandardSecurityHandler.java:256)
>  at 
> org.apache.pdfbox.pdfparser.COSParser.prepareDecryption(COSParser.java:2929) 
> at org.apache.pdfbox.pdfparser.COSParser.retrieveTrailer(COSParser.java:286) 
> at org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:173) at 
> org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:226) at 
> org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1222) at 
> org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1140) at 
> org.apache.pdfbox.multipdf.PDFMergerUtility.legacyMergeDocuments(PDFMergerUtility.java:455)
>  at 
> org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:346)
>  at 
> org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:330){{}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to