Which small java library should I use to sign PDF files within an applet?
We work with a software that has an applet that digitally signs PDF documents. This applet uses Itext to do this.
However, IText jar is kinda large (1.5Mb), and many of our users don't have a good connection. Because of this, the applet download takes a really long time to be completed sometimes.
So my question is: which alternatives other than IText can I use to digitally sign a PDF filewithin an applet? All the applet has to do is to sign a PDF, so no other features for PDF file are really necessary.
Thanks in advance!
You can unjar Itext and Bouncy Castle,remove the parts of the libs you do not use in your project to reduce size ,jar it and sign it back.
I believe that IText is using a third party open source library for encryption as part of the signing process of PDF documents. This library is called Bouncy Castle and consists in multiple jar files which total about 3Mb. These files also have to be downloaded in addition to the 1.5 Mb IText jar which makes the 1.5 Mb not too significant. It might be hard to find other smaller libraries that would do that with less than 1.5 Mb. We also have a library to sign PDF documents and it is about the same size as IText, it's called jPDFSecure and it is around 1.5 Mb also. Are you signing an existing field or adding a new signature? Maybe if you want to add only new digital signatures instead of signing existing digital signature, the code could be "thin out" but in any case, it would be hard to make it significantly smaller.
Have you asked on the Itext mailing list if you can leave bits out to reduce size?