请求的功能未实现 - JwtSecurityTokenHandler.WriteToken(RS256)在MAC

时间:2015-08-18 15:32:03

标签: c# macos xamarin

我正在使用Xamarin构建MAC应用程序。当我尝试使用JwtSecurityTokenHandler和JwtSecurityToken生成JWT令牌时遇到异常。具体来说,我正在使用在MAC上失败的JwtSecurityTokenHandler.WriteToken(令牌)API。使用Visual Studio 2012(.NET framework 4.5)在Windows上使用相同的API。

WriteToken MSDN文档: msdn.microsoft.com/en-us/library/system.identitymodel.tokens.jwtsecuritytokenhandler.writetoken(V = vs.114)的.aspx

使用的非对称密钥算法是RSA-SHA256。

MAC代码失败,出现以下异常:

异常详细信息:

IDX10618:AsymmetricSecurityKey.GetHashAlgorithmForSignature(' http://www.w3.org/2001/04/xmldsig-more#rsa-sha256')引发了异常。 AsymmetricSecurityKey:' System.IdentityModel.Tokens.RsaSecurityKey' SignatureAlgorithm:' http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',检查以确保支持SignatureAlgorithm。 例外:' System.NotImplementedException:未实现请求的功能。 在/private/tmp/source-mono-mac-4.0.0-branch-c5sr3/bockbuild-mono-4.0.0-branch/profiles中的System.IdentityModel.Tokens.RsaSecurityKey.GetHashAlgorithmForSignature(System.String算法)[0x00000] /mono-mac-xamarin/build-root/mono-4.0.3/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/RsaSecurityKey.cs:58 在System.IdentityModel.Tokens.AsymmetricSignatureProvider..ctor(System.IdentityModel.Tokens.AsymmetricSecurityKey key,System.String algorithm,Boolean willCreateSignatures)[0x00101] in:0'。

有没有人使用Xamarin在MAC上使用RS256的JwtSecurityTokenHandler.WriteToken(令牌)API?

0 个答案:

没有答案