.NET Core 2.0 RSA PlatformNotSupportedException
我试图使用此代码生成公钥和私钥,我在Windows 10上使用.NET Core 2
到目前为止,我没有成功运行此代码,它编译得很好,但是当我到达rsa.ToXmlString行时,它会丢弃PlatformNotSupportedException,当我在堆栈溢出的另一个答案中读到时,解决方案是使用System.Security.Cryptography.Algorithms
和它们显示了我在下面使用的几乎精确的代码。
using (RSA rsa = RSA.Create()) { rsa.KeySize = 1024; privateKey = rsa.ToXmlString(true); publicKey = rsa.ToXmlString(false); }
错误:
如此处所示它确实出现在他们的API浏览器中,因此必须得到支持,对吧?
有没有人有类似的问题? 或者有没有人解决这个问题? 我必须使用.NET Core,所以不建议使用.NET 4.6
.Net Core没有toXmlString()
和fromXmlString
方法。 但你可以使用扩展名
解决方法: #874 , #23686
- 如何在.Net Core中不使用第三方记录器的情况下登录文件?
- entity framework核心SelectMany然后包括
- 在ASP.NET Core Web API中上载文件和JSON
- Microsoft.DotNet.Common.Targets(262,5):错误:对象引用未设置为对象的实例
- 使用Novell.Directory.Ldap.NETStandard库进行C#netcore ldap身份validation
- ASP.Net核心MVC6未经授权重定向到登录
- 在.NET Core项目中找不到System.ServiceModel
- 在.NET Core中将视图返回为字符串
- .Net Core MySql