All docs
V20.1
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Pkcs7Signer Class

Allows you to create PKCS#7 signatures.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v20.1.Core.dll

Declaration

public class Pkcs7Signer :
    Pkcs7SignerBase
Public Class Pkcs7Signer
    Inherits Pkcs7SignerBase

Remarks

Use a Pkcs7Signer object to create a PKCS#7 signature.

Specify a certificate and a password to create a signature. The PDF Document API supports .pfx files with an X.509 certificate.

You can also specify the signature's hash algorithm. PDF Document API supports SHA1, SHA256, SHA384 and SHA512 algorithm types.

NOTE

The SHA1 hash type may affect the signature's integrity, authenticity, and legal validity.

The code sample below shows how to create a PKCS#7 signature:

Pkcs7Signer pkcs7Signature = new Pkcs7Signer("Signing Documents//testcert.pfx", "123", PdfHashAlgorithm.SHA256);

Use the PdfTsaClient object to create a timestamp for a signature. You can create a ITsaClient implementation to use a custom timestamp client.

The code sample below shows how to create a signature with a timestamp:

ITsaClient tsaClient = new PdfTsaClient(new Uri(@"https://freetsa.org/tsr"), PdfHashAlgorithm.SHA256);
Pkcs7Signer pkcs7Signature = new Pkcs7Signer("Signing Documents//testcert.pfx", "123", PdfHashAlgorithm.SHA256, tsaClient);

Pass the Pkcs7Signer object to the PdfSignatureBuilder object constructor to apply a PKCS#7 signature to the form field.

TIP

You can use the Pkcs7Signer object when you use PdfDocumentProcessor to sign a document. Refer to the How to: Use PdfDocumentProcessor to Add a Visual Signature to a Document article for a code sample. Note that this approach has limitations.

Inheritance

See Also