---
title: "Validate PDF signatures | Nutrient Python SDK"
canonical_url: "https://www.nutrient.io/guides/python/editor/validate-pdf-signatures/"
md_url: "https://www.nutrient.io/guides/python/editor/validate-pdf-signatures.md"
last_updated: "2026-11-20T00:00:00.000Z"
description: "Validate digital signatures in a PDF against trusted root certificates using Nutrient Python SDK."
---

# Validate PDF signatures

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 Python 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 validate the signatures of a PDF against a trusted root certificate and how to read the results.

Common use cases include:

- Checking signed contracts and invoices before processing them

- Rejecting documents that changed after they were signed

- Accepting only signatures from certification authorities your organization trusts

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

## How Nutrient helps

Nutrient Python SDK validates every signature of a document with one method call. For each signature, the SDK:

- 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, from the certificate revocation lists (CRLs) and Online Certificate Status Protocol (OCSP) responses the document embeds, or from the network

- Validates the signature timestamp, when the signature has one

- Validates document timestamps (PAdES B-LTA)

## Preparing the project

Import Nutrient Python SDK:

```python

from nutrient_sdk import Document, Signature, NutrientException
from nutrient_sdk import DigitalSignatureOptions
from nutrient_sdk import SignatureValidationOptions, SignatureRevocationMode
from nutrient_sdk import SignatureValidationIndication, SignatureValidationSubIndication

```

## Signing 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 baseline levels](https://www.nutrient.io/guides/python/editor/sign-pdf-with-pades-level.md) guide:

```python

def main():
    try:
        with Signature() as signer:
            with Document.open("input.pdf") as document:
                options = DigitalSignatureOptions()
                options.certificate_path = "certificate.pfx"
                options.certificate_password = "Nutrient answers all your document needs"
                options.signer_name = "Legal Department"
                options.reason = "Contract approval"
                signer.sign(document, "signed.pdf", options)

```

## Configuring 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 `add_trusted_certificate`, which takes the certificate as `bytes`: a DER-encoded certificate, a PKCS#7 certificate bundle, or PEM text with one or more certificates:

```python

            validation_options = SignatureValidationOptions()
            with open("root_ca_cert.pem", "rb") as root_file:
                validation_options.add_trusted_certificate(root_file.read())

            # The sample certificate authority publishes no revocation data.

            validation_options.revocation_mode = SignatureRevocationMode.NONE

```

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

- `EMBEDDED_ONLY` — Only the CRLs and OCSP responses the document embeds. No network access. This is the default.

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

- `ALWAYS_ONLINE` — 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 `CERTIFICATE_CHAIN_GENERAL_FAILURE`. 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 `ONLINE_IF_MISSING` for other documents.

The options also include the following settings:

- `validation_time` — The time to validate the signatures at, as an ISO 8601 string such as `"2026-01-31T12:00:00Z"`. The default is the current time.

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

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

## Validating the signatures

Open the signed document and pass it to `validate`, which returns one result per signed signature field. The sample prints each result and writes a short report:

```python

            with Document.open("signed.pdf") as signed_document:
                results = signer.validate(signed_document, validation_options)

            report = []
            for result in results:
                indication = SignatureValidationIndication(result.indication)
                sub_indication = SignatureValidationSubIndication(result.sub_indication)
                print(f"{result.field_name}: {indication.name} {sub_indication.name}")
                print(f"  Unchanged since signing: {result.is_integrity_valid}")
                print(f"  Certificate chain: {len(result.certificate_chain)} certificates")
                print(f"  Signer certificate: {len(result.signer_certificate)} bytes")
                if indication!= SignatureValidationIndication.TOTAL_PASSED:
                    print(f"  Reason: {result.message}")
                report.append(f"{result.field_name}: {indication.name} {sub_indication.name}")

            with open("validation-report.txt", "w", encoding="utf-8") as report_file:
                report_file.write("\n".join(report) + "\n")
    except NutrientException as e:
        print(f"Error: {e}")

if __name__ == "__main__":
    main()

```

The sample signature chains to the trusted root, so the sample prints `TOTAL_PASSED NONE`. The `indication` and `sub_indication` properties return the enumeration values as integers; the sample converts them to `SignatureValidationIndication` and `SignatureValidationSubIndication` members.

