#### [Abblix\.SecurityEvents](https://www.abblix.com/en/docs/api/abblix-securityevents 'index')
### [Abblix\.SecurityEvents\.Infrastructure](https://www.abblix.com/en/docs/api/abblix-securityevents/Abblix.SecurityEvents.Infrastructure 'Abblix\.SecurityEvents\.Infrastructure')

## DefaultSecurityEventTokenSigner Class

The out\-of\-the\-box signer: compact JWS through the Abblix JWT core, with the signing key from
the source the host configured\.

```csharp
public sealed class DefaultSecurityEventTokenSigner : Abblix.SecurityEvents.Abstractions.ISecurityEventTokenSigner
```

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

Implements [ISecurityEventTokenSigner](https://www.abblix.com/en/docs/api/abblix-securityevents/Abblix.SecurityEvents.Abstractions.ISecurityEventTokenSigner 'Abblix\.SecurityEvents\.Abstractions\.ISecurityEventTokenSigner')

### Remarks
The key source is asked per signing rather than once, so key rotation on the host's side takes
effect on the next token instead of the next restart\. The signing algorithm follows the key,
and this signer writes it into the header rather than letting the core derive it, so that what
was judged against the allowlist is what the token is signed with\.
### Constructors

## DefaultSecurityEventTokenSigner\(IJsonWebTokenCreator, Func\<CancellationToken,Task\<JsonWebKey\>\>, string\[\]\) Constructor {#Abblix.SecurityEvents.Infrastructure.DefaultSecurityEventTokenSigner.DefaultSecurityEventTokenSigner(Abblix.Jwt.IJsonWebTokenCreator,System.Func_System.Threading.CancellationToken,System.Threading.Tasks.Task_Abblix.Jwt.JsonWebKey__,string[])}

The out\-of\-the\-box signer: compact JWS through the Abblix JWT core, with the signing key from
the source the host configured\.

```csharp
public DefaultSecurityEventTokenSigner(Abblix.Jwt.IJsonWebTokenCreator creator, System.Func<System.Threading.CancellationToken,System.Threading.Tasks.Task<Abblix.Jwt.JsonWebKey>> signingKeySource, string[] allowedAlgorithms);
```
#### Parameters

###### `creator` [IJsonWebTokenCreator](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.IJsonWebTokenCreator 'Abblix\.Jwt\.IJsonWebTokenCreator') {#Abblix.SecurityEvents.Infrastructure.DefaultSecurityEventTokenSigner.DefaultSecurityEventTokenSigner(Abblix.Jwt.IJsonWebTokenCreator,System.Func_System.Threading.CancellationToken,System.Threading.Tasks.Task_Abblix.Jwt.JsonWebKey__,string[]).creator}

The JWT core's token creator\.

###### `signingKeySource` [System\.Func&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.func-2 'System\.Func\`2')[System\.Threading\.CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken 'System\.Threading\.CancellationToken')[,](https://learn.microsoft.com/en-us/dotnet/api/system.func-2 'System\.Func\`2')[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/en/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')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.func-2 'System\.Func\`2') {#Abblix.SecurityEvents.Infrastructure.DefaultSecurityEventTokenSigner.DefaultSecurityEventTokenSigner(Abblix.Jwt.IJsonWebTokenCreator,System.Func_System.Threading.CancellationToken,System.Threading.Tasks.Task_Abblix.Jwt.JsonWebKey__,string[]).signingKeySource}

Supplies the private key each signing uses\.

###### `allowedAlgorithms` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array') {#Abblix.SecurityEvents.Infrastructure.DefaultSecurityEventTokenSigner.DefaultSecurityEventTokenSigner(Abblix.Jwt.IJsonWebTokenCreator,System.Func_System.Threading.CancellationToken,System.Threading.Tasks.Task_Abblix.Jwt.JsonWebKey__,string[]).allowedAlgorithms}

What this deployment will sign with\.

### Remarks
The key source is asked per signing rather than once, so key rotation on the host's side takes
effect on the next token instead of the next restart\. The signing algorithm follows the key,
and this signer writes it into the header rather than letting the core derive it, so that what
was judged against the allowlist is what the token is signed with\.
### Methods

## DefaultSecurityEventTokenSigner\.SignAsync\(SecurityEventToken, CancellationToken\) Method {#Abblix.SecurityEvents.Infrastructure.DefaultSecurityEventTokenSigner.SignAsync(Abblix.SecurityEvents.SecurityEventToken,System.Threading.CancellationToken)}

Signs the SET and returns its compact serialization\.

```csharp
public System.Threading.Tasks.Task<string> SignAsync(Abblix.SecurityEvents.SecurityEventToken token, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));
```
#### Parameters

###### `token` [SecurityEventToken](https://www.abblix.com/en/docs/api/abblix-securityevents/Abblix.SecurityEvents.SecurityEventToken 'Abblix\.SecurityEvents\.SecurityEventToken') {#Abblix.SecurityEvents.Infrastructure.DefaultSecurityEventTokenSigner.SignAsync(Abblix.SecurityEvents.SecurityEventToken,System.Threading.CancellationToken).token}

The SET to sign\.

###### `cancellationToken` [System\.Threading\.CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken 'System\.Threading\.CancellationToken') {#Abblix.SecurityEvents.Infrastructure.DefaultSecurityEventTokenSigner.SignAsync(Abblix.SecurityEvents.SecurityEventToken,System.Threading.CancellationToken).cancellationToken}

Cancels key retrieval or remote signing mid\-flight\.

Implements [SignAsync\(SecurityEventToken, CancellationToken\)](https://www.abblix.com/en/docs/api/abblix-securityevents/Abblix.SecurityEvents.Abstractions.ISecurityEventTokenSigner#Abblix.SecurityEvents.Abstractions.ISecurityEventTokenSigner.SignAsync(Abblix.SecurityEvents.SecurityEventToken,System.Threading.CancellationToken) 'Abblix\.SecurityEvents\.Abstractions\.ISecurityEventTokenSigner\.SignAsync\(Abblix\.SecurityEvents\.SecurityEventToken, 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\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
The compact JWS \(or JWE\-wrapped JWS\) representation of the SET\.
