PdfTimeStamp Class
Allows you to generate document-level timestamps.
Namespace: DevExpress.Pdf
Assembly: DevExpress.Pdf.v24.2.Core.dll
NuGet Package: DevExpress.Pdf.Core
Declaration
Remarks
The PdfTimeStamp is the default IExternalSigner interface implementation. Use this class to generate document-level timestamps.
The TsaClient class allows you to specify the timestamp client. You can create an ITsaClient implementation to use your own timestamp client.
The code sample below creates a document-level timestamp and applies it to a signature form field. The FreeTSA server is used for demonstration purposes as a free trusted TSA client. You may wish to use another client as required.
using DevExpress.Pdf;
using DevExpress.Office.DigitalSignatures;
using DevExpress.Office.Tsp;
using (var signer = new PdfDocumentSigner("Document.pdf"))
{
// Create a timestamp:
ITsaClient tsaClient = new TsaClient(new Uri(@"https://freetsa.org/tsr"), HashAlgorithmType.SHA256);
// Create a new signature form field:
var signatureFieldInfo1 = new PdfSignatureFieldInfo(1);
signatureFieldInfo1.Name = "SignatureField1";
signatureFieldInfo1.SignatureBounds = new PdfRectangle(200, 200, 250, 250);
// Create a document-level timestamp:
PdfTimeStamp pdfTimeStamp = new PdfTimeStamp(tsaClient);
// Apply this timestamp to the form field:
var timeStampSignature = new PdfSignatureBuilder(pdfTimeStamp, signatureFieldInfo1);
// Sign and save the document:
signer.SaveDocument("SignedDocument.pdf", timeStampSignature);
}
Implements
Inheritance
Object
PdfTimeStamp
See Also