C# Класс JWT.JsonWebToken

Provides methods for encoding and decoding JSON Web Tokens.
Показать файл Открыть проект

Открытые методы

Метод Описание
Decode ( string token, string key, bool verify = true ) : string

Creates a JWT given a payload, the signing key, and the algorithm to use.

Given a JWT, decode it and return the JSON payload.

DecodeToObject ( string token, string key, bool verify = true ) : object

Given a JWT, decode it and return the payload as an object (by deserializing it with System.Web.Script.Serialization.JavaScriptSerializer).

Приватные методы

Метод Описание
Base64UrlDecode ( string input ) : byte[]
Base64UrlEncode ( byte input ) : string
CreateHMACVerifier ( HMAC>.Func hmacFac ) : Func
GetHashAlgorithm ( string algorithm ) : JwtHashAlgorithm
JsonWebToken ( ) : System
VerifyRSAHash ( string algorithm ) : Func

Описание методов

Decode() публичный статический Метод

Creates a JWT given a payload, the signing key, and the algorithm to use. Given a JWT, decode it and return the JSON payload.
Thrown if the verify parameter was true and the signature was NOT valid or if the JWT was signed with an unsupported algorithm.
public static Decode ( string token, string key, bool verify = true ) : string
token string The JWT.
key string The key used to sign the token.
verify bool Whether to verify the signature (default is true).
Результат string

DecodeToObject() публичный статический Метод

Given a JWT, decode it and return the payload as an object (by deserializing it with System.Web.Script.Serialization.JavaScriptSerializer).
Thrown if the verify parameter was true and the signature was NOT valid or if the JWT was signed with an unsupported algorithm.
public static DecodeToObject ( string token, string key, bool verify = true ) : object
token string The JWT.
key string The key that was used to sign the JWT.
verify bool Whether to verify the signature (default is true).
Результат object