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
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
directoryPathstringDirectory containing .pfx/.p12 files.
passwordstringPassword for all files (or null).
searchPatternstringFile 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
subjectNamestringSubject 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
thumbprintstringSHA-1 thumbprint, case-insensitive.
Returns
- X509Certificate2
The certificate, or null if not found.
ListAll()
Lists all certificates in the store.
public IReadOnlyList<X509Certificate2> ListAll()