Show / Hide Table of Contents

    Class JsonWebToken

    Represents a simple implementation of JSON Web Token that is based on the standard RFC 7519 method for communicating claims securely between two parties. This class cannot be inherited.

    Inheritance
    System.Object
    JsonWebToken
    Namespace: Cuemon.Security.Web
    Assembly: Cuemon.Security.dll
    Syntax
    public sealed class JsonWebToken

    Constructors

    | Improve this Doc

    JsonWebToken(JsonWebTokenHeader, JsonWebTokenPayload)

    Initializes a new instance of the JsonWebToken class that is .

    Declaration
    public JsonWebToken(JsonWebTokenHeader header, JsonWebTokenPayload payload)
    Parameters
    Type Name Description
    JsonWebTokenHeader header

    The first part of the JSON Web Token; the header information.

    JsonWebTokenPayload payload

    The second part of the JSON Web Token; the payload information.

    | Improve this Doc

    JsonWebToken(JsonWebTokenHeader, JsonWebTokenPayload, Byte[])

    Initializes a new instance of the JsonWebToken class.

    Declaration
    public JsonWebToken(JsonWebTokenHeader header, JsonWebTokenPayload payload, byte[] secret)
    Parameters
    Type Name Description
    JsonWebTokenHeader header

    The first part of the JSON Web Token; the header information.

    JsonWebTokenPayload payload

    The second part of the JSON Web Token; the payload information.

    System.Byte[] secret

    The optional secret that is used in the last part of the JSON Web Token; the signature.

    | Improve this Doc

    JsonWebToken(String, String, JsonWebTokenHashAlgorithm, Byte[])

    Initializes a new instance of the JsonWebToken class.

    Declaration
    public JsonWebToken(string base64UrlEncodedHeader, string base64UrlEncodedPayload, JsonWebTokenHashAlgorithm algorithm, byte[] secret)
    Parameters
    Type Name Description
    System.String base64UrlEncodedHeader

    The header information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    System.String base64UrlEncodedPayload

    The payload information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    JsonWebTokenHashAlgorithm algorithm

    The JsonWebTokenHashAlgorithm to use when signing the JSON Web Token.

    System.Byte[] secret

    The secret that is used when signing the JSON Web Token.

    Properties

    | Improve this Doc

    Algorithm

    Gets the JsonWebTokenHashAlgorithm of this JWT.

    Declaration
    public JsonWebTokenHashAlgorithm Algorithm { get; }
    Property Value
    Type Description
    JsonWebTokenHashAlgorithm

    The JsonWebTokenHashAlgorithm of this JWT.

    | Improve this Doc

    Base64UrlEncodedHeader

    Gets the header information of this JWT.

    Declaration
    public string Base64UrlEncodedHeader { get; }
    Property Value
    Type Description
    System.String

    The header information of this JWT.

    | Improve this Doc

    Base64UrlEncodedPayload

    Gets the payload information of this JWT.

    Declaration
    public string Base64UrlEncodedPayload { get; }
    Property Value
    Type Description
    System.String

    The payload information of this JWT.

    | Improve this Doc

    Secret

    Gets the secret (if any) of this JWT.

    Declaration
    public byte[] Secret { get; }
    Property Value
    Type Description
    System.Byte[]

    The secret (if any) of this JWT.

    Methods

    | Improve this Doc

    ComputeSignature()

    Computes the signature of the JSON Web Token.

    Declaration
    public string ComputeSignature()
    Returns
    Type Description
    System.String

    A System.String that represent the signature of a JSON Web Token.

    | Improve this Doc

    ComputeSignature(String)

    Computes the signature of the JSON Web Token.

    Declaration
    public string ComputeSignature(string base64UrlEncodedHeader)
    Parameters
    Type Name Description
    System.String base64UrlEncodedHeader

    The header information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    Returns
    Type Description
    System.String

    A System.String that represent the signature of a JSON Web Token.

    | Improve this Doc

    ComputeSignature(String, String)

    Computes the signature of the JSON Web Token.

    Declaration
    public string ComputeSignature(string base64UrlEncodedHeader, string base64UrlEncodedPayload)
    Parameters
    Type Name Description
    System.String base64UrlEncodedHeader

    The header information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    System.String base64UrlEncodedPayload

    The payload information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    Returns
    Type Description
    System.String

    A System.String that represent the signature of a JSON Web Token.

    | Improve this Doc

    ComputeSignature(String, String, JsonWebTokenHashAlgorithm)

    Computes the signature of the JSON Web Token.

    Declaration
    public string ComputeSignature(string base64UrlEncodedHeader, string base64UrlEncodedPayload, JsonWebTokenHashAlgorithm algorithm)
    Parameters
    Type Name Description
    System.String base64UrlEncodedHeader

    The header information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    System.String base64UrlEncodedPayload

    The payload information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    JsonWebTokenHashAlgorithm algorithm

    The JsonWebTokenHashAlgorithm to use when signing the JSON Web Token.

    Returns
    Type Description
    System.String

    A System.String that represent the signature of a JSON Web Token.

    | Improve this Doc

    ComputeSignature(String, String, JsonWebTokenHashAlgorithm, Byte[])

    Computes the signature of the JSON Web Token.

    Declaration
    public string ComputeSignature(string base64UrlEncodedHeader, string base64UrlEncodedPayload, JsonWebTokenHashAlgorithm algorithm, byte[] secret)
    Parameters
    Type Name Description
    System.String base64UrlEncodedHeader

    The header information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    System.String base64UrlEncodedPayload

    The payload information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    JsonWebTokenHashAlgorithm algorithm

    The JsonWebTokenHashAlgorithm to use when signing the JSON Web Token.

    System.Byte[] secret

    The secret that is used when signing the JSON Web Token.

    Returns
    Type Description
    System.String

    A System.String that represent the signature of a JSON Web Token.

    | Improve this Doc

    Tokenize()

    Assemble the specified Base64UrlEncodedHeader and Base64UrlEncodedPayload to represent the first and second part of the JSON Web Token.

    Declaration
    public string Tokenize()
    Returns
    Type Description
    System.String

    A System.String that represent a partial JSON Web Token that does not include the signature information.

    | Improve this Doc

    Tokenize(String, String)

    Assemble the specified base64UrlEncodedHeader and base64UrlEncodedPayload to represent the first and second part of the JSON Web Token.

    Declaration
    public string Tokenize(string base64UrlEncodedHeader, string base64UrlEncodedPayload)
    Parameters
    Type Name Description
    System.String base64UrlEncodedHeader

    The header information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    System.String base64UrlEncodedPayload

    The payload information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    Returns
    Type Description
    System.String

    A System.String that represent a partial JSON Web Token that does not include the signature information.

    | Improve this Doc

    ToString()

    Returns a System.String that represents this instance.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    A System.String that represents this instance.

    Overrides
    System.Object.ToString()
    Remarks

    Calling this method provides the actual JSON Web Token.

    | Improve this Doc

    ToString(String)

    Returns a System.String that represents this instance.

    Declaration
    public string ToString(string base64UrlEncodedHeader)
    Parameters
    Type Name Description
    System.String base64UrlEncodedHeader

    The header information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    Returns
    Type Description
    System.String

    A System.String that represents this instance.

    | Improve this Doc

    ToString(String, String)

    Returns a System.String that represents this instance.

    Declaration
    public string ToString(string base64UrlEncodedHeader, string base64UrlEncodedPayload)
    Parameters
    Type Name Description
    System.String base64UrlEncodedHeader

    The header information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    System.String base64UrlEncodedPayload

    The payload information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    Returns
    Type Description
    System.String

    A System.String that represents this instance.

    | Improve this Doc

    ToString(String, String, JsonWebTokenHashAlgorithm)

    Returns a System.String that represents this instance.

    Declaration
    public string ToString(string base64UrlEncodedHeader, string base64UrlEncodedPayload, JsonWebTokenHashAlgorithm algorithm)
    Parameters
    Type Name Description
    System.String base64UrlEncodedHeader

    The header information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    System.String base64UrlEncodedPayload

    The payload information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    JsonWebTokenHashAlgorithm algorithm

    The JsonWebTokenHashAlgorithm to use when signing the JSON Web Token.

    Returns
    Type Description
    System.String

    A System.String that represents this instance.

    | Improve this Doc

    ToString(String, String, JsonWebTokenHashAlgorithm, Byte[])

    Returns a System.String that represents this instance.

    Declaration
    public string ToString(string base64UrlEncodedHeader, string base64UrlEncodedPayload, JsonWebTokenHashAlgorithm algorithm, byte[] secret)
    Parameters
    Type Name Description
    System.String base64UrlEncodedHeader

    The header information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    System.String base64UrlEncodedPayload

    The payload information of the JSON Web Token; encoded as a Base64 structure usable for transmission on the URL.

    JsonWebTokenHashAlgorithm algorithm

    The JsonWebTokenHashAlgorithm to use when signing the JSON Web Token.

    System.Byte[] secret

    The secret that is used when signing the JSON Web Token.

    Returns
    Type Description
    System.String

    A System.String that represents this instance.

    Extension Methods

    ConverterExtensions.ParseWith<TSource, TResult>(TSource, Func<TSource, TResult>)
    ConverterExtensions.ParseWith<TSource, T, TResult>(TSource, Func<TSource, T, TResult>, T)
    ConverterExtensions.ParseWith<TSource, T1, T2, TResult>(TSource, Func<TSource, T1, T2, TResult>, T1, T2)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, TResult>(TSource, Func<TSource, T1, T2, T3, TResult>, T1, T2, T3)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, TResult>(TSource, Func<TSource, T1, T2, T3, T4, TResult>, T1, T2, T3, T4)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, TResult>, T1, T2, T3, T4, T5)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, TResult>, T1, T2, T3, T4, T5, T6)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>, T1, T2, T3, T4, T5, T6, T7)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>, T1, T2, T3, T4, T5, T6, T7, T8)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>, T1, T2, T3, T4, T5, T6, T7, T8, T9)
    ConverterExtensions.As<TResult>(Object)
    ConverterExtensions.As<TResult>(Object, TResult)
    ConverterExtensions.As<TResult>(Object, TResult, IFormatProvider)
    DelegateUtilityExtensions.Wrap<TResult>(TResult)
    DelegateUtilityExtensions.DynamicWrap<TResult>(TResult)
    TweakerExtensions.Adjust<T>(T, Func<T, T>)
    TypeUtilityExtensions.Is<T>(Object)
    TypeUtilityExtensions.IsNot<T>(Object)
    TypeUtilityExtensions.IsNullable<T>(T)
    WrapperExtensions.UseWrapper<T>(T, Action<IDictionary<String, Object>>)
    WrapperExtensions.UseWrapper<T>(T, MemberInfo, Action<IDictionary<String, Object>>)
    EnumerableUtilityExtensions.Yield<TSource>(TSource)
    HashUtilityExtensions.ComputeHash(Object, Action<HashOptions>)
    HmacUtilityExtensions.ComputeKeyedHash(Object, Byte[], Action<KeyedHashOptions>)
    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX