Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Itext multiple signatures

I have to sign a pdf with multiple signatures. This is not done at the same time. So A signs the document and after 2 days, B signs the document and so on...

As stated in the Manning iText in Action and following code examples found on the web, to add a signature on a document which already contains signature(s), I just have to add two parameters when creating the signature:

stamper = PdfStamper.createSignature(this.pdfReader,
                    workingBaos, PdfWriter.VERSION_1_7, null, true);

null because I don't want to use a temporary file and true, to use the append mode and create a new revision.

The thing is that when I open the pdf, Acrobat Reader says that only the last signature is valid. The previous signatures are all invalid. When I verify the pdf with iText, there is no problem.

Am I missing anything?

like image 733
HowHigH Avatar asked Sep 26 '12 07:09

HowHigH


1 Answers

I'm the author of the book you're referring to. IMO the part about digital signatures in the book is too short, but the publisher wanted to keep the number of pages under 500 (and I managed to convince him to add about a 100 more).

If you want to add multiple signatures, please read this white paper: http://itextpdf.com/book/digitalsignatures This white paper is still under construction, but you can already find the code you need in the sections about 'signing documents in a workflow'.

For the sake of completeness: if you add an additional signature, you should create an instance of PdfStamper in append mode.

Update: when you say that iText verifies the PDF, you probably mean that iText tells you that the second signature is valid. I don't think iText can see the initial signature. If it does, let me know, and I'll look into it.

like image 130
Bruno Lowagie Avatar answered Sep 19 '22 10:09

Bruno Lowagie