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
X509Certificate2The 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.
The Decrypt PDF documents in C# and VB.NET article describes how to process encrypted PDF documents.
PdfPublicKeyDecryptionHandler(string, string)
Creates a new decryption handler using the specified key store file.
public PdfPublicKeyDecryptionHandler(string keyStorePath, string password)
Parameters
keyStorePath
stringThe path to the PFX / PKCS #12 key store file.
password
stringThe 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.
The Decrypt PDF documents in C# and VB.NET article contains examples of using this constructor.
PdfPublicKeyDecryptionHandler(Stream, string)
Creates a new decryption handler using the specified stream with key store contents.
public PdfPublicKeyDecryptionHandler(Stream keyStoreStream, string password)
Parameters
keyStoreStream
StreamThe stream with the PFX / PKCS #12 key store contents.
password
stringThe 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.
The Decrypt PDF documents in C# and VB.NET article describes how to process encrypted PDF documents.
PdfPublicKeyDecryptionHandler(X509Store)
Creates a new decryption handler with the specified certificate store.
public PdfPublicKeyDecryptionHandler(X509Store store)
Parameters
store
X509StoreThe 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.
The Decrypt PDF documents in C# and VB.NET article describes how to process encrypted PDF documents.
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.
The Decrypt PDF documents in C# and VB.NET article describes how to process encrypted PDF documents.