共用方式為


SslStreamCertificateContext.Create 方法

定義

多載

Create(X509Certificate2, X509Certificate2Collection, Boolean)

嘗試從提供的憑證建置憑證鏈結。

Create(X509Certificate2, X509Certificate2Collection, Boolean, SslCertificateTrust)

嘗試從提供的憑證建置憑證鏈結。

Create(X509Certificate2, X509Certificate2Collection, Boolean)

來源:
SslStreamCertificateContext.cs
來源:
SslStreamCertificateContext.cs
來源:
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)

來源:
SslStreamCertificateContext.cs
來源:
SslStreamCertificateContext.cs
來源:
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留期期間處置。

重要

目標憑證必須包含私鑰。

適用於