JWT.Standard
3.0.0.3
.NET Standard 2.0
Install-Package JWT.Standard -Version 3.0.0.3
dotnet add package JWT.Standard --version 3.0.0.3
<PackageReference Include="JWT.Standard" Version="3.0.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JWT.Standard --version 3.0.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JWT.Standard, 3.0.0.3"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install JWT.Standard as a Cake Addin
#addin nuget:?package=JWT.Standard&version=3.0.0.3
// Install JWT.Standard as a Cake Tool
#tool nuget:?package=JWT.Standard&version=3.0.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
JWT
JWT.Net
Create Signature
var password = Guid.NewGuid().ToString("N");
var jwtp1 = new JWTPackage("yswenli",
"jwt test",
"everyone",
DateTimeHelper.Now.AddMinutes(3).GetTimeStamp().ToString(),
DateTimeHelper.Now.ToString(), DateTimeHelper.Now.ToString(),
Guid.NewGuid().ToString("N"),
password);
var sign = jwtp1.GetBearerToken();
var password = Guid.NewGuid().ToString("N");
var jwtp1 = new JWTPackage<User>(new User()
{
Id = "1",
Name = "yswenli",
Role = "Admin"
}, 180, password);
var sign = jwtp1.GetBearerToken();
Valide
JWTPackage jwtp2 = null;
try
{
jwtp2 = JWTPackage.Parse(sign, password);
}
catch (IllegalTokenException iex)
{
Console.WriteLine($"解析失败:{iex.Message}");
}
catch (TokenExpiredException tex)
{
Console.WriteLine($"解析失败:{tex.Message}");
}
catch (SignatureVerificationException sex)
{
Console.WriteLine($"解析失败:{sex.Message}");
}
catch (Exception ex)
{
Console.WriteLine($"解析失败:{ex.Message}");
}
if (jwtp2 != null)
Console.WriteLine($"jwtp2.data:{jwtp2.Payload.Data}");
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows |
.NET Core | netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.0 netstandard2.1 |
.NET Framework | net461 net462 net463 net47 net471 net472 net48 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen40 tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- System.Reflection.Emit.Lightweight (>= 4.7.0)
- System.Security.Permissions (>= 4.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on JWT.Standard:
Repository | Stars |
---|---|
yswenli/SAEA
SAEA.Socket is a high-performance IOCP framework TCP based on dotnet standard 2.0; Src contains its application test scenarios, such as websocket,rpc, redis driver, MVC WebAPI, lightweight message server, ultra large file transmission, etc. SAEA.Socket是一个高性能IOCP框架的 TCP,基于dotnet standard 2.0;Src中含有其应用测试场景,例如websocket、rpc、redis驱动、MVC WebAPI、轻量级消息服务器、超大文件传输等
|
JWT.Standard a JWT (JSON Web Token) implementation for .NET
source site:https://github.com/cnwenli/JWT.Net