How do I create and sign a digital signature with LTV?

Question:
I want to be able to add a Digital Signature to a PDF and sign it using Time Stamp, using a Time Stamp Authority (TSA) server, and enable Long Term Validation (LTV).

How can I do that?

Answer:
The attached C# code shows how to accomplish this.

DigitalSignaturesTest.cs.txt (5.6 KB)