Last active
November 6, 2018 23:54
-
-
Save evgomes/03babaf116bbd49bd6ad7e22f2ee6b79 to your computer and use it in GitHub Desktop.
Signing configurations for tokens of JWT API.
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
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