using System.Security.Cryptography;
using Microsoft.IdentityModel.JsonWebTokens;
using Microsoft.IdentityModel.Tokens;
using System.Security.Claims;
using System.Collections.Generic;
public static void Main()
var key = new RsaSecurityKey(RSA.Create(2048));
var handler = new JsonWebTokenHandler();
var now = DateTime.UtcNow;
var descriptor = new SecurityTokenDescriptor
Expires = now.AddMinutes(5),
Subject = new ClaimsIdentity(new List<Claim>{new Claim("sub", "mike")}),
SigningCredentials = new SigningCredentials(key, SecurityAlgorithms.RsaSha256Signature)
string jwt = handler.CreateToken(descriptor);
Console.WriteLine(jwt);*/