|
.net core 1.x版本报错如下:
Could not load type 'System.Security.Cryptography.RSACryptoServiceProvider' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
.net core 2.x版本报错如下:
Operation is not supported on this platform.
at System.Security.Cryptography.RSA.FromXmlString(String xmlString)
at CodeSharing.Common.RSACryptoProvider.SectionDecrypt(String base64code, String privateKey) in xxx
本文以2.x版本为例子来解决!
报错原因主要是FromXmlString这个方法出错了!
重新定义下此方法:
将所有使用到FromXmlString的代码RSA.FromXmlString(privateKey); 替换成 FromXmlString(RSA, privateKey);即可解决!
参考资料:https://github.com/ServiceStack/ ... lient/CryptUtils.cs
|
上一篇:Ionic开发Android App实战(四):百度地图api定位下一篇:京东购买商品接口助手各版本开源
|