---
title: "Sign a PDF with an ECDSA certificate in C# | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/signatures/digital-signatures/sign-pdf-with-ecdsa-certificate/"
md_url: "https://www.nutrient.io/guides/dotnet/signatures/digital-signatures/sign-pdf-with-ecdsa-certificate.md"
last_updated: "2026-09-22T00:00:00.000Z"
description: "Learn how to sign PDF documents with ECDSA certificates using Nutrient .NET SDK."
---

# Sign a PDF with an ECDSA certificate in C#

Elliptic Curve Digital Signature Algorithm (ECDSA) certificates create compact digital signatures with elliptic-curve keys. Nutrient.NET SDK supports ECDSA signing certificates in PDF signing workflows.

Use this workflow when your certificate authority or enterprise policy issues ECDSA document-signing certificates.

This guide shows how to:

- Load an ECDSA certificate from a P12/PFX file

- Configure PDF signature metadata

- Sign a PDF with the ECDSA certificate

This sample expects an ECDSA P12/PFX file named `ecdsa-certificate.pfx`. The repository sample certificate is RSA-based, so replace it with an ECDSA certificate before running this sample.

## Prepare the project

Register the SDK license before running signing operations. For setup details, refer to the [getting started with.NET SDK](https://www.nutrient.io/sdk/dotnet/getting-started.md) guide.

```csharp

using System;
using GdPicture14;

void CheckStatus(GdPictureStatus status, string operation)
{
    if (status!= GdPictureStatus.OK)
    {
        throw new InvalidOperationException($"{operation} failed. Status: {status}");
    }
}

LicenseManager license = new LicenseManager();
license.RegisterKEY(""); // Set your license key

```

## Load the PDF document

Create a `GdPicturePDF` instance and load the source file:

```csharp

using GdPicturePDF pdf = new GdPicturePDF();

CheckStatus(pdf.LoadFromFile(@"input.pdf", false), "LoadFromFile");

```

## Configure the ECDSA certificate

Load the ECDSA certificate and private key from a P12/PFX file:

```csharp

CheckStatus(pdf.SetSignatureCertificateFromP12(@"ecdsa-certificate.pfx", "changeit"), "SetSignatureCertificateFromP12");

```

The certificate has to include an ECDSA private key and key usages suitable for document signing.

## Configure signature metadata and options

Set signature metadata, hash algorithm, and PAdES baseline level:

```csharp

CheckStatus(pdf.SetSignatureInfo("Nutrient", "ECDSA PDF signature", "Toulouse", "sales@nutrient.io"), "SetSignatureInfo");
CheckStatus(pdf.SetSignatureHash(PdfSignatureHash.SHA256), "SetSignatureHash");
CheckStatus(pdf.SetSignaturePAdESLevel(PdfSignaturePAdESLevel.PAdESBaselineB), "SetSignaturePAdESLevel");

```

## Apply the ECDSA signature

Create the signed PDF:

```csharp

CheckStatus(pdf.ApplySignature(@"signed-ecdsa.pdf", PdfSignatureMode.PdfSignatureModeAdobeCADES, true), "ApplySignature");

```

The SDK detects the ECDSA private key from the certificate and writes the signature in the form required for CMS/PAdES.

## Error handling

Check every `GdPictureStatus` value. Certificate errors usually indicate an incorrect password, a missing private key, unsupported key usage, or a certificate that doesn't use an ECDSA key.

## Conclusion

This workflow signs a PDF with an ECDSA certificate loaded from a P12/PFX file.
---

## Related pages

- [Add a digital signature to a PDF in C#](/guides/dotnet/signatures/digital-signatures/add-a-digital-signature.md)
- [Add a document timestamp to a PDF in C#](/guides/dotnet/signatures/digital-signatures/add-document-timestamp-to-pdf.md)
- [Add LTV information to PDF signatures in C#](/guides/dotnet/signatures/digital-signatures/add-ltv-information-to-pdf-signatures.md)
- [Sign PDF documents with a certificate in C#](/guides/dotnet/signatures/digital-signatures/certify-a-document.md)
- [Create PAdES B-LT and B-LTA signatures in C#](/guides/dotnet/signatures/digital-signatures/create-pades-b-lt-and-b-lta-signatures.md)
- [Deferred two-phase PDF signing in C#](/guides/dotnet/signatures/digital-signatures/deferred-two-phase-pdf-signing.md)
- [Create a self-signed certificate with PADES extensions](/guides/dotnet/signatures/digital-signatures/sign-a-docx-as-pdf-ua.md)
- [Create a self-signed certificate with PADES extensions](/guides/dotnet/signatures/digital-signatures/sign-a-pdf-ua-document.md)
- [Sign a PDF with PKCS#11 in C#](/guides/dotnet/signatures/digital-signatures/sign-pdf-with-pkcs11.md)

