> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/uwp/digital-signature/signature/verify-pdf.md).

# Verify a signature in UWP

We offer a higher-level document-based API for verifying signatures, as well as a lower-level per-signature API. Page includes code samples.

Try our [web demo](https://sdk.apryse.com/samples/web/samples/full-apis/ViewerDigitalSignatureValidationTest/) for digital signature verification.

We offer a higher-level document-based API for verifying signatures, as well as a lower-level per-signature API.

The simple document API has the following possible return values:

1. PDFDoc.SignaturesVerificationStatus.e\_unsigned: document has no signed signature fields.
2. PDFDoc.SignaturesVerificationStatus.e\_failure: hard failure in verification on at least one signature. This does not include trust issues, because those are flaky due to being network/config-related.
3. PDFDoc.SignaturesVerificationStatus.e\_untrusted: could not verify trust for at least one signature. This code can often be avoided by changing your VerificationOptions (add trusted certificates, enable a different revocation checking mode, etc.).
4. PDFDoc.SignaturesVerificationStatus.e\_unsupported: at least one signature contains features not supported in the current version of the SDK. Please contact us if these features are important to you.
5. PDFDoc.SignaturesVerificationStatus.e\_verified: all signed signatures in document verified. Unsigned signatures get skipped. Parts of the document may be unsigned by any signature.

For further verification-related information, the detailed API, which returns a VerificationResult and is demonstrated in the full code samples, can be used. For example, it is possible to call GetUnsupportedFeatures on VerificationResult to check which unsupported features were encountered (requires verification using 'detailed' APIs). It is also possible to retrieve a DigitalSignatureField object from the VerificationResult for further non-verification-related information. For example, if you would like to make sure that the document is entirely covered by signatures, or to look at a previous revision, the function GetByteRanges is available on DigitalSignatureField for this purpose.

To verify all cryptographic digital signatures in a document using the simple API:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
using (PDFDoc doc = new PDFDoc(in_docpath))
{
	// Choose a security level to use, and change any verification options you wish to change
	VerificationOptions opts = new VerificationOptions(VerificationOptions.SignatureVerificationSecurityLevel.e_compatibility_and_archiving);

	// Add trust root to store of trusted certificates contained in VerificationOptions.
	opts.AddTrustedCertificate(in_public_key_file_path);

	PDFDoc.SignaturesVerificationStatus result = doc.VerifySignedDigitalSignatures(opts);
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

[Digital signatures](/uwp/get-started/samples.md#digitalsignatures) Full code sample which demonstrates using the digital signature API to digitally sign, certify, and/or verify PDF documents.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/uwp/digital-signature/signature/verify-pdf.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
