Does PDFIUM support encrypting.decrypting of a PDF document?

562 views
Skip to first unread message

darkdes...@gmail.com

unread,
Oct 27, 2014, 12:56:30 PM10/27/14
to pdf...@googlegroups.com
I'm not talking about simple password level locking, but the ability to create an encrypted document using a key and then opent/decrypt that ducument assuming that the appropriate keys are provided? I don't see anything in the API that is  obvious and the FoxIt documentation is totally lacking in this regard (even around password locking AFAICT).

Andrey Khalyavin

unread,
Oct 28, 2014, 7:46:46 AM10/28/14
to pdf...@googlegroups.com
I have seen crypto code (key generation in particular) in the source: core/src/fpdfapi/fpdf_parser/fpdf_parse_encrypt.cpp.

-- Andrey Khalyavin

darkdes...@gmail.com

unread,
Oct 28, 2014, 12:46:58 PM10/28/14
to pdf...@googlegroups.com
Yeah, it took a while but I think I figured out what needs to be done. I need to provide an instance of my own subclass of CPDF_SecurityHandler and possibly an instance of CPDF_CryptoHandler. Not so sure about that last since we use AES as well and the CPDF_StandardCryptoHandler already looks like a good generic AES encryption.

I think I just need to set my CPDF_SecurityHandler instance on the document parser before loading the document and everything should “just work”. The only issue I see is that there is no way to set the security handler to the document after the fact so I am not sure how to encrypt an unencrypted document just yet.

I've seen people on the list with a FoxIt email alias and if I could get any independent confirmation from one of them that this is the correct path that would be awesome.

Thanks,
Joe
Reply all
Reply to author
Forward
Message has been deleted
0 new messages