Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Duende.​IdentityServer.​Configuration.​CryptoHelper
Assembly: Duende.IdentityServer
Inheritance: object → CryptoHelper
Crypto helper
Methods
public static
Microsoft.​IdentityModel.​Tokens.​RsaSecurityKey
CreateRsaSecurityKey​(int keySize = 2048)
Creates a new RSA security key.
public static
Microsoft.​IdentityModel.​Tokens.​ECDsaSecurityKey
CreateECDsaSecurityKey​(string curve = "P-256")
Creates a new ECDSA security key.
curve
The name of the curve as defined in
https://tools.ietf.org/html/rfc7518#section-6.2.1.1.
public static
Microsoft.​IdentityModel.​Tokens.​RsaSecurityKey
CreateRsaSecurityKey​(System.​Security.​Cryptography.​RSAParameters parameters,
string id)
Creates an RSA security key.
parameters
The parameters.
id
The identifier.
public static
string
CreateHashClaimValue​(string value,
string tokenSigningAlgorithm)
Creates the hash for the various hash claims (e.g. c_hash, at_hash or s_hash).
value
The value to hash.
tokenSigningAlgorithm
The token signing algorithm
public static
System.​ValueTuple<​System.​Func<​byte[], byte[]>, int>
GetHashFunctionForSigningAlgorithm​(string signingAlgorithm)
Returns the matching hash function for a token signing algorithm
public static
System.​Security.​Cryptography.​HashAlgorithm
GetHashAlgorithmForSigningAlgorithm​(string signingAlgorithm)
Returns the matching hashing algorithm for a token signing algorithm
signingAlgorithm
The signing algorithm
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object