Sli*_*lip 3 c# cryptoapi asp.net-core ubuntu-16.04
我有使用加密技术的ASP.Net Core 1.0.0应用程序.我需要使用解密密钥RSACryptoServiceProvider.Visual Studio建议将System.Security.Cryptography.Csp4.0.0版添加到我的依赖项中.我接受了,在Windows上它一切正常.但是当我在Ubuntu 16.04上部署它时,RSACryptoServiceProvider方法开始抛出PlatformNotSupportedException异常.我使用错误的装配吗?我找到https://github.com/dotnet/corefx/tree/v1.0.0/src/System.Security.Cryptography.Csp并且有1.0.0版本.这就是我需要的吗?如何将其添加到我的项目中?
RSACryptoServiceProvider基于CryptoAPI,一种特定于Windows的非托管API.由于它在Linux上不可用,PlatformNotSupportedException因此在运行时会抛出异常.
相反,请考虑引用System.Security.Cryptography.Algorithms和使用RSA.Create()以获得与您的环境兼容的实现(在Linux上,您将获得一个RSAOpenSsl实例).
| 归档时间: |
|
| 查看次数: |
717 次 |
| 最近记录: |