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
idstringThe key id (
kid).algorithmstringThe signing algorithm, such as
RS256.createdDateTimeWhen the key was created (UTC).
Exceptions
- ArgumentException
idoralgorithmis null or empty.
Properties
Algorithm
The signing algorithm (e.g. RS256, ES256).
public string Algorithm { get; }
Property Value
Created
When the key was created (UTC).
public DateTime Created { get; }
Property Value
HasX509Certificate
Whether the key is wrapped in an X.509 certificate, published as x5c.
public virtual bool HasX509Certificate { get; }
Property Value
Id
The key id (kid).
public string Id { get; }
Property Value
Methods
ToPublicJsonWebKey()
Produces the public JSON Web Key used for the JWKS and token validation.
public abstract JsonWebKey ToPublicJsonWebKey()
Returns
ToSecurityKey()
The key, private half included, as the token handler signs with it.
public abstract SecurityKey ToSecurityKey()
Returns
ToSigningCredentials()
Creates signing credentials backed by the full (private) key.
public SigningCredentials ToSigningCredentials()