I had a quick look... yes the document info is unencrypted which is incorrect. EncryptMeta is false but this applies only to XMP metadata streams.

Tilman

Am 24.04.2018 um 12:48 schrieb Evert-Jan de Bruin:

Hello,

For my project I have to merge PDF files together. This usually works fine, but it does not always work with digitally signed PDF files.

Simply a load() of the document will already fail with InvalidBlockSizeException. Here is an example document: https://ufile.io/mgshz

I went into the PDFBox code, and the issue seems to be that it detects AES encryption in the PDF due to the digital signature, but then assumes everything is encrypted and needs to be decrypted. However, the headers are **not** encrypted so decryption fails.

I can get it all to work by going to PDFParser.java and disabling these three lines in prepareDecryption():

//                securityHandler = encryption.getSecurityHandler();

// securityHandler.prepareForDecryption(encryption, document.getDocumentID(),

// decryptionMaterial);

// accessPermission = securityHandler.getCurrentAccessPermission();

However, this is of course very ugly as decryption is now totally disabled. I also get warnings about offset issues but the end result seems fine.

Is there a more elegant solution or is this really a bug?

It seems to be a repetition of https://issues.apache.org/jira/browse/PDFBOX-3229 <https://issues.apache.org/jira/browse/PDFBOX-3229> but this should have been fixed in 2.0.0, however, it still occurs in 2.0.9

Regards,

Evert-Jan de Bruin

K00716_Osiris_MailSignature-logo

        

CACI bv
www.osiris-ho.nl <http://www.osiris-ho.nl/>

        

De Ruyterkade 7
1013 AA Amsterdam

        

088 – 654 3594
[email protected] <mailto:[email protected]>

This electronic message contains information from CACI BV, which may be confidential, proprietary, privileged or otherwise protected from disclosure. The information is intended to be used solely by the recipient(s) named above. If you are not an intended recipient, be aware that any review, disclosure, copying, distribution or use of this transmission or its contents is prohibited.

If you have received this transmission in error, please notify the sender immediately and delete all copies of this message.


Reply via email to