Table of Contents

Class DapperSigningKeyStore

Namespace
Fdyay.IdentityServer.Dapper.Stores
Assembly
Fdyay.IdentityServer.Dapper.dll

Dapper-backed signing key store.

public sealed class DapperSigningKeyStore : ISigningKeyStore
Inheritance
DapperSigningKeyStore
Implements
Inherited Members

Constructors

DapperSigningKeyStore(IDbConnectionFactory)

Creates a signing key store over the SigningKeys table.

public DapperSigningKeyStore(IDbConnectionFactory connectionFactory)

Parameters

connectionFactory IDbConnectionFactory

Opens a connection for each operation and supplies the dialect's upsert.

Methods

DeleteKeyAsync(string, CancellationToken)

Deletes a key by id.

public Task DeleteKeyAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string
cancellationToken CancellationToken

Returns

Task

Remarks

Deletes the SigningKeys row whose Id matches. A miss deletes nothing and is not an error.

Exceptions

ArgumentException

id is null or empty.

LoadKeysAsync(CancellationToken)

Loads all persisted keys.

public Task<IEnumerable<SerializedKey>> LoadKeysAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<IEnumerable<SerializedKey>>

Remarks

Reads every SigningKeys row, in no particular order. An empty table is an empty sequence.

StoreKeyAsync(SerializedKey, CancellationToken)

Persists a key.

public Task StoreKeyAsync(SerializedKey key, CancellationToken cancellationToken = default)

Parameters

key SerializedKey
cancellationToken CancellationToken

Returns

Task

Remarks

Upserts the SigningKeys row keyed by Id; an existing row with that id is overwritten in full.

Exceptions

ArgumentNullException

key is null.