Table of Contents

Interface IJwtDecoder

Namespace
JWT
Assembly
Coherence.JWT.dll

Represents a JWT decoder.

public interface IJwtDecoder
Extension Methods

Methods

Decode(JwtParts, bool)

Given a JWT, decodes it and return the payload.

string Decode(JwtParts jwt, bool verify)

Parameters

jwt JwtParts

The JWT

verify bool

Whether to verify the signature (default is true)

Returns

string

A string containing the JSON payload

Decode(JwtParts, byte[], bool)

Given a JWT, decodes it and return the payload.

string Decode(JwtParts jwt, byte[] key, bool verify)

Parameters

jwt JwtParts

The JWT

key byte[]

The key that were used to sign the JWT

verify bool

Whether to verify the signature (default is true)

Returns

string

A string containing the JSON payload

Decode(JwtParts, byte[][], bool)

Given a JWT, decodes it and return the payload.

string Decode(JwtParts jwt, byte[][] keys, bool verify)

Parameters

jwt JwtParts

The JWT

keys byte[][]

The keys provided which one of them was used to sign the JWT

verify bool

Whether to verify the signature (default is true)

Returns

string

A string containing the JSON payload

DecodeHeader(string)

Given a JWT, decodes it and return the header.

string DecodeHeader(string token)

Parameters

token string

The JWT

Returns

string

DecodeHeader<T>(JwtParts)

Given a JWT, decodes it and return the header as an object.

T DecodeHeader<T>(JwtParts jwt)

Parameters

jwt JwtParts

The JWT

Returns

T

Type Parameters

T

DecodeToObject(Type, JwtParts, bool)

Given a JWT, decodes it and return the payload as an object.

object DecodeToObject(Type type, JwtParts jwt, bool verify)

Parameters

type Type

The type to deserialize to.

jwt JwtParts

The JWT

verify bool

Whether to verify the signature (default is true)

Returns

object

An object representing the payload

DecodeToObject(Type, JwtParts, byte[], bool)

Given a JWT, decodes it and return the payload as an object.

object DecodeToObject(Type type, JwtParts jwt, byte[] key, bool verify)

Parameters

type Type

The type to deserialize to.

jwt JwtParts

The JWT

key byte[]

The key that was used to sign the JWT

verify bool

Whether to verify the signature (default is true)

Returns

object

An object representing the payload

DecodeToObject(Type, JwtParts, byte[][], bool)

Given a JWT, decodes it and return the payload as an object.

object DecodeToObject(Type type, JwtParts jwt, byte[][] keys, bool verify)

Parameters

type Type

The type to deserialize to.

jwt JwtParts

The JWT

keys byte[][]

The keys which one of them was used to sign the JWT

verify bool

Whether to verify the signature (default is true)

Returns

object

An object representing the payload