# DigitalSignature Constructor

> Initializes a new instance of the DigitalSignature class.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Constructor
- **Introduced:** 17.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > DigitalSignature Constructor
- **969 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/digitalsignature/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/digitalsignature/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/digitalsignature/constructor/llms-full.txt

---

### 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.

```csharp
public DigitalSignature(X509Certificate2 x509, string timeServerURL);
```

```vbnet
Public Sub New(x509 As X509Certificate2, timeServerURL As String)
```

| Parameter | Description |
|---|---|
| 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](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/signaturefield/llms-full.txt).

```csharp
public DigitalSignature(X509Certificate2 x509, string timeServerURL, string signatureFieldName);
```

```vbnet
Public Sub New(x509 As X509Certificate2, timeServerURL As String, signatureFieldName As String)
```

| Parameter | Description |
|---|---|
| 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](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/signaturefield/llms-full.txt) 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](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/framebase/name-property/llms-full.txt) property. |

### Examples

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

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

```vbnet
Dim digitalSignature As New DigitalSignature(certificate, Nothing)
Dim saveSettings As New SaveSettings() With { .DigitalSignature = digitalSignature }
textControl.Save("signed-report.pdf", StreamType.AdobePDF, saveSettings)
```

---

## Nearby

- **Previous:** [DigitalSignature Class](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/digitalsignature/llms-full.txt)
- **Next:** [Direction Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/direction/enumeration/llms-full.txt)