Each result has the following properties:

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

- `indication` and `sub_indication` — 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.

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

- `covers_whole_document` — 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.

- `signer_certificate` — The DER-encoded certificate of the signer, as `bytes`.

- `certificate_chain` — The signer’s certificate, its issuers, and the trusted certificate, each with its `certificate`, `is_trust_anchor`, `revocation_status`, `revocation_source`, and `revocation_time`.

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

- `best_signature_time` — The earliest time the signature is proven to exist, as an ISO 8601 string in UTC: the time of a valid signature timestamp, otherwise the validation time.

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

## Reading the results

The `indication` property reports one of three results:

| Indication      | Meaning                                                                                                                                                |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `TOTAL_PASSED`  | 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. |
| `TOTAL_FAILED`  | The signature is invalid. For example, `HASH_FAILURE` 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:

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

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

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

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

## Error handling

Nutrient Python SDK handles errors with exception handling. `validate` reports an invalid signature in its result, not as an exception. It raises a `NutrientException` when the validation fails to run — for example, when the document isn’t a PDF or when an option is invalid. `add_trusted_certificate` raises a `NutrientException` 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 opened from. Edits made to the document in memory aren’t validated.

## Conclusion

Use this workflow to validate the signatures of a PDF:

1. Create `SignatureValidationOptions` and add the root certificates you trust with `add_trusted_certificate`.

2. Set `revocation_mode` to match where the revocation data of your documents comes from.

3. Open the document using a [context manager](https://docs.python.org/3/reference/datamodel.html#context-managers) and call `validate` on a `Signature` instance.

4. Accept a signature only when its `indication` is `TOTAL_PASSED`, and use the sub-indication and message to diagnose the others.

For related signing workflows, refer to the [Python SDK guides](https://www.nutrient.io/guides/python.md).
---

## Related pages

- [Nutrient Python SDK editor guides](/guides/python/editor.md)
- [Adding annotations to a PDF document](/guides/python/editor/add-annotations-to-pdf.md)
- [Adding a custom page to a PDF document](/guides/python/editor/add-custom-page-to-pdf.md)
- [Adding interactive form fields to a PDF document](/guides/python/editor/add-form-fields-to-pdf.md)
- [Adding free text annotations to a PDF document](/guides/python/editor/add-freetext-annotations-to-pdf.md)
- [Adding invisible digital signatures to a PDF document](/guides/python/editor/add-invisible-signature-to-pdf.md)
- [Adding link annotations to a PDF document](/guides/python/editor/add-link-annotations-to-pdf.md)
- [Adding redaction annotations to a PDF document](/guides/python/editor/add-redaction-annotations-to-pdf.md)
- [Adding shape annotations to a PDF document](/guides/python/editor/add-shape-annotations-to-pdf.md)
- [Adding stamp annotations to a PDF document](/guides/python/editor/add-stamp-annotations-to-pdf.md)
- [Adding sticky note annotations to a PDF document](/guides/python/editor/add-sticky-note-annotations-to-pdf.md)
- [Adding text markup annotations to a PDF document](/guides/python/editor/add-text-markup-annotations-to-pdf.md)
- [Adding visible digital signatures to a PDF document](/guides/python/editor/add-visible-signature-to-pdf.md)
- [Advanced digital signature workflows](/guides/python/editor/advanced-digital-signatures.md)
- [Certifying PDF documents](/guides/python/editor/certify-a-pdf-document.md)
- [Deskewing PDF pages](/guides/python/editor/deskew-pdf-page.md)
- [Detecting and adding form fields to a PDF document](/guides/python/editor/detect-and-add-form-fields.md)
- [Editing PDF form fields](/guides/python/editor/editing-pdf-form-fields.md)
- [Editing PDF metadata with Nutrient Python SDK](/guides/python/editor/editing-pdf-metadata.md)
- [Filling PDF form fields](/guides/python/editor/fill-pdf-form.md)
- [Managing PDF page order](/guides/python/editor/manage-pdf-page-order.md)
- [Merging PDFs](/guides/python/editor/merge-pdf-into-other-pdf.md)
- [Signing PDFs with PAdES levels](/guides/python/editor/sign-pdf-with-pades-level.md)

