我使用 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.
我应该使用哪个构造函数/从磁盘加载证书的正确方式是什么?