Inconsistent Signature Time using PDFBox

66 views Asked by At

I am working on adding signature timestamp support using external TSAs while digitally signing the PDF. I am using PDFBox for my signature implementation. My steps are:

  1. Creating PDDocument and PDSignature instance.
  2. Adding appearance to the signature field as per my requirements.
  3. Configuring PDSignature with values like sub-filter and signDate.
  4. Adding PDSignature to the PDDocument.
  5. Generating Hash of the PDF and getting it signed.
  6. Using this signed digest for getting timestamp token and adding it as unsigned attribute.
  7. Generating the output PDF.

I need to set date in signature appearance(in step 2) and also I need to set PDSignature.signDate in step 3. But I am getting timestamp token in step 6. As per my knowledge, I cannot modify PDSignature.signDate and date in signature appearance after step 6. As per my requirements, the signature time should be consistent for a PDF in unsigned attribute, PDSignature.signDate and in appearance of signature field.

Is there a way to make the signature time consistent in the entire signed PDF?

0

There are 0 answers