Table of Contents

Class SystemCertificateStore

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

Certificate store backed by the operating system's certificate store (Windows Certificate Store, macOS Keychain, Linux NSS).

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

Constructors

SystemCertificateStore(StoreName, StoreLocation)

Opens the specified OS certificate store.

public SystemCertificateStore(StoreName storeName = StoreName.My, StoreLocation storeLocation = StoreLocation.CurrentUser)

Parameters

storeName StoreName

Store name. Default: My (Personal).

storeLocation StoreLocation

Store location. Default: CurrentUser.

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>