แก้ไข

แชร์ผ่าน


SslStreamCertificateContext.Create Method

Definition

Overloads

Create(X509Certificate2, X509Certificate2Collection, Boolean)

Attempts to build the certificate chain from the provided certificates.

Create(X509Certificate2, X509Certificate2Collection, Boolean, SslCertificateTrust)

Attempts to build the certificate chain from the provided certificates.

Create(X509Certificate2, X509Certificate2Collection, Boolean)

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

Attempts to build the certificate chain from the provided certificates.

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

Parameters

target
X509Certificate2

The server certificate.

additionalCertificates
X509Certificate2Collection

Supplementary certificates used to build the certificate chain.

offline
Boolean

false to indicate that the missing certificates can be downloaded from the network; true to indicate that only available X509Certificate stores should be searched for missing certificates.

Returns

The certificate context with the newly created certificate chain.

Exceptions

target doesn't have an associated private key.

Remarks

The provided certificates should not be disposed during the lifetime of the SslStreamCertificateContext.

Important

The target certificate must include a private key.

Applies to

Create(X509Certificate2, X509Certificate2Collection, Boolean, SslCertificateTrust)

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

Attempts to build the certificate chain from the provided certificates.

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

Parameters

target
X509Certificate2

The server certificate.

additionalCertificates
X509Certificate2Collection

Supplementary certificates used to build the certificate chain.

offline
Boolean

false to indicate that the missing certificates can be downloaded from the network; true to indicate that only available X509Certificate stores should be searched for missing certificates.

trust
SslCertificateTrust

An optional trust policy, to replace the default system trust.

Returns

The certificate context with the newly created certificate chain.

Exceptions

target doesn't have an associated private key.

Remarks

The provided certificates should not be disposed during the lifetime of the SslStreamCertificateContext.

Important

The target certificate must include a private key.

Applies to