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
connectionFactoryIDbConnectionFactoryOpens 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
idstringcancellationTokenCancellationToken
Returns
Remarks
Deletes the SigningKeys row whose Id matches. A miss deletes nothing and is not an error.
Exceptions
- ArgumentException
idis null or empty.
LoadKeysAsync(CancellationToken)
Loads all persisted keys.
public Task<IEnumerable<SerializedKey>> LoadKeysAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
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
keySerializedKeycancellationTokenCancellationToken
Returns
Remarks
Upserts the SigningKeys row keyed by Id; an existing row with that id is overwritten in full.
Exceptions
- ArgumentNullException
keyis null.