Hello,

I am getting a violation of Illegal Key size (see stack trace below) when
calling

PDDocument.*load*(istream, password);
on a specific PDF file.

I googled the error and it appears to be due to Java security
restrictions.  So I did all the appropriate things to correct that, and
just before the call to load() I verify Security.*getProperty*("crypto.
policy")) and it is "unlimited".  But the error still occurs.

A sample PDF I created a password on works fine.  And the PDF with the
problem is readable in Acrobat with the password.  So it appears to
be something to do with using this password.

But I'm mystified as to what else other than "crypto policy" might be
causing this??

Thanks

---------------------
*java.io.IOException*: *java.security.InvalidKeyException*: Illegal key size
at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.
computeEncryptedKeyRev56(*StandardSecurityHandler.java:765*)
at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.
computeEncryptedKey(*StandardSecurityHandler.java:667*)
 at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.
prepareForDecryption(*StandardSecurityHandler.java:244*)
at org.apache.pdfbox.pdfparser.PDFParser.prepareDecryption(
*PDFParser.java:325*)
at org.apache.pdfbox.pdfparser.PDFParser.initialParse(*PDFParser.java:225*)
at org.apache.pdfbox.pdfparser.PDFParser.parse(*PDFParser.java:276*)
at org.apache.pdfbox.pdmodel.PDDocument.load(*PDDocument.java:1143*)
at org.apache.pdfbox.pdmodel.PDDocument.load(*PDDocument.java:1077*)

.....
Caused by: *java.security.InvalidKeyException*: Illegal key size
 at javax.crypto.Cipher.checkCryptoPerm(*Cipher.java:1029*)
 at javax.crypto.Cipher.implInit(*Cipher.java:795*)
 at javax.crypto.Cipher.chooseProvider(*Cipher.java:854*)
 at javax.crypto.Cipher.init(*Cipher.java:1374*)
 at javax.crypto.Cipher.init(*Cipher.java:1308*)
 at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.
computeEncryptedKeyRev56(*StandardSecurityHandler.java:759*)

... 16 more

Reply via email to