Table of Contents

Class CryptoHelper

Namespace
Fdyay.IdentityServer.Services.Tokens
Assembly
Fdyay.IdentityServer.Core.dll

Hashing and secure-random helpers built on System.Security.Cryptography.

public static class CryptoHelper
Inheritance
CryptoHelper
Inherited Members

Methods

CreateHandle(int)

Creates a cryptographically-random, URL-safe handle of the given byte length.

public static string CreateHandle(int byteLength = 32)

Parameters

byteLength int

Returns

string

CreateHashClaimValue(string, string)

Computes an OIDC hash claim value (at_hash / c_hash): the base64url-encoded left-most half of the digest of the ASCII token value, using the digest that matches the signing algorithm.

public static string CreateHashClaimValue(string value, string signingAlgorithm)

Parameters

value string
signingAlgorithm string

Returns

string

CreateS256CodeChallenge(string)

Computes the S256 PKCE code challenge for a verifier: base64url(SHA-256(ASCII(verifier))).

public static string CreateS256CodeChallenge(string codeVerifier)

Parameters

codeVerifier string

Returns

string

HashHandle(string)

Computes the SHA-256 hash of a handle for use as a storage key.

public static string HashHandle(string handle)

Parameters

handle string

Returns

string