Skip to content

Instantly share code, notes, and snippets.

@evgomes
Last active November 6, 2018 23:54
Show Gist options
  • Save evgomes/03babaf116bbd49bd6ad7e22f2ee6b79 to your computer and use it in GitHub Desktop.
Save evgomes/03babaf116bbd49bd6ad7e22f2ee6b79 to your computer and use it in GitHub Desktop.
Signing configurations for tokens of JWT API.
public class SigningConfigurations
{
public SecurityKey Key { get; }
public SigningCredentials SigningCredentials { get; }
public SigningConfigurations()
{
using(var provider = new RSACryptoServiceProvider(2048))
{
Key = new RsaSecurityKey(provider.ExportParameters(true));
}
SigningCredentials = new SigningCredentials(Key, SecurityAlgorithms.RsaSha256Signature);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment