Click or drag to resize

CertificateStoreSigner Class

An IExternalSigner that signs with a certificate of the system certificate store - one whose key is in the store itself, or on a smart card or USB token whose middleware the store reaches.
Inheritance Hierarchy
SystemObject
  ExpertPdf.Anywhere.PDFSecurityCertificateStoreSigner

Namespace: ExpertPdf.Anywhere.PDFSecurity
Assembly: ExpertPdf.Anywhere (in ExpertPdf.Anywhere.dll) Version: 22.0
Syntax
public sealed class CertificateStoreSigner : IExternalSigner, 
	IDisposable

The CertificateStoreSigner type exposes the following members.

Constructors
 NameDescription
Public methodCertificateStoreSigner(String) Finds the certificate with the given thumbprint in the personal certificates store.
Public methodCertificateStoreSigner(String, CertSystemStore) Finds the certificate with the given thumbprint in the given certificates store.
Top
Properties
 NameDescription
Public propertyCertificate Gets the signing certificate.
Public propertyCertificates Gets the signing certificate and its issuers, each DER-encoded.
Top
Methods
 NameDescription
Public methodDispose Releases the certificate.
Public methodSign Signs the request's digest with the certificate's private key (RSA PKCS#1 v1.5, or ECDSA).
Top
Remarks

The certificate is found by its thumbprint in the current user's store, then in the local machine's, and must have a private key. A token's middleware asks for the PIN when the first signature is made. The issuer certificates are added from the system stores.

The certificate stays open until the signer is disposed. Signing happens when the document is saved, so dispose of the signer after the save.

Example
using (CertificateStoreSigner signer = new CertificateStoreSigner("3F8A...C2"))
{
    PdfSecurityManager manager = new PdfSecurityManager();
    manager.Sign("input.pdf", "signed.pdf", signer, "Signature1", "Approved", "Office", "",
        0, new RectangleF(40, 40, 220, 70), null);
}
See Also