Share via


JsonWebKey Class

Definition

Represents a JSON Web Key as defined in https://datatracker.ietf.org/doc/html/rfc7517.

public class JsonWebKey : Microsoft.IdentityModel.Tokens.SecurityKey
type JsonWebKey = class
    inherit SecurityKey
Public Class JsonWebKey
Inherits SecurityKey
Inheritance
JsonWebKey

Constructors

JsonWebKey()

Initializes an new instance of JsonWebKey.

JsonWebKey(String)

Initializes an new instance of JsonWebKey from a json string.

Properties

AdditionalData

When deserializing from JSON any properties that are not defined will be placed here.

Alg

Gets or sets the 'alg' (KeyType).

Crv

Gets or sets the 'crv' (ECC - Curve).

CryptoProviderFactory

Gets or sets CryptoProviderFactory.

(Inherited from SecurityKey)
D

Gets or sets the 'd' (ECC - Private Key OR RSA - Private Exponent).

DP

Gets or sets the 'dp' (RSA - First Factor CRT Exponent).

DQ

Gets or sets the 'dq' (RSA - Second Factor CRT Exponent).

E

Gets or sets the 'e' (RSA - Exponent).

HasPrivateKey

Gets a bool indicating if a private key exists.

K

Gets or sets the 'k' (Symmetric - Key Value).

KeyId

Gets the key id of this JsonWebKey.

KeyOps

Gets the 'key_ops' (Key Operations).

KeySize

Gets the key size of JsonWebKey.

Kid

Gets or sets the 'kid' (Key ID)..

Kty

Gets or sets the 'kty' (Key Type).

N

Gets or sets the 'n' (RSA - Modulus).

Oth

Gets or sets the 'oth' (RSA - Other Primes Info).

P

Gets or sets the 'p' (RSA - First Prime Factor)..

Q

Gets or sets the 'q' (RSA - Second Prime Factor)..

QI

Gets or sets the 'qi' (RSA - First CRT Coefficient)..

Use

Gets or sets the 'use' (Public Key Use)..

X

Gets or sets the 'x' (ECC - X Coordinate)..

X5c

Gets the 'x5c' collection (X.509 Certificate Chain)..

X5t

Gets or sets the 'x5t' (X.509 Certificate SHA-1 thumbprint)..

X5tS256

Gets or sets the 'x5t#S256' (X.509 Certificate SHA-256 thumbprint)..

X5u

Gets or sets the 'x5u' (X.509 URL)..

Y

Gets or sets the 'y' (ECC - Y Coordinate)..

Methods

CanComputeJwkThumbprint()

Determines whether the JsonWebKey can compute a JWK thumbprint.

ComputeJwkThumbprint()

Computes the JWK thumprint per spec: https://datatracker.ietf.org/doc/html/rfc7638 />.

Create(String)

Returns a new instance of JsonWebKey.

IsSupportedAlgorithm(String)

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

(Inherited from SecurityKey)
ToString()

Returns the formatted string: GetType(), Use: 'value', Kid: 'value', Kty: 'value', InternalId: 'value'.

Applies to