Retrieve the timestamp from a signature

Hi.

Is there a way to retrieve the signature timestamp that was added with a Timestamper?

Thanks,
Fannar

Hi,

Yes, there is.

The following code snippet shows how to retrieve the timestamp token from the signature:

var desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
using (var document = PdfDocument.Load(Path.Combine(desktop, "PAdES B-T.pdf")))
{
    var signatureField = document.Form.Fields.OfType<PdfSignatureField>().First();

    var signature = signatureField.Value;

    var signatureContent = signature.Content;

    var timestampToken = signatureContent.TimestampToken;
}

The input file used in this code snippet is from the example PDF Advanced Electronic Signatures (PAdES) in C# and VB.NET .

Regards,
Stipo

Thanks. I actually found this out yesterday so now I get the generated time with BouncyCastle. :slight_smile: