---
title: "Validate PDF signatures in C# | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/signatures/digital-signatures/validate-pdf-signatures/"
md_url: "https://www.nutrient.io/guides/dotnet/signatures/digital-signatures/validate-pdf-signatures.md"
last_updated: "2026-11-20T00:00:00.000Z"
description: "Learn how to validate digital signatures in a PDF against trusted root certificates using Nutrient .NET SDK."
---

# Validate PDF signatures in C#

Signature validation tells you whether a signed PDF is trustworthy: whether the signed content is unchanged since signing, and whether the signer’s certificate chains to a certificate you trust and wasn’t revoked when the document was signed. Nutrient.NET SDK validates each signature as defined by ETSI EN 319 102-1, the European standard for signature validation, and reports one of its three results: passed, failed, or indeterminate.

This guide shows how to:

- Sign a sample PDF with a P12/PFX certificate

- Validate the signatures of the PDF against a trusted root certificate

- Read the validation results

For each signature, the validation checks that the signed bytes match the signature, builds the signer’s certificate chain to one of the certificates you trust, checks the revocation status of each certificate in the chain, and validates the signature timestamp, when the signature has one. It also validates document timestamps (PAdES B-LTA).

[Download sample](https://www.nutrient.io/downloads/samples/gdpicture/validate-pdf-signatures.zip)

## 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 System.Collections.Generic;
using System.IO;
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

```

## Sign a sample PDF

The sample signs `input.pdf` first, so it has a signed document to validate. The sample certificate, `certificate.pfx`, is issued by the sample root certificate authority, `root_ca_cert.pem`. For more information on signing, refer to the [PAdES B-LT and B-LTA signatures](https://www.nutrient.io/guides/dotnet/signatures/digital-signatures/create-pades-b-lt-and-b-lta-signatures.md) guide.

```csharp

using (GdPicturePDF pdf = new GdPicturePDF())
{
    CheckStatus(pdf.LoadFromFile(@"input.pdf", false), "LoadFromFile");
    CheckStatus(pdf.SetSignatureCertificateFromP12(@"certificate.pfx", "Nutrient answers all your document needs"), "SetSignatureCertificateFromP12");
    CheckStatus(pdf.SetSignatureInfo("Legal Department", "Contract approval", "Toulouse", "sales@nutrient.io"), "SetSignatureInfo");
    CheckStatus(pdf.ApplySignature(@"signed.pdf", PdfSignatureMode.PdfSignatureModeAdobeCADES, true), "ApplySignature");
}

```

## Configure the validation

A signature passes validation only when the signer’s certificate chains to a certificate you trust. No certificate is trusted by default. Add the root certificates of the certification authorities you accept with `AddTrustedCertificate`, which takes a DER-encoded certificate, a PKCS#7 certificate bundle, or PEM text with one or more certificates:

```csharp

PdfSignatureValidationOptions options = new PdfSignatureValidationOptions();
CheckStatus(options.AddTrustedCertificate(File.ReadAllBytes(@"root_ca_cert.pem")), "AddTrustedCertificate");

// The sample certificate authority publishes no revocation data.
options.RevocationMode = PdfSignatureRevocationMode.None;

```

The `RevocationMode` property sets where the revocation status of the certificates comes from:

- `EmbeddedOnly` — Only the certificate revocation lists (CRLs) and Online Certificate Status Protocol (OCSP) responses the document embeds. No network access. This is the default.

- `OnlineIfMissing` — The embedded data first, then the certificate’s OCSP responder or CRL distribution points for each certificate the embedded data doesn’t cover.

- `AlwaysOnline` — The certificate’s OCSP responder or CRL distribution points for every certificate, together with the embedded data.

- `None` — Revocation isn’t checked.

The sample uses `None` because its certificate authority publishes no revocation data: with any other mode, its signature is reported as `Indeterminate` with `CertificateChainGeneralFailure`. For certificates from a public certification authority, keep the default for documents signed at PAdES B-LT or higher, which embed their revocation data. Use `OnlineIfMissing` for other documents.

The options also include the following settings:

- `ValidationTime` — The time to validate the signatures at. The default is `null`, which validates at the current time.

- `NetworkTimeout` — The time one network request takes at most, in milliseconds. The default is 30000.

- `AddIntermediateCertificate` — Adds certificates that complete a chain between the signer and a trusted certificate when neither the document nor the signature includes them.

## Validate the signatures

Load the signed document and validate each of its signatures with `ValidateSignature`. The signature index ranges from 0 to `GetSignatureCount` minus 1. The sample prints each result and writes a short report:

```csharp

using GdPicturePDF signedPdf = new GdPicturePDF();
CheckStatus(signedPdf.LoadFromFile(@"signed.pdf", false), "LoadFromFile");

int signatureCount = signedPdf.GetSignatureCount();
CheckStatus(signedPdf.GetStat(), "GetSignatureCount");

List<string> report = new List<string>();
for (int index = 0; index < signatureCount; index++)
{
    GdPictureStatus status = signedPdf.ValidateSignature(index, options, out PdfSignatureValidationResult result);
    if (status == GdPictureStatus.PdfInvalidContent)
    {
        // A signature field that isn't signed.
        continue;
    }
    CheckStatus(status, "ValidateSignature");

    string line = $"{result.FieldName}: {result.Indication} {result.SubIndication}";
    Console.WriteLine(line);
    Console.WriteLine($"  Unchanged since signing: {result.IsIntegrityValid}");
    Console.WriteLine($"  Certificate chain: {result.CertificateChain.Length} certificates");
    if (result.Indication!= PdfSignatureValidationIndication.TotalPassed)
    {
        Console.WriteLine($"  Reason: {result.Message}");
    }
    report.Add(line);
}

File.WriteAllLines(@"validation-report.txt", report);

```

The sample signature chains to the trusted root, so the sample prints `TotalPassed None`. `ValidateSignature` returns `GdPictureStatus.OK` when the validation ran, whatever its result: read the result’s `Indication` to know whether the signature is valid.

Each result has the following properties:

- `FieldName` — The name of the signature field.

- `Indication` and `SubIndication` — The result of the validation, and the reason when it didn’t pass.

- `Message` — A description of the problem found. Empty when the validation passed.

- `IsIntegrityValid` — Whether the signed bytes match the signature.

- `CoversWholeDocument` — Whether the signature covers the whole document. It’s `false` when content was added after signing, for example a later signature or the validation data of a PAdES B-LT signature.

- `SignerCertificate` — The DER-encoded certificate of the signer.

- `CertificateChain` — The signer’s certificate, its issuers, and the trusted certificate, each with its `Certificate`, `IsTrustAnchor`, `RevocationStatus`, `RevocationSource`, and `RevocationTime`.

- `Timestamp` — The validation of the signature timestamp, or `null` when the signature has no timestamp.

- `BestSignatureTime` — The earliest time, in UTC, the signature is proven to exist: the time of a valid signature timestamp, otherwise the validation time.

- `IsDocumentTimestamp` — Whether the result is for a document timestamp rather than a signature.

To get the signer’s certificate without validating the signature, use `GetSignatureCertificate`.

## Read the results

The `Indication` property reports one of three results:

| Indication      | Meaning                                                                                                                                                |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `TotalPassed`   | The signature is intact, and the signer’s certificate chains to a trusted certificate and wasn’t revoked at the time the signature is proven to exist. |
| `TotalFailed`   | The signature is invalid. For example, `HashFailure` means the document changed after signing.                                                         |
| `Indeterminate` | The available data doesn’t establish whether the signature is valid. The sub-indication tells you what’s missing.                                      |

The most common sub-indications for an `Indeterminate` result are:

- `NoCertificateChainFound` — No chain leads from the signer’s certificate to a trusted certificate. Add the root certificate of the signer’s certification authority.

- `CertificateChainGeneralFailure` — No usable revocation data covers a certificate of the chain. Use `OnlineIfMissing`, or ask the signer for a PAdES B-LT signature.

- `OutOfBoundsNoPoe` — The signer’s certificate expired, and no signature timestamp proves the signature existed before then.

- `RevokedNoPoe` — The signer’s certificate was revoked, and no signature timestamp proves the signature existed before the revocation.

## Error handling

Check every `GdPictureStatus` value. `ValidateSignature` returns `GdPictureStatus.PdfInvalidContent` for a signature field that isn’t signed, and `AddTrustedCertificate` returns `GdPictureStatus.CertificateWrongFormat` when the data holds no certificate.

## Limitations

- Only the certificates you add are trusted. The system certificate store and the European Union Trusted List (EUTL) aren’t used.

- A document timestamp is validated, but it isn’t used as proof that the signatures it covers existed before it.

- The validation reads the bytes the document was loaded from. Changes made to the loaded document aren’t validated.

## Conclusion

This workflow validates the signatures of a PDF against the certificates you trust. Accept a signature only when its indication is `TotalPassed`, and use the sub-indication and message to diagnose the others. To make signatures that stay verifiable after the signer’s certificate expires, refer to the [add LTV information to PDF signatures](https://www.nutrient.io/guides/dotnet/signatures/digital-signatures/add-ltv-information-to-pdf-signatures.md) guide.
---

## Related pages

- [Sign a PDF in C# with a digital signature](/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 an ECDSA certificate in C#](/guides/dotnet/signatures/digital-signatures/sign-pdf-with-ecdsa-certificate.md)
- [Sign a PDF with PKCS#11 in C#](/guides/dotnet/signatures/digital-signatures/sign-pdf-with-pkcs11.md)

