Hi, how did you verify that the signature is invalid? It might be the intended behavior if the verification means that you have e.g. a yellow exclamation mark in Adobe Acrobat. Why might that be correct? Well adding the first signature means the signature is applied with the state the PDF has as that point in time. Adding the second signature means adding additional content after the first signature was applied. This will be reflected in Acrobat by displaying the yellow exclamation mark. Inspecting the message in the signature dialog will say that after the signature was added changes were done to the PDF - which is correct.
In order to verify if there might be an issue could you please provide some additional information. With kind regards Maruan Am 04.03.2013 um 09:30 schrieb Thomas Chojecki <[email protected]>: > Am 21.02.2013 10:38, schrieb Vlad Mateescu: >> Hello, > Hi, > >> I'm trying to add two signatures with two different certificates in a PDF >> file but as soon as it adds the second one, the first signature becomes >> invalid. > Can you please try it again with the pdfbox trunk. There were done some fixes > in the last patch. I think your problem isn't related with the one shown in > PDFBOX-1370. The problem there is signing different pages and this cause that > one or more signatures would be invalid. > >> I started with the code provided at [1], modified here and there (I'm still >> able to sign the document once....or more times using the same >> certificate) and added a function for the second signature. I currently >> sign the document like this: > > Hmm, sounds for me like an cms issue not an pdf. But please send me one > sample and I try analyse it. > >> PDFSigner signer = new PDFSigner(input, output); >> signer.sign(keystore1, password1); >> signer.signR(keystore2, password2); >> signer.document.saveIncremental(.....); >> >> Thanks! > > I have to thank you for reporting that issue. > > Best regards > Thomas > >> >> >> [1] https://issues.apache.org/jira/browse/PDFBOX-1370

