Table of Contents

Class FileCertificateStore

Namespace
SimpleSign.Core.Crypto
Assembly
SimpleSign.Core.dll

Certificate store backed by PKCS#12 (.pfx/.p12) files in a directory.

public sealed class FileCertificateStore : ICertificateStore, IDisposable
Inheritance
FileCertificateStore
Implements
Inherited Members

Constructors

FileCertificateStore(string, string?)

Creates a certificate store from a single PKCS#12 file.

public FileCertificateStore(string pfxPath, string? password)

Parameters

pfxPath string

Path to the .pfx or .p12 file.

password string

Password for the file.

FileCertificateStore(string, string?, string)

Creates a certificate store from all PKCS#12 files in a directory.

public FileCertificateStore(string directoryPath, string? password, string searchPattern)

Parameters

directoryPath string

Directory containing .pfx/.p12 files.

password string

Password for all files (or null).

searchPattern string

File search pattern. Default: "*.pfx".

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

FindBySubject(string)

Finds all certificates matching a subject name (partial match).

public IReadOnlyList<X509Certificate2> FindBySubject(string subjectName)

Parameters

subjectName string

Subject CN or partial match.

Returns

IReadOnlyList<X509Certificate2>

Matching certificates.

FindByThumbprint(string)

Finds a certificate by SHA-1 thumbprint (hex string).

public X509Certificate2? FindByThumbprint(string thumbprint)

Parameters

thumbprint string

SHA-1 thumbprint, case-insensitive.

Returns

X509Certificate2

The certificate, or null if not found.

ListAll()

Lists all certificates in the store.

public IReadOnlyList<X509Certificate2> ListAll()

Returns

IReadOnlyList<X509Certificate2>