<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.22.0" />

Microsoft.IdentityModel.Tokens.SecurityKey

public abstract class SecurityKey
Base class for Security Key.

Gets or sets CryptoProviderFactory.

public virtual string KeyId { get; set; }

Gets the key id of this SecurityKey.

public abstract int KeySize { get; }

This must be overridden to get the size of this SecurityKey.

public SecurityKey()

Default constructor

public virtual bool CanComputeJwkThumbprint()

Determines whether the SecurityKey can compute a JWK thumbprint.

public virtual byte[] ComputeJwkThumbprint()

Computes a sha256 hash over the SecurityKey.

public virtual bool IsSupportedAlgorithm(string algorithm)

Checks if CryptoProviderFactory can perform the cryptographic operation specified by the algorithm with this SecurityKey.