Table of Contents

Class KeyContainer

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

A managed signing key and its metadata, whatever kind of key it is. Duende's KeyContainer.

public abstract class KeyContainer
Inheritance
KeyContainer
Derived
Inherited Members

Remarks

RSA (RsaKeyContainer), EC (EcKeyContainer), or RSA wrapped in a self-signed certificate (X509KeyContainer), one per algorithm in KeyManagementOptions.SigningAlgorithms. Until 0.137.0 there was only the RSA container, so automatic key management could sign with one RSA algorithm.

Constructors

KeyContainer(string, string, DateTime)

Sets the metadata every kind of key shares.

protected KeyContainer(string id, string algorithm, DateTime created)

Parameters

id string

The key id (kid).

algorithm string

The signing algorithm, such as RS256.

created DateTime

When the key was created (UTC).

Exceptions

ArgumentException

id or algorithm is null or empty.

Properties

Algorithm

The signing algorithm (e.g. RS256, ES256).

public string Algorithm { get; }

Property Value

string

Created

When the key was created (UTC).

public DateTime Created { get; }

Property Value

DateTime

HasX509Certificate

Whether the key is wrapped in an X.509 certificate, published as x5c.

public virtual bool HasX509Certificate { get; }

Property Value

bool

Id

The key id (kid).

public string Id { get; }

Property Value

string

Methods

ToPublicJsonWebKey()

Produces the public JSON Web Key used for the JWKS and token validation.

public abstract JsonWebKey ToPublicJsonWebKey()

Returns

JsonWebKey

ToSecurityKey()

The key, private half included, as the token handler signs with it.

public abstract SecurityKey ToSecurityKey()

Returns

SecurityKey

ToSigningCredentials()

Creates signing credentials backed by the full (private) key.

public SigningCredentials ToSigningCredentials()

Returns

SigningCredentials