我正在尝试使用Microsoft JWT Library。 我已经下载并编译了源代码,但是当我尝试运行它时,我有以下错误:
无法加载文件或程序集“ Microsoft.IdentityModel.Logging,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35 ”或其中一个依赖项。强名称签名无法验证。程序集可能已被篡改,或者是延迟签名但未使用正确的私钥完全签名。 (HRESULT异常:0x80131045)
这是测试代码:
uses
System.IdentityModel.Tokens.Jwt;
// ...
var Handler := new JwtSecurityTokenHandler;
var Payload := new JwtPayload;
var Header := new JwtHeader;
Header.Add (JwtHeaderParameterNames.X5c,
array of String (['x5c1', 'x5c2']));
var Token := Handler.WriteToken (new JwtSecurityToken (Header, Payload));
有谁知道如何取消签名或验证签名?
答案 0 :(得分:0)
Cloning the source code then compiling it and copying the assemblies wasn't successful. Therefore, using NuGet to install the assemblies is working.
NuGet command (in Visual Studio):
PM> Install-Package System.IdentityModel.Tokens.Jwt