 |
PdfCertificateStoreSigner Class |
Signs with a certificate from the system certificate store, found by its thumbprint - including a
certificate whose private key lives on a smart card or USB token registered by its middleware.
Inheritance HierarchySystemObject
SelectPdf.UniversalPdfCertificateStoreSigner
Namespace: SelectPdf.UniversalAssembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.5
Syntaxpublic sealed class PdfCertificateStoreSigner : IPdfExternalSigner,
IDisposable
Public NotInheritable Class PdfCertificateStoreSigner
Implements IPdfExternalSigner, IDisposable
The PdfCertificateStoreSigner type exposes the following members.
Constructors
Properties| | Name | Description |
|---|
 | Certificate |
Gets the signing certificate.
|
 | Certificates |
Gets the certificates embedded in the signature, each DER-encoded: the signing certificate
first, then the certificates of its issuers.
|
Top
Methods| | Name | Description |
|---|
 | Dispose |
Releases the certificate taken from the store. The signer can no longer sign afterwards, so
dispose of it after the documents it signs are saved. Calling it more than once does nothing.
|
 | Sign |
Signs the request with the certificate's private key.
|
Top
Remarks
The private key never leaves the store: the signature is made by the store's key provider, which
for a smart card or token is the device itself, and which asks for the PIN when the device requires
one. The issuer certificates are found the way the platform builds a certificate chain and are
embedded in the signature.
The certificate is looked up in the current user's store and then in the local machine's. RSA
(PKCS#1 v1.5) and ECDSA keys are supported.
Example
using var signer = new PdfCertificateStoreSigner(
"BABEA413778B70C92E266D2458E193BD6E62A6E3");
using PdfSecurityManager manager = new PdfSecurityManager();
manager.Load("contract.pdf");
manager.Sign(signer, "Signature1");
manager.Save("contract-signed.pdf");
Using signer As New PdfCertificateStoreSigner(
"BABEA413778B70C92E266D2458E193BD6E62A6E3"),
manager As New PdfSecurityManager()
manager.Load("contract.pdf")
manager.Sign(signer, "Signature1")
manager.Save("contract-signed.pdf")
End Using
See Also