c# - 单声道:不能再使用 settor 设置 X509Certificate2 私钥
问题描述
在最近的某个时候,Mono 取消了对在 X509Certificate2 上设置私钥的支持。版本 6.8.0.96 导致Platform Not Supported异常。
我需要这样做,因为我已经获得了一对 pem 证书和 rsa 密钥文件,我将它们读取并重新组合成 X509Certificate2。这在过去有效。
所以我读到为 .NET Framework 和 .NET Core 设置私钥的建议方法是使用这个扩展“CopyWithPrivateKey”。https://github.com/mono/mono/issues/14152#issuecomment-499524798
项目是 .NET 框架 4.7.2,据说提供了这个扩展。它在 4.7.1 中不可用。
修改代码以在X509Certificate2 中使用 CopyWithPrivateKey 结果不包含“CopyWithPrivateKey”的定义
包括指定的命名空间 (System.Security.Cryptography.X509Certificates)。然而没有骰子。Visual Studio 没有明确建议为任何特定程序集添加引用。它看起来不像一个 nuget 包。
这是怎么回事?这是否支持?为什么以这种方式将它从 Mono 代码库中剥离出来?是否不担心向后兼容性?
有没有人必须为此找出解决方法?
解决方案
推荐阅读
- javascript - 链接到新的动态路由不会改变 getInitialProps 数据
- r - 有没有办法在 Shiny 中预缓存输出?
- python - 设置要在 Jupyter Notebook 中使用的 Python 版本以实现可重复性
- php - php-fpm(池)错误。- 指定的超时已过期
- angular12 - 从 Blob 下载的文件是空的,Angular12
- c# - c#访问路径\downloads被拒绝
- docker - 在每个 Docker 映像的多个委托之间进行选择
- teamcity - TeamCity npm 在构建步骤中未安装
- docker - 如何从主用户目录构建 docker 映像?
- python - PackagesNotFoundError:当前频道不提供以下软件包(libgcc-ng 和 libstdcxx-ng)