dotnet core linux 接入支付宝H5支付,提示:System.PlatformNotSupportedException","Message":"
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了dotnet core linux 接入支付宝H5支付,提示:System.PlatformNotSupportedException","Message":",小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1918字,纯文字阅读大概需要3分钟。
内容图文
![dotnet core linux 接入支付宝H5支付,提示:System.PlatformNotSupportedException","Message":"](/upload/InfoBanner/zyjiaocheng/963/dd04be7d1c8d4ec3b569640dda412bf5.jpg)
用的官方提供的demo,实际上部署后却出现了上图的错误。和技术支持沟通无效后,走上了不归路。
在微软的github dotnet/core开源库提交了issue后,终于获得了解决。附上链接:https://github.com/dotnet/core/issues/3020
有道翻译一下:
CspParameters
is about directly interacting with the Windows crypto libraries, which are only available on Windows.If you're strongly typed as RSACryptoServiceProvider (which is generally a bad idea, it's the most limited of the RSA types) you can just eliminate the use of the CspParameters parameter... ImportParameters (when the key isn't named) makes a new ephemeral key and imports into that. And the original key size data is ignored when using ImportParameters.
CspParameters是关于直接与只在Windows上可用的Windows加密库交互的。 如果您是强类型为RSACryptoServiceProvider(这通常是一个坏主意,它是RSA类型中最受限制的),您可以直接取消使用CspParameters参数…ImportParameters(当键没有被命名时)创建一个新的临时键并导入其中。当使用ImportParameters时,原始密钥大小数据将被忽略。
附上官方demo代码,被注视掉的部分就是引起问题的原因:
// ------- create RSACryptoServiceProvider instance and initialize with public key -----
//CspParameters CspParameters = new CspParameters();
//CspParameters.Flags = CspProviderFlags.UseMachineKeyStore;
//int bitLen = 1024;
//if ("RSA2".Equals(signType))
//{
// bitLen = 2048;
//}
RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();
RSAParameters RSAparams = new RSAParameters();
RSAparams.Modulus = MODULUS;
RSAparams.Exponent = E;
RSAparams.D = D;
RSAparams.P = P;
RSAparams.Q = Q;
RSAparams.DP = DP;
RSAparams.DQ = DQ;
RSAparams.InverseQ = IQ;
RSA.ImportParameters(RSAparams);
内容总结
以上是互联网集市为您收集整理的dotnet core linux 接入支付宝H5支付,提示:System.PlatformNotSupportedException","Message":"全部内容,希望文章能够帮你解决dotnet core linux 接入支付宝H5支付,提示:System.PlatformNotSupportedException","Message":"所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。