#### [Abblix\.Jwt](https://www.abblix.com/en/docs/api/abblix-jwt 'index')
### [Abblix\.Jwt\.Signing](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.Signing 'Abblix\.Jwt\.Signing')

## ISignatureAlgorithm\<TJsonWebKey\> Interface

Defines the contract for signing and verifying JWT tokens using a specific cryptographic algorithm\.

```csharp
public interface ISignatureAlgorithm<in TJsonWebKey>
    where TJsonWebKey : Abblix.Jwt.JsonWebKey
```
#### Type parameters

###### `TJsonWebKey` {#Abblix.Jwt.Signing.ISignatureAlgorithm_TJsonWebKey_.TJsonWebKey}
### Properties

## ISignatureAlgorithm\<TJsonWebKey\>\.Algorithm Property {#Abblix.Jwt.Signing.ISignatureAlgorithm_TJsonWebKey_.Algorithm}

The JWS signing algorithm identifier this signer implements \(e\.g\. "RS256", "ES384"\)\.
Must equal the DI key the signer is registered under: discovery enumerates the keyed
registrations and projects this value into the `*_signing_alg_values_supported` lists,
so a mismatch would advertise an algorithm name the dispatch cannot resolve\.

```csharp
string Algorithm { get; }
```

#### Property Value
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')
### Methods

## ISignatureAlgorithm\<TJsonWebKey\>\.Sign\(TJsonWebKey, byte\[\]\) Method {#Abblix.Jwt.Signing.ISignatureAlgorithm_TJsonWebKey_.Sign(TJsonWebKey,byte[])}

Signs the provided data using the configured algorithm and specified key\.

```csharp
byte[] Sign(TJsonWebKey key, byte[] data);
```
#### Parameters

###### `key` [TJsonWebKey](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.Signing.ISignatureAlgorithm_TJsonWebKey_#Abblix.Jwt.Signing.ISignatureAlgorithm_TJsonWebKey_.TJsonWebKey 'Abblix\.Jwt\.Signing\.ISignatureAlgorithm\<TJsonWebKey\>\.TJsonWebKey') {#Abblix.Jwt.Signing.ISignatureAlgorithm_TJsonWebKey_.Sign(TJsonWebKey,byte[]).key}

The key to use for signing\.

###### `data` [System\.Byte](https://learn.microsoft.com/en-us/dotnet/api/system.byte 'System\.Byte')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array') {#Abblix.Jwt.Signing.ISignatureAlgorithm_TJsonWebKey_.Sign(TJsonWebKey,byte[]).data}

The data to sign \(typically the JWT header\.payload part\)\.

#### Returns
[System\.Byte](https://learn.microsoft.com/en-us/dotnet/api/system.byte 'System\.Byte')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array')  
The signature bytes\.

## ISignatureAlgorithm\<TJsonWebKey\>\.Verify\(TJsonWebKey, byte\[\], byte\[\]\) Method {#Abblix.Jwt.Signing.ISignatureAlgorithm_TJsonWebKey_.Verify(TJsonWebKey,byte[],byte[])}

Verifies the signature of the provided data using the configured algorithm and specified key\.

```csharp
bool Verify(TJsonWebKey key, byte[] data, byte[] signature);
```
#### Parameters

###### `key` [TJsonWebKey](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.Signing.ISignatureAlgorithm_TJsonWebKey_#Abblix.Jwt.Signing.ISignatureAlgorithm_TJsonWebKey_.TJsonWebKey 'Abblix\.Jwt\.Signing\.ISignatureAlgorithm\<TJsonWebKey\>\.TJsonWebKey') {#Abblix.Jwt.Signing.ISignatureAlgorithm_TJsonWebKey_.Verify(TJsonWebKey,byte[],byte[]).key}

The key to use for verification\.

###### `data` [System\.Byte](https://learn.microsoft.com/en-us/dotnet/api/system.byte 'System\.Byte')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array') {#Abblix.Jwt.Signing.ISignatureAlgorithm_TJsonWebKey_.Verify(TJsonWebKey,byte[],byte[]).data}

The data that was signed \(typically the JWT header\.payload part\)\.

###### `signature` [System\.Byte](https://learn.microsoft.com/en-us/dotnet/api/system.byte 'System\.Byte')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array') {#Abblix.Jwt.Signing.ISignatureAlgorithm_TJsonWebKey_.Verify(TJsonWebKey,byte[],byte[]).signature}

The signature to verify\.

#### Returns
[System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean')  
True if the signature is valid; otherwise, false\.
