#### [Abblix\.Oidc\.Server](https://www.abblix.com/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Features\.MultiTenancy](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy 'Abblix\.Oidc\.Server\.Features\.MultiTenancy')

## TenantKeyRingClosing Class

Deletes from the key ring's store the keys the server minted for a released tenant\.

```csharp
public sealed class TenantKeyRingClosing : Abblix.Oidc.Server.Features.MultiTenancy.ITenantClosing
```

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

Implements [ITenantClosing](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.ITenantClosing 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.ITenantClosing')

### Remarks
The partition belongs to that creation of the tenant alone, so a tenant created again under the same id, which
mints into a partition of its own generation, keeps its keys\. A released tenant whose id or generation could not
name a partition of its own was never opened, and the partition its name spells may be another tenant's, so
nothing is deleted for it\. Keys from the settings or a custodian are not the server's to delete\. The ring of the
partition was already let go when the tenant was released\. The ring and the minting are resolved when a tenant is
closed, as [TenantKeyRingOpening](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantKeyRingOpening 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantKeyRingOpening') resolves them when it is opened\.
### Constructors

## TenantKeyRingClosing\(IServiceProvider\) Constructor {#Abblix.Oidc.Server.Features.MultiTenancy.TenantKeyRingClosing.TenantKeyRingClosing(System.IServiceProvider)}

Deletes from the key ring's store the keys the server minted for a released tenant\.

```csharp
public TenantKeyRingClosing(System.IServiceProvider serviceProvider);
```
#### Parameters

###### `serviceProvider` [System\.IServiceProvider](https://learn.microsoft.com/en-us/dotnet/api/system.iserviceprovider 'System\.IServiceProvider') {#Abblix.Oidc.Server.Features.MultiTenancy.TenantKeyRingClosing.TenantKeyRingClosing(System.IServiceProvider).serviceProvider}

Resolves the key ring and tells whether the server mints its keys\.

### Remarks
The partition belongs to that creation of the tenant alone, so a tenant created again under the same id, which
mints into a partition of its own generation, keeps its keys\. A released tenant whose id or generation could not
name a partition of its own was never opened, and the partition its name spells may be another tenant's, so
nothing is deleted for it\. Keys from the settings or a custodian are not the server's to delete\. The ring of the
partition was already let go when the tenant was released\. The ring and the minting are resolved when a tenant is
closed, as [TenantKeyRingOpening](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantKeyRingOpening 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantKeyRingOpening') resolves them when it is opened\.
### Methods

## TenantKeyRingClosing\.CloseAsync\(IReadOnlyCollection\<TenantDefinition\>, CancellationToken\) Method {#Abblix.Oidc.Server.Features.MultiTenancy.TenantKeyRingClosing.CloseAsync(System.Collections.Generic.IReadOnlyCollection_Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition_,System.Threading.CancellationToken)}

Lets go of what each of [tenants](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantKeyRingClosing#Abblix.Oidc.Server.Features.MultiTenancy.TenantKeyRingClosing.CloseAsync(System.Collections.Generic.IReadOnlyCollection_Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition_,System.Threading.CancellationToken).tenants 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantKeyRingClosing\.CloseAsync\(System\.Collections\.Generic\.IReadOnlyCollection\<Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition\>, System\.Threading\.CancellationToken\)\.tenants') kept, each one on its own, so one that fails leaves the
others closed\.

```csharp
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyDictionary<Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition,System.Exception>> CloseAsync(System.Collections.Generic.IReadOnlyCollection<Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition> tenants, System.Threading.CancellationToken cancellationToken);
```
#### Parameters

###### `tenants` [System\.Collections\.Generic\.IReadOnlyCollection&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlycollection-1 'System\.Collections\.Generic\.IReadOnlyCollection\`1')[TenantDefinition](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlycollection-1 'System\.Collections\.Generic\.IReadOnlyCollection\`1') {#Abblix.Oidc.Server.Features.MultiTenancy.TenantKeyRingClosing.CloseAsync(System.Collections.Generic.IReadOnlyCollection_Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition_,System.Threading.CancellationToken).tenants}

The tenants released, each in the creation that was served\.

###### `cancellationToken` [System\.Threading\.CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken 'System\.Threading\.CancellationToken') {#Abblix.Oidc.Server.Features.MultiTenancy.TenantKeyRingClosing.CloseAsync(System.Collections.Generic.IReadOnlyCollection_Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition_,System.Threading.CancellationToken).cancellationToken}

Cancels the closing\.

Implements [CloseAsync\(IReadOnlyCollection&lt;TenantDefinition&gt;, CancellationToken\)](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.ITenantClosing#Abblix.Oidc.Server.Features.MultiTenancy.ITenantClosing.CloseAsync(System.Collections.Generic.IReadOnlyCollection_Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition_,System.Threading.CancellationToken) 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.ITenantClosing\.CloseAsync\(System\.Collections\.Generic\.IReadOnlyCollection\<Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition\>, System\.Threading\.CancellationToken\)')

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[System\.Collections\.Generic\.IReadOnlyDictionary&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlydictionary-2 'System\.Collections\.Generic\.IReadOnlyDictionary\`2')[TenantDefinition](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition')[,](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlydictionary-2 'System\.Collections\.Generic\.IReadOnlyDictionary\`2')[System\.Exception](https://learn.microsoft.com/en-us/dotnet/api/system.exception 'System\.Exception')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlydictionary-2 'System\.Collections\.Generic\.IReadOnlyDictionary\`2')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
Why each tenant that could not be closed, wholly or in part, was not, by the definition it was handed
            in; the others are closed\.
