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

## ISecurityEventTokenSigner Interface

Turns a built SET into its signed compact serialization: the bridge between this package's
token model and whatever cryptography the host runs\.

```csharp
public interface ISecurityEventTokenSigner
```

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

### Remarks
The signer owns everything the model deliberately does not: which key signs, which algorithm
the "alg" header declares, whether a JWE layer wraps the result\. RFC 8417 Section 5\.1 sets the
bar an implementation must meet: unless the token's integrity is ensured by other means, "it
MUST be signed using JWS by an issuer that is trusted to do so for the use case"\. The default
implementation binds to the Abblix JWT core; a host with keys behind a boundary this process
cannot cross \- an HSM, a key vault \- substitutes its own\.
### Methods

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

Signs the SET and returns its compact serialization\.

```csharp
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.Abstractions.ISecurityEventTokenSigner.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.Abstractions.ISecurityEventTokenSigner.SignAsync(Abblix.SecurityEvents.SecurityEventToken,System.Threading.CancellationToken).cancellationToken}

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

#### 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\.
