Table of Contents

Constructor PdfPublicKeyDecryptionHandler

Namespace
BitMiracle.Docotic.Pdf
Assembly
BitMiracle.Docotic.Pdf.dll

PdfPublicKeyDecryptionHandler(X509Certificate2)

Creates a new decryption handler with the specified certificate.

public PdfPublicKeyDecryptionHandler(X509Certificate2 certificate)

Parameters

certificate X509Certificate2

The certificate to use to decrypt a document.

Remarks

The certificate must be marked exportable. If it is not, then an instance of PdfException will be thrown.

To decrypt a document, the certificate should match a recipient specified in the document recipients collection. If the certificate does not match a recipient, an instance of CannotDecryptPdfException will be thrown later when the handler is used to decrypt a document.

The permissions for the decrypted document might vary, depending on the certificate.

PdfPublicKeyDecryptionHandler(string, string)

Creates a new decryption handler using the specified key store file.

public PdfPublicKeyDecryptionHandler(string keyStorePath, string password)

Parameters

keyStorePath string

The path to the PFX / PKCS #12 key store file.

password string

The password to read the key store file.

Remarks

PFX files are expected to have .pfx extension. PKCS #12 files are expected to have .p12 extension.

To decrypt a document, a certificate in the key store should match a recipient specified in the document recipients collection. If there are no matching certificates in the key store, an instance of CannotDecryptPdfException will be thrown later when the handler is used to decrypt a document.

The permissions for the decrypted document might vary, depending on the matching certificate.

PdfPublicKeyDecryptionHandler(Stream, string)

Creates a new decryption handler using the specified stream with key store contents.

public PdfPublicKeyDecryptionHandler(Stream keyStoreStream, string password)

Parameters

keyStoreStream Stream

The stream with the PFX / PKCS #12 key store contents.

password string

The password to read the key store stream.

Remarks

PFX files are expected to have .pfx extension. PKCS #12 files are expected to have .p12 extension.

To decrypt a document, a certificate in the key store should match a recipient specified in the document recipients collection. If there are no matching certificates in the key store, an instance of CannotDecryptPdfException will be thrown later when the handler is used to decrypt a document.

The permissions for the decrypted document might vary, depending on the matching certificate.

PdfPublicKeyDecryptionHandler(X509Store)

Creates a new decryption handler with the specified certificate store.

public PdfPublicKeyDecryptionHandler(X509Store store)

Parameters

store X509Store

The certificate store to use to decrypt a document.

Remarks

When trying to decrypt a document, the library looks for a matching certificate in the specified certificate store. The first matching certificate will be used. In case there are no matching certificates in certificate store, an instance of CannotDecryptPdfException will be thrown when the handler is used to decrypt a document.

Any certificate not marked as exportable is ignored during the search for a matching certificate.

The permissions for the decrypted document might vary, depending on the matching certificate.

PdfPublicKeyDecryptionHandler()

Creates a new decryption handler with the X.509 certificate store used by the current user.

public PdfPublicKeyDecryptionHandler()

Remarks

When trying to decrypt a document, the library looks for a matching certificate in the X.509 certificate store used by the current user. The first matching certificate will be used. In case there are no matching certificates in certificate store, an instance of CannotDecryptPdfException will be thrown when the handler is used to decrypt a document.

Any certificate not marked as exportable is ignored during the search for a matching certificate.

The permissions for the decrypted document might vary, depending on the matching certificate.