asp.net-core – CoreCLR中的哈希算法
发布时间:2020-05-24 02:24:44 所属栏目:asp.Net 来源:互联网
导读:我正在尝试在我的coreclr项目中使用这个 class,但是似乎找不到SHA256Managed的正确包.我已经尝试使用System.Security.Cryptography.Algorithms“:”4.0.0-beta-23409“,但它不包含SHA2565Managed的实现.还有其他替代方案来计算coreclr中的哈希值? 您可以使
|
我正在尝试在我的coreclr项目中使用这个 class,但是似乎找不到SHA256Managed的正确包.我已经尝试使用System.Security.Cryptography.Algorithms“:”4.0.0-beta-23409“,但它不包含SHA2565Managed的实现.还有其他替代方案来计算coreclr中的哈希值? 解决方法您可以使用SHA256.Create()(从System.Security.Cryptography.Algorithms):using (var algorithm = SHA256.Create())
{
// Create the at_hash using the access token returned by CreateAccessTokenAsync.
var hash = algorithm.ComputeHash(Encoding.ASCII.GetBytes(response.AccessToken));
// Note: only the left-most half of the hash of the octets is used.
// See http://openid.net/specs/openid-connect-core-1_0.html#CodeIDToken
identity.AddClaim(JwtRegisteredClaimNames.AtHash,Base64UrlEncoder.Encode(hash,hash.Length / 2));
} (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 如何避免异常捕获.NET中的复制粘贴
- asp.net-mvc – Windows 8 VS2012 IISExpress Windows身份验
- asp.net-mvc – Razor视图引擎:复杂循环和HTML
- asp.net – 比HttpHandlers快的东西?
- MVC SessionStateAttribute不作为全局属性
- asp.net使用AJAX实现无刷新分页
- asp.net – Ajax上的Identity Server 3 – 401而不是302
- asp.net-mvc – MVC3如何禁用/启用ActionLink
- asp.net-mvc-3 – 如何判断我的动作是否被RenderAction调用
- asp.net-mvc – 在没有EF的情况下在appsettings.json中获取
推荐文章
站长推荐
- asp.net-mvc – 我如何UnitTest自定义ActionFilt
- asp.net – 为什么%=%标记呈现为“%=%”?
- asp.net – Mono apache2 =服务暂时不可用(503)
- asp.net – 在应用程序级别之外注册为allowDefin
- asp.net-mvc – 在MVC 3中写入只读会话
- asp.net-mvc-3 – 我应该将我的实用程序类放在AS
- asp.net-mvc-4 – 会话到期后重定向到特定页面(M
- asp.net-mvc-3 – 如何阻止Ninject重写自定义Dat
- asp.net – 通过文本查找DropDownList索引
- asp.net-mvc – 如何将MEF与ASP.NET MVC 4和ASP.
热点阅读
