- Create and Verify Digital Signatures using .NET Digital Signature Library
- .NET Digital Signature Library Code Samples
- Download .NET Digital Signature Library with all samples
void AddTimestampSignatureToPdf(string unsignedDoc, string stampedDoc)
{
PdfSignature ps = new PdfSignature("");
//load the PDF document
ps.LoadPdfDocument(unsignedDoc);
ps.TimeStamping.ServerUrl = new Uri("https://ca.signfiles.com/TSAServer.aspx");
ps.TimeStamping.UserName = "your_username";
ps.TimeStamping.Password = "your_password";
ps.TimeStamping.HashAlgorithm = SignLib.HashAlgorithm.SHA256;
//write the timestamped PDF file
File.WriteAllBytes(stampedDoc, ps.ApplyTimestampSignature());
}
See also: