I have a original PDF document and separate file as PKCS#7 signed data. I would like to combine these to create signed PDF document so that it could be shown in for example Adobe reader that it is signed and who signed the document.
Are there any libraries in Java that could be used to create such signed PDF document programatically? I need to load that PDF and add the signature to it somehow, then save it as a new PDF document.
Sample code would be appreciated.
EDIT:
The resulting code should take the PDF document as input parameter and do the following:
- prepare data to be signed
- provide data to be signed to external signing mechanism that produces PKCS#7 signed data file
- provide PKCS#7 signed data file
- add signed data to PDF document
- save PDF document
As I understand the first step is important because without that the PKCS#7 signed data would be wrong.