#### [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')

## ProduceFirstOrdering Class

Orders a set of key versions so the one to produce with leads: whoever signs or encrypts takes the first key
for an algorithm, while every version stays published so consumers can still verify or decrypt\.

```csharp
public static class ProduceFirstOrdering
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → ProduceFirstOrdering

### Remarks
This is the whole of what makes a rollover cause no verification failure, and it is the same arithmetic
wherever the versions come from: a custodian enumerating them, or a key ring the library owns\. It is a pure
function of the creation times and the propagation window, so every pod derives the identical answer with no
coordination\.
### Methods

## ProduceFirstOrdering\.ProduceFirst\<T\>\(this IReadOnlyList\<T\>, Func\<T,DateTimeOffset\>, DateTimeOffset, TimeSpan\) Method {#Abblix.Jwt.ExternalKeys.ProduceFirstOrdering.ProduceFirst_T_(thisSystem.Collections.Generic.IReadOnlyList_T_,System.Func_T,System.DateTimeOffset_,System.DateTimeOffset,System.TimeSpan)}

Returns the versions with the active one first and the rest trailing newest\-first\.

```csharp
public static System.Collections.Generic.IEnumerable<T> ProduceFirst<T>(this System.Collections.Generic.IReadOnlyList<T> versions, System.Func<T,System.DateTimeOffset> createdAt, System.DateTimeOffset now, System.TimeSpan propagation);
```
#### Type parameters

###### `T` {#Abblix.Jwt.ExternalKeys.ProduceFirstOrdering.ProduceFirst_T_(thisSystem.Collections.Generic.IReadOnlyList_T_,System.Func_T,System.DateTimeOffset_,System.DateTimeOffset,System.TimeSpan).T}

The version type, whatever carries a creation time\.
#### Parameters

###### `versions` [System\.Collections\.Generic\.IReadOnlyList&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlylist-1 'System\.Collections\.Generic\.IReadOnlyList\`1')[T](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.ExternalKeys.ProduceFirstOrdering#Abblix.Jwt.ExternalKeys.ProduceFirstOrdering.ProduceFirst_T_(thisSystem.Collections.Generic.IReadOnlyList_T_,System.Func_T,System.DateTimeOffset_,System.DateTimeOffset,System.TimeSpan).T 'Abblix\.Jwt\.ExternalKeys\.ProduceFirstOrdering\.ProduceFirst\<T\>\(this System\.Collections\.Generic\.IReadOnlyList\<T\>, System\.Func\<T,System\.DateTimeOffset\>, System\.DateTimeOffset, System\.TimeSpan\)\.T')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlylist-1 'System\.Collections\.Generic\.IReadOnlyList\`1') {#Abblix.Jwt.ExternalKeys.ProduceFirstOrdering.ProduceFirst_T_(thisSystem.Collections.Generic.IReadOnlyList_T_,System.Func_T,System.DateTimeOffset_,System.DateTimeOffset,System.TimeSpan).versions}

The versions to order\.

###### `createdAt` [System\.Func&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.func-2 'System\.Func\`2')[T](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.ExternalKeys.ProduceFirstOrdering#Abblix.Jwt.ExternalKeys.ProduceFirstOrdering.ProduceFirst_T_(thisSystem.Collections.Generic.IReadOnlyList_T_,System.Func_T,System.DateTimeOffset_,System.DateTimeOffset,System.TimeSpan).T 'Abblix\.Jwt\.ExternalKeys\.ProduceFirstOrdering\.ProduceFirst\<T\>\(this System\.Collections\.Generic\.IReadOnlyList\<T\>, System\.Func\<T,System\.DateTimeOffset\>, System\.DateTimeOffset, System\.TimeSpan\)\.T')[,](https://learn.microsoft.com/en-us/dotnet/api/system.func-2 'System\.Func\`2')[System\.DateTimeOffset](https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset 'System\.DateTimeOffset')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.func-2 'System\.Func\`2') {#Abblix.Jwt.ExternalKeys.ProduceFirstOrdering.ProduceFirst_T_(thisSystem.Collections.Generic.IReadOnlyList_T_,System.Func_T,System.DateTimeOffset_,System.DateTimeOffset,System.TimeSpan).createdAt}

Reads a version's creation time\.

###### `now` [System\.DateTimeOffset](https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset 'System\.DateTimeOffset') {#Abblix.Jwt.ExternalKeys.ProduceFirstOrdering.ProduceFirst_T_(thisSystem.Collections.Generic.IReadOnlyList_T_,System.Func_T,System.DateTimeOffset_,System.DateTimeOffset,System.TimeSpan).now}

The current time\.

###### `propagation` [System\.TimeSpan](https://learn.microsoft.com/en-us/dotnet/api/system.timespan 'System\.TimeSpan') {#Abblix.Jwt.ExternalKeys.ProduceFirstOrdering.ProduceFirst_T_(thisSystem.Collections.Generic.IReadOnlyList_T_,System.Func_T,System.DateTimeOffset_,System.DateTimeOffset,System.TimeSpan).propagation}

How long a version stays announced before it starts producing, which is also the
            max\-age the server puts on its JWKS response, so a client that honours it holds the key before it meets a
            token signed with it\.

#### Returns
[System\.Collections\.Generic\.IEnumerable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')[T](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.ExternalKeys.ProduceFirstOrdering#Abblix.Jwt.ExternalKeys.ProduceFirstOrdering.ProduceFirst_T_(thisSystem.Collections.Generic.IReadOnlyList_T_,System.Func_T,System.DateTimeOffset_,System.DateTimeOffset,System.TimeSpan).T 'Abblix\.Jwt\.ExternalKeys\.ProduceFirstOrdering\.ProduceFirst\<T\>\(this System\.Collections\.Generic\.IReadOnlyList\<T\>, System\.Func\<T,System\.DateTimeOffset\>, System\.DateTimeOffset, System\.TimeSpan\)\.T')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')  
The versions, produce\-first\.

### Remarks
The active version is the newest one already past [propagation](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.ExternalKeys.ProduceFirstOrdering#Abblix.Jwt.ExternalKeys.ProduceFirstOrdering.ProduceFirst_T_(thisSystem.Collections.Generic.IReadOnlyList_T_,System.Func_T,System.DateTimeOffset_,System.DateTimeOffset,System.TimeSpan).propagation 'Abblix\.Jwt\.ExternalKeys\.ProduceFirstOrdering\.ProduceFirst\<T\>\(this System\.Collections\.Generic\.IReadOnlyList\<T\>, System\.Func\<T,System\.DateTimeOffset\>, System\.DateTimeOffset, System\.TimeSpan\)\.propagation')\. If none has cleared it
yet \(bootstrap: the very first version is still fresh\), the newest overall leads, since there is no older
version a client could be holding instead\.
