I'm trying to add two different signatures (with two different certificates, obviously) in a PDF document, using PDFBox. Started with the code provided in this answer but whenever I add the second signature, it invalidates the first one.
I managed to do this easily with iText, as PdfStamper has the possibility to append extra elements, but I cannot use iText for this project, due to its new license.
Can anyone point me in the right direction? And if not, is there any other open source library that has the signing functionality?
Thanks!
EDIT: My problem isn't that I can't add the second signature, it's that the first one becomes invalid once the second one is applied.
Created a method for the second signature and I currently sign my document like this:
PDFSigner signer = new PDFSigner(input, output);
signer.sign(keystore1, password1);
signer.signR(keystore2, password2);
signer.document.saveIncremental(.....);