Table of Contents

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 string

The 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

value string

The value to hash.

tokenSigningAlgorithm string

The token signing algorithm

Returns

string

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 RSAParameters

The parameters.

id string

The identifier.

Returns

RsaSecurityKey

GetHashAlgorithmForSigningAlgorithm(string)

Returns the matching hashing algorithm for a token signing algorithm

public static HashAlgorithm GetHashAlgorithmForSigningAlgorithm(string signingAlgorithm)

Parameters

signingAlgorithm string

The signing algorithm

Returns

HashAlgorithm