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

## ClientEncryptionKeyResolver Class

Answers whether a client can be sent a JWT encrypted under the key management algorithm it registered, and with
which key: the one question both the formatter that encrypts the JWT and the security profile check that judges the
client ahead of it ask\.

```csharp
public sealed class ClientEncryptionKeyResolver
```

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

### Remarks
OpenID Connect Core 1\.0 section 10\.2 names the key by the algorithm's family\. An asymmetric algorithm encrypts to
what "MUST be a public key used for encryption published by the recipient in its JWK Set document"; a symmetric one
to the key "derived from the client\_secret value" \([Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.ClientSecretEncryptionKey](https://learn.microsoft.com/en-us/dotnet/api/abblix.oidc.server.features.tokens.formatters.clientsecretencryptionkey 'Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.ClientSecretEncryptionKey')\), and to nothing else\.

Public, though nothing outside this library needs it, because the formatter that takes it is a public type with a
public constructor, which the container requires.
### Constructors

## ClientEncryptionKeyResolver\(ProfiledJwtIssuer, IClientKeysProvider, TimeProvider, EncryptionAlgorithmsProvider, IClientSecretEncryptor\) Constructor {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ClientEncryptionKeyResolver(Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer,Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider,System.TimeProvider,Abblix.Jwt.EncryptionAlgorithmsProvider,Abblix.Oidc.Server.Features.ClientInformation.IClientSecretEncryptor)}

Answers whether a client can be sent a JWT encrypted under the key management algorithm it registered, and with
which key: the one question both the formatter that encrypts the JWT and the security profile check that judges the
client ahead of it ask\.

```csharp
public ClientEncryptionKeyResolver(Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer issuer, Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider clientKeysProvider, System.TimeProvider timeProvider, Abblix.Jwt.EncryptionAlgorithmsProvider encryptionAlgorithms, Abblix.Oidc.Server.Features.ClientInformation.IClientSecretEncryptor secretEncryptor);
```
#### Parameters

###### `issuer` [ProfiledJwtIssuer](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer 'Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.ProfiledJwtIssuer') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ClientEncryptionKeyResolver(Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer,Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider,System.TimeProvider,Abblix.Jwt.EncryptionAlgorithmsProvider,Abblix.Oidc.Server.Features.ClientInformation.IClientSecretEncryptor).issuer}

Decides whether the host performs an algorithm with a key and the profile admits it\.

###### `clientKeysProvider` [IClientKeysProvider](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider 'Abblix\.Oidc\.Server\.Features\.ClientInformation\.IClientKeysProvider') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ClientEncryptionKeyResolver(Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer,Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider,System.TimeProvider,Abblix.Jwt.EncryptionAlgorithmsProvider,Abblix.Oidc.Server.Features.ClientInformation.IClientSecretEncryptor).clientKeysProvider}

Supplies the encryption keys the client publishes\.

###### `timeProvider` [System\.TimeProvider](https://learn.microsoft.com/en-us/dotnet/api/system.timeprovider 'System\.TimeProvider') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ClientEncryptionKeyResolver(Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer,Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider,System.TimeProvider,Abblix.Jwt.EncryptionAlgorithmsProvider,Abblix.Oidc.Server.Features.ClientInformation.IClientSecretEncryptor).timeProvider}

Supplies the time a client secret's expiry is judged against\.

###### `encryptionAlgorithms` [EncryptionAlgorithmsProvider](https://www.abblix.com/docs/api/abblix-jwt/Abblix.Jwt.EncryptionAlgorithmsProvider 'Abblix\.Jwt\.EncryptionAlgorithmsProvider') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ClientEncryptionKeyResolver(Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer,Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider,System.TimeProvider,Abblix.Jwt.EncryptionAlgorithmsProvider,Abblix.Oidc.Server.Features.ClientInformation.IClientSecretEncryptor).encryptionAlgorithms}

Tells which key types a key management algorithm is carried out with\.

###### `secretEncryptor` [IClientSecretEncryptor](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ClientInformation.IClientSecretEncryptor 'Abblix\.Oidc\.Server\.Features\.ClientInformation\.IClientSecretEncryptor') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ClientEncryptionKeyResolver(Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer,Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider,System.TimeProvider,Abblix.Jwt.EncryptionAlgorithmsProvider,Abblix.Oidc.Server.Features.ClientInformation.IClientSecretEncryptor).secretEncryptor}

Decrypts a client secret kept encrypted, for the key derived from it\.

### Remarks
OpenID Connect Core 1\.0 section 10\.2 names the key by the algorithm's family\. An asymmetric algorithm encrypts to
what "MUST be a public key used for encryption published by the recipient in its JWK Set document"; a symmetric one
to the key "derived from the client\_secret value" \([Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.ClientSecretEncryptionKey](https://learn.microsoft.com/en-us/dotnet/api/abblix.oidc.server.features.tokens.formatters.clientsecretencryptionkey 'Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.ClientSecretEncryptionKey')\), and to nothing else\.

Public, though nothing outside this library needs it, because the formatter that takes it is a public type with a
public constructor, which the container requires.
### Methods

## ClientEncryptionKeyResolver\.ResolveAsync\(TenantDefinition, SecurityProfileRequirements, ClientInfo, string, string\) Method {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ResolveAsync(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition,Abblix.Oidc.Server.Features.ClientInformation.SecurityProfileRequirements,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,string,string)}

The key a JWT for [client](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ResolveAsync(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition,Abblix.Oidc.Server.Features.ClientInformation.SecurityProfileRequirements,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,string,string).client 'Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.ClientEncryptionKeyResolver\.ResolveAsync\(Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition, Abblix\.Oidc\.Server\.Features\.ClientInformation\.SecurityProfileRequirements, Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo, string, string\)\.client') is encrypted to under [keyManagementAlgorithm](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ResolveAsync(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition,Abblix.Oidc.Server.Features.ClientInformation.SecurityProfileRequirements,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,string,string).keyManagementAlgorithm 'Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.ClientEncryptionKeyResolver\.ResolveAsync\(Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition, Abblix\.Oidc\.Server\.Features\.ClientInformation\.SecurityProfileRequirements, Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo, string, string\)\.keyManagementAlgorithm'), or
null where there is none: the first published key that declares the algorithm or none, whose material carries it
out, the host performs it with and [profile](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ResolveAsync(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition,Abblix.Oidc.Server.Features.ClientInformation.SecurityProfileRequirements,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,string,string).profile 'Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.ClientEncryptionKeyResolver\.ResolveAsync\(Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition, Abblix\.Oidc\.Server\.Features\.ClientInformation\.SecurityProfileRequirements, Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo, string, string\)\.profile') admits; for a symmetric algorithm, the key derived
from the client secret, under the same conditions\.

```csharp
public System.Threading.Tasks.Task<Abblix.Jwt.JsonWebKey?> ResolveAsync(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition tenant, Abblix.Oidc.Server.Features.ClientInformation.SecurityProfileRequirements profile, Abblix.Oidc.Server.Features.ClientInformation.ClientInfo client, string keyManagementAlgorithm, string contentEncryptionAlgorithm);
```
#### Parameters

###### `tenant` [TenantDefinition](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ResolveAsync(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition,Abblix.Oidc.Server.Features.ClientInformation.SecurityProfileRequirements,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,string,string).tenant}

The tenant the client is registered at\.

###### `profile` [SecurityProfileRequirements](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ClientInformation.SecurityProfileRequirements 'Abblix\.Oidc\.Server\.Features\.ClientInformation\.SecurityProfileRequirements') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ResolveAsync(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition,Abblix.Oidc.Server.Features.ClientInformation.SecurityProfileRequirements,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,string,string).profile}

The controls the client is held to\.

###### `client` [ClientInfo](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ClientInformation.ClientInfo 'Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ResolveAsync(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition,Abblix.Oidc.Server.Features.ClientInformation.SecurityProfileRequirements,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,string,string).client}

The client the JWT is addressed to\.

###### `keyManagementAlgorithm` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ResolveAsync(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition,Abblix.Oidc.Server.Features.ClientInformation.SecurityProfileRequirements,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,string,string).keyManagementAlgorithm}

The key management algorithm the client registered\.

###### `contentEncryptionAlgorithm` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientEncryptionKeyResolver.ResolveAsync(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition,Abblix.Oidc.Server.Features.ClientInformation.SecurityProfileRequirements,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,string,string).contentEncryptionAlgorithm}

The content encryption algorithm the JWT is encrypted with, which fixes
            the length of a key used directly as the content encryption key\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[JsonWebKey](https://www.abblix.com/docs/api/abblix-jwt/Abblix.Jwt.JsonWebKey 'Abblix\.Jwt\.JsonWebKey')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')
