Class CryptoHelper
- Namespace
- Duende.IdentityServer.Configuration
- Assembly
- Duende.IdentityServer.dll
Crypto helper
public static class CryptoHelper
- Inheritance
-
CryptoHelper
- Inherited Members
Methods
CreateECDsaSecurityKey(string)
Creates a new ECDSA security key.
public static ECDsaSecurityKey CreateECDsaSecurityKey(string curve = "P-256")
Parameters
curve
stringThe name of the curve as defined in https://tools.ietf.org/html/rfc7518#section-6.2.1.1.
Returns
- ECDsaSecurityKey
CreateHashClaimValue(string, string)
Creates the hash for the various hash claims (e.g. c_hash, at_hash or s_hash).
public static string CreateHashClaimValue(string value, string tokenSigningAlgorithm)
Parameters
Returns
CreateRsaSecurityKey(int)
Creates a new RSA security key.
public static RsaSecurityKey CreateRsaSecurityKey(int keySize = 2048)
Parameters
keySize
int
Returns
- RsaSecurityKey
CreateRsaSecurityKey(RSAParameters, string)
Creates an RSA security key.
public static RsaSecurityKey CreateRsaSecurityKey(RSAParameters parameters, string id)
Parameters
parameters
RSAParametersThe parameters.
id
stringThe identifier.
Returns
- RsaSecurityKey
GetHashAlgorithmForSigningAlgorithm(string)
Returns the matching hashing algorithm for a token signing algorithm
public static HashAlgorithm GetHashAlgorithmForSigningAlgorithm(string signingAlgorithm)
Parameters
signingAlgorithm
stringThe signing algorithm