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:
- Creating
PDDocument
andPDSignature
instance. - Adding appearance to the signature field as per my requirements.
- Configuring
PDSignature
with values likesub-filter
andsignDate
. - Adding
PDSignature
to thePDDocument
. - Generating Hash of the PDF and getting it signed.
- Using this signed digest for getting timestamp token and adding it as unsigned attribute.
- 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?