SslStreamCertificateContext.Create 方法

定义

重载

Create(X509Certificate2, X509Certificate2Collection, Boolean)

尝试根据提供的证书生成证书链。

Create(X509Certificate2, X509Certificate2Collection, Boolean, SslCertificateTrust)

尝试根据提供的证书生成证书链。

Create(X509Certificate2, X509Certificate2Collection, Boolean)

Source:
SslStreamCertificateContext.cs
Source:
SslStreamCertificateContext.cs
Source:
SslStreamCertificateContext.cs

尝试根据提供的证书生成证书链。

public:
 static System::Net::Security::SslStreamCertificateContext ^ Create(System::Security::Cryptography::X509Certificates::X509Certificate2 ^ target, System::Security::Cryptography::X509Certificates::X509Certificate2Collection ^ additionalCertificates, bool offline);
public static System.Net.Security.SslStreamCertificateContext Create (System.Security.Cryptography.X509Certificates.X509Certificate2 target, System.Security.Cryptography.X509Certificates.X509Certificate2Collection? additionalCertificates, bool offline = false);
public static System.Net.Security.SslStreamCertificateContext Create (System.Security.Cryptography.X509Certificates.X509Certificate2 target, System.Security.Cryptography.X509Certificates.X509Certificate2Collection? additionalCertificates, bool offline);
static member Create : System.Security.Cryptography.X509Certificates.X509Certificate2 * System.Security.Cryptography.X509Certificates.X509Certificate2Collection * bool -> System.Net.Security.SslStreamCertificateContext
Public Shared Function Create (target As X509Certificate2, additionalCertificates As X509Certificate2Collection, Optional offline As Boolean = false) As SslStreamCertificateContext
Public Shared Function Create (target As X509Certificate2, additionalCertificates As X509Certificate2Collection, offline As Boolean) As SslStreamCertificateContext

参数

target
X509Certificate2

服务器证书。

additionalCertificates
X509Certificate2Collection

用于生成证书链的补充证书。

offline
Boolean

false 指示丢失的证书可以从网络下载;true 指示应仅在可用的 X509Certificate 存储中搜索缺少的证书。

返回

具有新创建的证书链的证书上下文。

例外

target 没有关联的私钥。

注解

在 的生存期内 SslStreamCertificateContext,不应释放提供的证书。

重要

目标证书必须包含私钥。

适用于

Create(X509Certificate2, X509Certificate2Collection, Boolean, SslCertificateTrust)

Source:
SslStreamCertificateContext.cs
Source:
SslStreamCertificateContext.cs
Source:
SslStreamCertificateContext.cs

尝试根据提供的证书生成证书链。

public static System.Net.Security.SslStreamCertificateContext Create (System.Security.Cryptography.X509Certificates.X509Certificate2 target, System.Security.Cryptography.X509Certificates.X509Certificate2Collection? additionalCertificates, bool offline = false, System.Net.Security.SslCertificateTrust? trust = default);
static member Create : System.Security.Cryptography.X509Certificates.X509Certificate2 * System.Security.Cryptography.X509Certificates.X509Certificate2Collection * bool * System.Net.Security.SslCertificateTrust -> System.Net.Security.SslStreamCertificateContext
Public Shared Function Create (target As X509Certificate2, additionalCertificates As X509Certificate2Collection, Optional offline As Boolean = false, Optional trust As SslCertificateTrust = Nothing) As SslStreamCertificateContext

参数

target
X509Certificate2

服务器证书。

additionalCertificates
X509Certificate2Collection

用于生成证书链的补充证书。

offline
Boolean

false 指示丢失的证书可以从网络下载;true 指示应仅在可用的 X509Certificate 存储中搜索缺少的证书。

trust
SslCertificateTrust

可选信任策略,用于替换默认的系统信任。

返回

具有新创建的证书链的证书上下文。

例外

target 没有关联的私钥。

注解

在 的生存期内 SslStreamCertificateContext,不应释放提供的证书。

重要

目标证书必须包含私钥。

适用于