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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
verifyboolWhether 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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
keybyte[]The key that was used to sign the JWT
verifyboolWhether 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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
keysbyte[][]The keys that were used to sign the JWT
verifyboolWhether 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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
keystringThe key that was used to sign the JWT
verifyboolWhether 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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
keysstring[]The key which one of them was used to sign the JWT
verifyboolWhether 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
decoderIJwtDecodertokenstring
Returns
DecodeHeader<T>(IJwtDecoder, string)
public static T DecodeHeader<T>(this IJwtDecoder decoder, string token)
Parameters
decoderIJwtDecodertokenstring
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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
verifyboolWhether 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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
keybyte[]The key that was used to sign the JWT
verifyboolWhether 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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
keysbyte[][]The keys that were used to sign the JWT
verifyboolWhether 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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
keystringThe key that was used to sign the JWT
verifyboolWhether 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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
keysstring[]The keys provided which one of them was used to sign the JWT
verifyboolWhether 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
decoderIJwtDecoderThe decoder instance
typeTypeThe type to deserialize to.
tokenstringThe JWT
keybyte[]The key that was used to sign the JWT
verifyboolWhether 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
decoderIJwtDecoderThe decoder instance
typeTypeThe type to deserialize to.
tokenstringThe JWT
keysbyte[][]The keys that were used to sign the JWT
verifyboolWhether 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
decoderIJwtDecoderThe decoder instance
typeTypeThe type to deserialize to.
tokenstringThe JWT
keystringThe key that was used to sign the JWT
verifyboolWhether 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
decoderIJwtDecoderThe decoder instance
typeTypeThe type to deserialize to.
tokenstringThe JWT
keysstring[]The key which one of them was used to sign the JWT
verifyboolWhether 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
decoderIJwtDecoderThe decoder instance
jwtJwtPartsThe JWT
verifyboolWhether to verify the signature (default is
true)
Returns
- T
An object representing the payload
Type Parameters
TThe 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
decoderIJwtDecoderThe decoder instance
jwtJwtPartsThe JWT
keybyte[]The key that was used to sign the JWT
verifyboolWhether to verify the signature (default is
true)
Returns
- T
An object representing the payload
Type Parameters
TThe 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
decoderIJwtDecoderThe decoder instance
jwtJwtPartsThe JWT
keysbyte[][]The keys which one of them was used to sign the JWT
verifyboolWhether to verify the signature (default is
true)
Returns
- T
An object representing the payload
Type Parameters
TThe 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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
Returns
- T
An object representing the payload
Type Parameters
TThe 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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
keybyte[]The key that was used to sign the JWT
verifyboolWhether to verify the signature (default is
true)
Returns
- T
An object representing the payload
Type Parameters
TThe 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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
keysbyte[][]The keys provided which one of them was used to sign the JWT
verifyboolWhether to verify the signature (default is
true)
Returns
- T
An object representing the payload
Type Parameters
TThe 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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
keystringThe key that was used to sign the JWT
verifyboolWhether to verify the signature (default is
true)
Returns
- T
An object representing the payload
Type Parameters
TThe 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
decoderIJwtDecoderThe decoder instance
tokenstringThe JWT
keysstring[]The keys provided which one of them was used to sign the JWT
verifyboolWhether to verify the signature (default is
true)
Returns
- T
An object representing the payload
Type Parameters
TThe type to return