I am trying to achieve PAdES digital signature with an embedded timestamp for a .pdf document. Namely, what I'm trying to achieve:
DDS with an embedded timestamp
I'm using a trusted provider (TSP; external party) that performs the DDS and therefore I do not have access to the private key (.pfx cert) that the TSP uses to sign the message digest. I have been using the .NET class library from GemBox and have managed to successfully add the digital signature to a .pdf file using the function:
Gembox.Pdf.Form.PdfSignature Sign(Func<Stream, byte[]> signer, PdfSignatureFormat signatureFormat, int estimatedSignatureContentsLength)
I pass in for the argument "signer" (see the above function) another function that simply calls an endpoint from the TSP provider which returns the mobile signature (as a byte[]). Then the signature gets successfully added the .pdf file (using GemBox's signature process):
DDS with no embeeded timestamp
Now I am in need of adding an embedded timestamp to the signature and I'm not sure how to achieve that since the DDS came from an external party. All code examples I've come across assume that you have the .pfx certificate, i.e. that the DDS is performed along with the timestamp (see e.g. here), and in my case I would then have to make a requirement to my TSP to provide me with a DDS that includes a timestamp from a trusted provider.
I hope someone can point me in the right direction here and explain to me if this is actually possible, i.e. to add an embedded timestamp when the DDS is being populated from an external party. Please notice, I'm open to explore other .NET libraries, i.e. other than GemBox if needed. However, I have found that library to be very useful for other purposes as well.
Thanks in advance!