Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// gerador de jws / jwe
var tokenHandler = new JsonWebTokenHandler();
// Criando chave assimetrica
var key = new RsaSecurityKey(RSA.Create(2048));
// criando o jwt
var jwt = new SecurityTokenDescriptor
{
Issuer = "www.mysite.com",
Audience = "your-spa",
// Details hide
SigningCredentials = new SigningCredentials(key, SecurityAlgorithms.RsaSsaPssSha256) // <-- Algoritmo probabilistico
};
// assinando o jwt
string jws = tokenHandler.CreateToken(jwt);
Console.WriteLine(jws);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.