用的官方提供的demo,实际上部署后却出现了上图的错误。和技术支持沟通无效后,走上了不归路。在微软的github dotnet/core开源库提交了issue后,终于获得了解决。附上链接:https://github.com/dotnet/core/issues/...

用的官方提供的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;
/
本文标题为:dotnet core linux 接入支付宝H5支付,提示:System.PlatformNotSupportedException","Message":"


基础教程推荐
- 实例详解C#实现http不同方法的请求 2022-12-26
- C#中的Linq to JSON操作详解 2023-06-08
- C#获取指定目录下某种格式文件集并备份到指定文件夹 2023-05-30
- C#中 Json 序列化去掉null值的方法 2022-11-18
- Unity shader实现高斯模糊效果 2023-01-16
- c# – USING块在网站与Windows窗体中的行为不同 2023-09-20
- C#通过标签软件Bartender的ZPL命令打印条码 2023-05-16
- C# 解析XML和反序列化的示例 2023-04-14
- C#调用摄像头实现拍照功能的示例代码 2023-03-09
- Unity 如何获取鼠标停留位置下的物体 2023-04-10