Click or drag to resize
Pdf Library for .NET

PdfDigitalCertificatesStore Class

Provides an interface for getting digital certificates from the system certificates store or from a password protected PKCS#12 file.
Inheritance Hierarchy
SystemObject
  SelectPdf.UniversalPdfDigitalCertificatesStore

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public class PdfDigitalCertificatesStore

The PdfDigitalCertificatesStore type exposes the following members.

Constructors
Methods
 NameDescription
Public methodStatic memberGetCertificates Gets the certificates collection from the Personal Certificates store.
Public methodStatic memberGetCertificates(PdfCertificateSystem) Gets the certificates collection from the specified system certificates store.
Public methodStatic memberGetCertificates(String) Gets the certificates collection from the specified PKCS#12 file, using a null password.
Public methodStatic memberGetCertificates(String, String) Gets the certificates collection from the specified password protected PKCS#12 file.
Top
Remarks
A PKCS#12 file stores both the private and the public keys and such a file can be for example a file with extension .pfx generated from an SSL certificate.
Example
// Load a signing certificate from a password-protected PFX file
PdfDigitalCertificatesCollection certs =
    PdfDigitalCertificatesStore.GetCertificates(@"C:\certs\signer.pfx", "secret");
// A .pfx usually carries the signing certificate AND its issuing chain.
// The certificates that can sign come first, so certs[0] is the one to sign
// with; name it when you can.
PdfDigitalCertificate cert = certs.GetCertBySubject("Your Company") ?? certs[0];

// Or read the current user's Personal certificates store
PdfDigitalCertificatesCollection personal =
    PdfDigitalCertificatesStore.GetCertificates();
See Also