HttpWebClientProtocol.ClientCertificates プロパティ

定義

クライアント証明書のコレクションを取得します。

public:
 property System::Security::Cryptography::X509Certificates::X509CertificateCollection ^ ClientCertificates { System::Security::Cryptography::X509Certificates::X509CertificateCollection ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Security.Cryptography.X509Certificates.X509CertificateCollection ClientCertificates { get; }
[<System.ComponentModel.Browsable(false)>]
member this.ClientCertificates : System.Security.Cryptography.X509Certificates.X509CertificateCollection
Public ReadOnly Property ClientCertificates As X509CertificateCollection

プロパティ値

クライアント証明書を表す X509CertificateCollection

属性

次のコード例では、ファイルからクライアント証明書を読み込み、認証にクライアント証明書を使用する ClientCertificates XML Web サービス メソッドを呼び出すための プロパティに追加する方法を示します。

// Create a new instance of a proxy class for the Bank XML Web service.
BankSession bank = new BankSession();

// Load the client certificate from a file.
X509Certificate x509 = X509Certificate.CreateFromCertFile(@"c:\user.cer");

// Add the client certificate to the ClientCertificates property of the proxy class.
bank.ClientCertificates.Add(x509);

// Communicate with the Deposit XML Web service method,
// which requires authentication using client certificates.
bank.Deposit(500);
' Create a new instance of a proxy class for the Bank XML Web service.
Dim bank As BankSession = new BankSession()

' Load the client certificate from a file.
Dim x509 As X509Certificate = X509Certificate.CreateFromCertFile("c:\user.cer")

' Add the client certificate to the ClientCertificates property of the proxy class.
bank.ClientCertificates.Add(x509)

' Communicate with the Deposit XML Web service method,
' which requires authentication using client certificates.
bank.Deposit(500)

注釈

このプロパティを使用すると、XML Web サービス メソッドを呼び出すときに、クライアントは 1 つ以上のクライアント証明書 (Authenticode X.509 v.3 証明書とも呼ばれます) を渡すことができます。 クライアント証明書を使用するように XML Web サービス メソッドが構成されている場合は、クライアント証明書をクライアントを認証するための 1 つのメカニズムとして使用できます。 クライアント証明書の設定の詳細については、インターネット インフォメーション サービス (IIS) のドキュメントを参照してください。

適用対象

こちらもご覧ください