Last active
January 16, 2023 22:33
-
-
Save alexzautke/ef0466afb1ba6d348310dfff0fc0969b to your computer and use it in GitHub Desktop.
CreativeCode.JWK HOW-TO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using CreativeCode.JWK; | |
using CreativeCode.JWK.KeyParts; | |
namespace JWK_Run | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Implementation of JSON Web Keys (RFC7517)"); | |
var keyUse = PublicKeyUse.Signature; | |
var keyOperations = new HashSet<KeyOperation>(new[] { KeyOperation.ComputeDigitalSignature, KeyOperation.VerifyDigitalSignature }); | |
var algorithm = Algorithm.RS384; | |
var jwk = new JWK(algorithm, keyUse, keyOperations); | |
string jwkString = jwk.Export(); | |
Console.WriteLine(jwkString); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@GilFurtado @TestUser0811 The example above should now work correctly.