Skip to content

Instantly share code, notes, and snippets.

@alexzautke
Last active January 16, 2023 22:33
Show Gist options
  • Save alexzautke/ef0466afb1ba6d348310dfff0fc0969b to your computer and use it in GitHub Desktop.
Save alexzautke/ef0466afb1ba6d348310dfff0fc0969b to your computer and use it in GitHub Desktop.
CreativeCode.JWK HOW-TO
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);
}
}
}
@alexzautke
Copy link
Author

@GilFurtado @TestUser0811 The example above should now work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment