Skip to content

IKeyRings Interface

The rings of every partition the key ring keeps (IKeyRingPartitions), one for each issuer a server serves, so each issuer mints, rotates and serves keys of its own.

C#
public interface IKeyRings

Methods

IKeyRings.Close(string) Method

Lets the ring of partition go, its keys with it, once the issuer it served is gone for good; a ring not built is left alone. The partition's entries stay in the store.

C#
void Close(string partition);

Parameters

partition System.String

The partition to close.

IKeyRings.DeleteAsync(IReadOnlyCollection<string>, CancellationToken) Method

Removes the entries of partitions from the store, each partition on its own. Call it once their rings are closed and nothing will verify a token their keys signed, since the keys are gone for every instance sharing the store. One read of the store serves them all.

C#
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyDictionary<string,System.Exception>> DeleteAsync(System.Collections.Generic.IReadOnlyCollection<string> partitions, System.Threading.CancellationToken cancellationToken);

Parameters

partitions System.Collections.Generic.IReadOnlyCollection<System.String>

The partitions whose entries to remove.

cancellationToken System.Threading.CancellationToken

Cancels the removal; the entries not removed yet stay.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyDictionary<System.String,System.Exception>>
Why each partition whose entries could not all be removed was not, by its name; the others are gone.

IKeyRings.For(string) Method

The ring of partition.

C#
Abblix.Jwt.ExternalKeys.IKeyRing For(string partition);

Parameters

partition System.String

A partition the ring keeps, or one opened by OpenAsync(IReadOnlyCollection<string>, CancellationToken).

Returns

IKeyRing

Exceptions

System.InvalidOperationException
The ring keeps no such partition.

IKeyRings.OpenAsync(IReadOnlyCollection<string>, CancellationToken) Method

Readies the rings of partitions to serve, each on its own: builds each not built yet and refreshes each not kept now, which mints a first key where none is due, so the first request for it finds a key to produce with. One read of the store serves them all.

C#
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyDictionary<string,System.Exception>> OpenAsync(System.Collections.Generic.IReadOnlyCollection<string> partitions, System.Threading.CancellationToken cancellationToken);

Parameters

partitions System.Collections.Generic.IReadOnlyCollection<System.String>

The partitions to open, each named of letters, digits, '-', '_' and '~' only.

cancellationToken System.Threading.CancellationToken

Cancels the opening of those not opened yet.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyDictionary<System.String,System.Exception>>
Why each partition that could not be opened was not, by its name: a name that cannot name a partition, or the store or the custodian failing. The others are ready.

Exceptions

System.InvalidOperationException
Keys are adopted where no partition will take them, judged before any partition opens, so none of them is opened.