Skip to main content

IJsonWebTokenCreator Interface

Abblix.Jwt

Abblix.Jwt

IJsonWebTokenCreator Interface

Defines the contract for a service that creates JSON Web Tokens (JWTs).

public interface IJsonWebTokenCreator

Properties

IJsonWebTokenCreator.SignedResponseAlgorithmsSupported Property

Lists the all supported signing algorithms for JWT creation.

System.Collections.Generic.IEnumerable<string> SignedResponseAlgorithmsSupported { get; }

Property Value

System.Collections.Generic.IEnumerable<System.String>

Methods

IJsonWebTokenCreator.IssueAsync(JsonWebToken, JsonWebKey, JsonWebKey, string, string) Method

Issues a new JWT based on the specified JsonWebToken object, signing key, and optional encrypting key.

System.Threading.Tasks.Task<string> IssueAsync(Abblix.Jwt.JsonWebToken token, Abblix.Jwt.JsonWebKey? signingKey, Abblix.Jwt.JsonWebKey? encryptionKey=null, string keyEncryptionAlgorithm="RSA-OAEP-256", string contentEncryptionAlgorithm="A256CBC-HS512");

Parameters

token JsonWebToken

The JsonWebToken object containing the payload of the JWT.

signingKey JsonWebKey

The JsonWebKey used to sign the JWT.

encryptionKey JsonWebKey

Optional JsonWebKey used to encrypt the JWT. If null, the JWT is not encrypted.

keyEncryptionAlgorithm System.String

JWE key management algorithm ("alg") that protects the Content Encryption Key with the recipient's key (RFC 7518 Section 4). Defaults to RSA-OAEP-256. Supported values are listed on KeyManagement; only used when encryptionKey is provided.

contentEncryptionAlgorithm System.String

JWE content encryption algorithm ("enc") that encrypts the payload with the CEK (RFC 7518 Section 5). Defaults to A256CBC-HS512. Supported values are listed on ContentEncryption; only used when encryptionKey is provided.

Returns

System.Threading.Tasks.Task<System.String>
A Task representing the asynchronous operation, which upon completion yields the JWT as a string.