#### [Abblix\.Jwt](https://www.abblix.com/en/docs/api/abblix-jwt 'index')
### [Abblix\.Jwt\.ExternalKeys](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.ExternalKeys 'Abblix\.Jwt\.ExternalKeys')

## IKeyRing Interface

Hands out the keys it holds to whoever asks for them\.

```csharp
public interface IKeyRing
```

Derived  
↳ [InMemoryKeyRing](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.ExternalKeys.InMemoryKeyRing 'Abblix\.Jwt\.ExternalKeys\.InMemoryKeyRing')

### Remarks
The ring knows how keys are minted, sealed, shared and rotated, and nothing about what they are then used
for\. An OpenID Provider asks it for the keys it signs with and publishes; a client asks it for the keys it
protects stored sessions with\. Both get the same answer from the same ring, which is why this contract
names neither of them\.
### Methods

## IKeyRing\.Get\(string, bool\) Method {#Abblix.Jwt.ExternalKeys.IKeyRing.Get(string,bool)}

Returns the keys for a role, the one to produce with leading\.

```csharp
System.Collections.Generic.IEnumerable<Abblix.Jwt.JsonWebKey> Get(string usage, bool includePrivateKeys);
```
#### Parameters

###### `usage` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Jwt.ExternalKeys.IKeyRing.Get(string,bool).usage}

Which role to serve, signature or encryption\.

###### `includePrivateKeys` [System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean') {#Abblix.Jwt.ExternalKeys.IKeyRing.Get(string,bool).includePrivateKeys}

Whether the caller needs the private half, which only signing and decryption do\. Publication must not\.

#### Returns
[System\.Collections\.Generic\.IEnumerable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')[JsonWebKey](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.JsonWebKey 'Abblix\.Jwt\.JsonWebKey')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')

### Remarks
The ordering carries meaning: whoever produces takes the first key for an algorithm, while every key
stays in the result so consumers can still verify or decrypt across a rotation\.

## IKeyRing\.RefreshAsync\(CancellationToken\) Method {#Abblix.Jwt.ExternalKeys.IKeyRing.RefreshAsync(System.Threading.CancellationToken)}

Brings the ring up to date: mints what the current period lacks, retires what has expired, and reloads
what other instances have minted\.

```csharp
System.Threading.Tasks.Task RefreshAsync(System.Threading.CancellationToken cancellationToken);
```
#### Parameters

###### `cancellationToken` [System\.Threading\.CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken 'System\.Threading\.CancellationToken') {#Abblix.Jwt.ExternalKeys.IKeyRing.RefreshAsync(System.Threading.CancellationToken).cancellationToken}

Cancels the refresh\.

#### Returns
[System\.Threading\.Tasks\.Task](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task 'System\.Threading\.Tasks\.Task')
