Class JwtDecoderExtensions
- Namespace
- JWT
- Assembly
- Coherence.JWT.dll
Extension methods for IJwtDecoder>
public static class JwtDecoderExtensions
- Inheritance
-
JwtDecoderExtensions
Methods
Decode(IJwtDecoder, string, bool)
Given a JWT, decodes it and return the payload.
public static string Decode(this IJwtDecoder decoder, string token, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- string
A string containing the JSON payload
Exceptions
Decode(IJwtDecoder, string, byte[], bool)
Given a JWT, decodes it, and return the payload.
public static string Decode(this IJwtDecoder decoder, string token, byte[] key, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
key
byte[]The key that was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- string
A string containing the JSON payload
Exceptions
Decode(IJwtDecoder, string, byte[][], bool)
Given a JWT, decodes it, and return the payload.
public static string Decode(this IJwtDecoder decoder, string token, byte[][] keys, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
keys
byte[][]The keys that were used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- string
A string containing the JSON payload
Exceptions
Decode(IJwtDecoder, string, string, bool)
Given a JWT, decodes it, and return the payload as an dictionary.
public static string Decode(this IJwtDecoder decoder, string token, string key, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
key
stringThe key that was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- string
An object representing the payload
Exceptions
Decode(IJwtDecoder, string, string[], bool)
Given a JWT, decodes it, and return the payload as an dictionary.
public static string Decode(this IJwtDecoder decoder, string token, string[] keys, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
keys
string[]The key which one of them was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- string
An object representing the payload
Exceptions
DecodeHeaderToDictionary(IJwtDecoder, string)
public static IDictionary<string, string> DecodeHeaderToDictionary(this IJwtDecoder decoder, string token)
Parameters
decoder
IJwtDecodertoken
string
Returns
DecodeHeader<T>(IJwtDecoder, string)
public static T DecodeHeader<T>(this IJwtDecoder decoder, string token)
Parameters
decoder
IJwtDecodertoken
string
Returns
- T
Type Parameters
T
DecodeToObject(IJwtDecoder, string, bool)
Given a JWT, decodes it and return the payload as a dictionary.
public static IDictionary<string, object> DecodeToObject(this IJwtDecoder decoder, string token, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- IDictionary<string, object>
An object representing the payload
DecodeToObject(IJwtDecoder, string, byte[], bool)
Given a JWT, decodes it and return the payload as a dictionary.
public static IDictionary<string, object> DecodeToObject(this IJwtDecoder decoder, string token, byte[] key, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
key
byte[]The key that was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- IDictionary<string, object>
An object representing the payload
Exceptions
DecodeToObject(IJwtDecoder, string, byte[][], bool)
Given a JWT, decodes it and return the payload as a dictionary.
public static IDictionary<string, object> DecodeToObject(this IJwtDecoder decoder, string token, byte[][] keys, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
keys
byte[][]The keys that were used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- IDictionary<string, object>
A string containing the JSON payload
Exceptions
DecodeToObject(IJwtDecoder, string, string, bool)
Given a JWT, decodes it and return the payload as a dictionary.
public static IDictionary<string, object> DecodeToObject(this IJwtDecoder decoder, string token, string key, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
key
stringThe key that was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- IDictionary<string, object>
An object representing the payload
DecodeToObject(IJwtDecoder, string, string[], bool)
Given a JWT, decodes it and return the payload as a dictionary.
public static IDictionary<string, object> DecodeToObject(this IJwtDecoder decoder, string token, string[] keys, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
keys
string[]The keys provided which one of them was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- IDictionary<string, object>
An object representing the payload
DecodeToObject(IJwtDecoder, Type, string, byte[], bool)
Given a JWT, decodes it and return the payload as a dictionary.
public static object DecodeToObject(this IJwtDecoder decoder, Type type, string token, byte[] key, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
type
TypeThe type to deserialize to.
token
stringThe JWT
key
byte[]The key that was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- object
An object representing the payload
Exceptions
DecodeToObject(IJwtDecoder, Type, string, byte[][], bool)
Given a JWT, decodes it and return the payload as a dictionary.
public static object DecodeToObject(this IJwtDecoder decoder, Type type, string token, byte[][] keys, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
type
TypeThe type to deserialize to.
token
stringThe JWT
keys
byte[][]The keys that were used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- object
A string containing the JSON payload
Exceptions
DecodeToObject(IJwtDecoder, Type, string, string, bool)
Given a JWT, decodes it and return the payload as an dictionary.
public static object DecodeToObject(this IJwtDecoder decoder, Type type, string token, string key, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
type
TypeThe type to deserialize to.
token
stringThe JWT
key
stringThe key that was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- object
An object representing the payload
Exceptions
DecodeToObject(IJwtDecoder, Type, string, string[], bool)
Given a JWT, decodes it and return the payload as an dictionary.
public static object DecodeToObject(this IJwtDecoder decoder, Type type, string token, string[] keys, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
type
TypeThe type to deserialize to.
token
stringThe JWT
keys
string[]The key which one of them was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- object
An object representing the payload
Exceptions
DecodeToObject<T>(IJwtDecoder, JwtParts, bool)
Given a JWT, decodes it and return the payload as an object.
public static T DecodeToObject<T>(this IJwtDecoder decoder, JwtParts jwt, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
jwt
JwtPartsThe JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- T
An object representing the payload
Type Parameters
T
The type to deserialize to.
DecodeToObject<T>(IJwtDecoder, JwtParts, byte[], bool)
Given a JWT, decodes it and return the payload as an object.
public static T DecodeToObject<T>(this IJwtDecoder decoder, JwtParts jwt, byte[] key, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
jwt
JwtPartsThe JWT
key
byte[]The key that was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- T
An object representing the payload
Type Parameters
T
The type to deserialize to.
DecodeToObject<T>(IJwtDecoder, JwtParts, byte[][], bool)
Given a JWT, decodes it and return the payload as an object.
public static T DecodeToObject<T>(this IJwtDecoder decoder, JwtParts jwt, byte[][] keys, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
jwt
JwtPartsThe JWT
keys
byte[][]The keys which one of them was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- T
An object representing the payload
Type Parameters
T
The type to deserialize to.
DecodeToObject<T>(IJwtDecoder, string)
Given a JWT, decodes it and return the payload as an object.
public static T DecodeToObject<T>(this IJwtDecoder decoder, string token)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
Returns
- T
An object representing the payload
Type Parameters
T
The type to return
DecodeToObject<T>(IJwtDecoder, string, byte[], bool)
Given a JWT, decodes it and return the payload as an object.
public static T DecodeToObject<T>(this IJwtDecoder decoder, string token, byte[] key, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
key
byte[]The key that was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- T
An object representing the payload
Type Parameters
T
The type to return
DecodeToObject<T>(IJwtDecoder, string, byte[][], bool)
Given a JWT, decodes it and return the payload as an object.
public static T DecodeToObject<T>(this IJwtDecoder decoder, string token, byte[][] keys, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
keys
byte[][]The keys provided which one of them was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- T
An object representing the payload
Type Parameters
T
The type to return
DecodeToObject<T>(IJwtDecoder, string, string, bool)
Given a JWT, decodes it and return the payload as an object.
public static T DecodeToObject<T>(this IJwtDecoder decoder, string token, string key, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
key
stringThe key that was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- T
An object representing the payload
Type Parameters
T
The type to return
DecodeToObject<T>(IJwtDecoder, string, string[], bool)
Given a JWT, decodes it and return the payload as an object.
public static T DecodeToObject<T>(this IJwtDecoder decoder, string token, string[] keys, bool verify = true)
Parameters
decoder
IJwtDecoderThe decoder instance
token
stringThe JWT
keys
string[]The keys provided which one of them was used to sign the JWT
verify
boolWhether to verify the signature (default is
true
)
Returns
- T
An object representing the payload
Type Parameters
T
The type to return