TX Text Control .NET Server

DigitalSignature Constructor

Constructor|Introduced in 17.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Initializes a new instance of the DigitalSignature class.

Syntax

DigitalSignature(X509Certificate2, string)

Initializes a new instance of the DigitalSignature class specifying a certificate and a time server.

public DigitalSignature(X509Certificate2 x509, string timeServerURL);
ParameterDescription
x509

Specifies an X509Certificate2 object which represents an X.509 certificate. This class can be found in the .net Framework in the namespace System.Security.Cryptography.

timeServerURL

Specifies the URL of a time server which is used to get a time stamp for the certification. If an empty string is specified, the current date and time on the computer is used.

DigitalSignature(X509Certificate2, string, string)

Initializes a new instance of the DigitalSignature class which is associated with a SignatureField.

public DigitalSignature(X509Certificate2 x509, string timeServerURL, string signatureFieldName);
ParameterDescription
x509

Specifies an X509Certificate2 object which represents an X.509 certificate. This class can be found in the .net Framework in the namespace System.Security.Cryptography.

timeServerURL

Specifies the URL of a time server which is used to get a time stamp for the certification. If an empty string is specified, the current date and time on the computer is used.

signatureFieldName

Specifies the name of a SignatureField contained in a document. The digital signature is associated with this field. The name can be specified with the signature field's constructor or its Name property.

Examples

The following example creates a PDF signature from an X.509 certificate supplied by secure certificate-loading code.

DigitalSignature digitalSignature = new(certificate, null);
SaveSettings saveSettings = new() { DigitalSignature = digitalSignature };
textControl.Save("signed-report.pdf", StreamType.AdobePDF, saveSettings);

Further Reading

  • Digitally Sign Adobe PDF Documents Using Simple Digital IDs –