Table of Contents

Class CertificateChainService

Namespace
SimpleSign.Core.Validation
Assembly
SimpleSign.Core.dll

Default implementation of ICertificateChainService.

public sealed class CertificateChainService : ICertificateChainService
Inheritance
CertificateChainService
Implements
Inherited Members

Methods

DownloadAiaCertsAsync(HttpClient, X509Certificate2, IReadOnlyList<X509Certificate2>?, List<string>, CancellationToken)

Downloads intermediate certificates via AIA (Authority Information Access) using iterative BFS so that each downloaded intermediate's own AIA is also chased.

public Task<List<X509Certificate2>> DownloadAiaCertsAsync(HttpClient httpClient, X509Certificate2 cert, IReadOnlyList<X509Certificate2>? extraCerts, List<string> warnings, CancellationToken ct)

Parameters

httpClient HttpClient
cert X509Certificate2
extraCerts IReadOnlyList<X509Certificate2>
warnings List<string>
ct CancellationToken

Returns

Task<List<X509Certificate2>>

LoadCertsFromBytes(byte[], ILogger?)

Loads one or more X509 certificates from raw bytes (DER, PEM, PKCS#7, PKCS#12).

public IEnumerable<X509Certificate2> LoadCertsFromBytes(byte[] bytes, ILogger? logger = null)

Parameters

bytes byte[]
logger ILogger

Returns

IEnumerable<X509Certificate2>

LoadPkcs12CollectionFromFile(string, string?)

Loads all certificates from a PKCS#12 collection file.

public X509Certificate2Collection LoadPkcs12CollectionFromFile(string path, string? password)

Parameters

path string
password string

Returns

X509Certificate2Collection

LoadPkcs12FromFile(string, string?)

Loads an X509 certificate from a PKCS#12 file.

public X509Certificate2 LoadPkcs12FromFile(string path, string? password)

Parameters

path string
password string

Returns

X509Certificate2

ShortName(string)

Extracts the CN from a certificate subject string.

public string ShortName(string subject)

Parameters

subject string

Returns

string