I am (successfully) signing a PDF with a .p12 certificate.
The problem is, that after signing the pdf, the file cannot be modified anymore.
I know that any modification to the pdf breaks the signature but i still want to allow modifications so the client can do modifications and edit text.
Heres my minimal reproduction of my valid signature ( I started with the CreateSignature Example of Apache PDfBox):
public void signDetached(PDDocument document, OutputStream output)
throws IOException {
PDSignature signature = new PDSignature();
signature.setFilter(PDSignature.FILTER_ADOBE_PPKLITE);
signature.setSubFilter(PDSignature.SUBFILTER_ADBE_PKCS7_DETACHED);
signature.setName("Testing User");
signature.setLocation("Los Angeles, CA");
signature.setReason("Testing");
signature.setSignDate(Calendar.getInstance());
document.addSignature(signature, this);
document.saveIncremental(output);
}
This code adds a digital signature dictionary to the PDF, but it doesn't seem to create an approval signature that allows for further modifications to the document.
What am I doing wrong here? Is it possible to create a non-visible approval signature with Apache PDFBox that allows for modifications and becomes invalidated when those modifications occur?
Thank you in advance for any help or insights you can provide!