【发布时间】:2018-05-25 04:25:08
【问题描述】:
我使用 OpenSSL 创建了 X509 证书。我正在尝试使用 .NET Core 2.0 中 X509Certificate2 类的 Import 方法加载它。
var cert = new X509Certificate2();
cert.Import(_path);
但是会抛出以下异常:
System.PlatformNotSupportedException : X509Certificate is immutable on this
platform. Use the equivalent constructor instead.
我应该使用哪个构造函数/从磁盘加载此证书的正确方法是什么?
【问题讨论】:
-
你试过新的 X509Certificate2(certificateAsByteArray),查看 .net core import 的代码没有实现:github.com/dotnet/corefx/blob/…
标签: c# ssl https .net-core x509certificate