Show / Hide Table of Contents

Class TokenSecurity

JWT Security.

Inheritance
object
TokenSecurity
Implements
ITokenSecurity
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: ComponentSpace.OpenID.Security
Assembly: ComponentSpace.OpenID.dll
Syntax
public class TokenSecurity : ITokenSecurity

Constructors

TokenSecurity(ICertificateLoader, CertificateValidators, ILoggerFactory)

Initializes a new instance of the TokenSecurity class.

Declaration
public TokenSecurity(ICertificateLoader certificateLoader, CertificateValidators certificateValidators, ILoggerFactory loggerFactory)
Parameters
Type Name Description
ICertificateLoader certificateLoader

The certificate loader.

CertificateValidators certificateValidators

The certificate validators.

ILoggerFactory loggerFactory

The logger factory.

Properties

ClientConfiguration

Gets or sets the client configuration.

Declaration
public virtual ClientConfiguration? ClientConfiguration { get; set; }
Property Value
Type Description
ClientConfiguration

The client configuration.

ProviderConfiguration

Gets or sets the provider configuration.

Declaration
public virtual ProviderConfiguration? ProviderConfiguration { get; set; }
Property Value
Type Description
ProviderConfiguration

The provider configuration.

Methods

CreateTokenAsync(SecurityTokenDescriptor)

Creates a token.

Declaration
public virtual Task<string> CreateTokenAsync(SecurityTokenDescriptor securityTokenDescriptor)
Parameters
Type Name Description
SecurityTokenDescriptor securityTokenDescriptor

The security token descriptor.

Returns
Type Description
Task<string>

A task that represents the operation and returns the signing credentials.

GetEncryptingCredentialsAsync()

Get the encrypting credentials.

Declaration
public virtual Task<EncryptingCredentials> GetEncryptingCredentialsAsync()
Returns
Type Description
Task<EncryptingCredentials>

A task that represents the operation and returns the encrypting credentials.

GetIssuerSigningKeysAsync(bool, bool)

Gets the issuer signing keys.

Declaration
public virtual Task<IList<SecurityKey>> GetIssuerSigningKeysAsync(bool includePublicKeys = false, bool includeSymmetricKeys = false)
Parameters
Type Name Description
bool includePublicKeys

The flag indicating whether to include asymmetric public keys.

bool includeSymmetricKeys

The flag indicating whether to include symmetric keys.

Returns
Type Description
Task<IList<SecurityKey>>

A task that represents the operation and returns the signing keys.

GetSigningCredentialsAsync()

Get the signing credentials.

Declaration
public virtual Task<SigningCredentials> GetSigningCredentialsAsync()
Returns
Type Description
Task<SigningCredentials>

A task that represents the operation and returns the signing credentials.

GetTokenDecryptionKeysAsync(bool, bool)

Gets the token decryption keys.

Declaration
public virtual Task<IList<SecurityKey>> GetTokenDecryptionKeysAsync(bool includePrivateKeys = false, bool includeSymmetricKeys = false)
Parameters
Type Name Description
bool includePrivateKeys

The flag indicating whether to include asymmetric private keys.

bool includeSymmetricKeys

The flag indicating whether to include symmetric keys.

Returns
Type Description
Task<IList<SecurityKey>>

A task that represents the operation and returns the decryption keys.

ReadToken(string)

Reads a token.

Declaration
public virtual JsonWebToken ReadToken(string token)
Parameters
Type Name Description
string token

The token string.

Returns
Type Description
JsonWebToken

The token.

ValidateTokenAsync(string, TokenValidationParameters)

Validates a token.

Declaration
public virtual Task<TokenValidationResult> ValidateTokenAsync(string token, TokenValidationParameters tokenValidationParameters)
Parameters
Type Name Description
string token

The token.

TokenValidationParameters tokenValidationParameters

The token validation parameters.

Returns
Type Description
Task<TokenValidationResult>

A task that represents the operation and returns the token validation result.

Implements

ITokenSecurity
In this article
Back to top Copyright © ComponentSpace Pty Ltd 2022-2026. All rights reserved.