X509ClientCertificateAuthentication クラス

定義

クライアント証明書を検証するための認証プロパティを指定します。

public ref class X509ClientCertificateAuthentication
public class X509ClientCertificateAuthentication
type X509ClientCertificateAuthentication = class
Public Class X509ClientCertificateAuthentication
継承
X509ClientCertificateAuthentication

次のコードに、このプロパティを設定する方法を示します。

// Create a service host.
Uri httpUri = new Uri("http://localhost/Calculator");
ServiceHost sh = new ServiceHost(typeof(Calculator), httpUri);

// Get a reference to the authentication object.
X509ClientCertificateAuthentication myAuthProperties =
    sh.Credentials.ClientCertificate.Authentication;

// Configure peer trust.
myAuthProperties.CertificateValidationMode =
    X509CertificateValidationMode.PeerTrust;
// Configure chain trust.
myAuthProperties.CertificateValidationMode =
    X509CertificateValidationMode.ChainTrust;
// Configure custom certificate validation.
myAuthProperties.CertificateValidationMode =
    X509CertificateValidationMode.Custom;

// Specify a custom certificate validator (not shown here) that inherits
// from the X509CertificateValidator class.
// creds.ClientCertificate.Authentication.CustomCertificateValidator =
//    new MyCertificateValidator();
' Create a service host.
Dim httpUri As New Uri("http://localhost/Calculator")
Dim sh As New ServiceHost(GetType(Calculator), httpUri)

' Get a reference to the authentication object.
Dim myAuthProperties As X509ClientCertificateAuthentication = _
sh.Credentials.ClientCertificate.Authentication

' Configure peer trust.
myAuthProperties.CertificateValidationMode = X509CertificateValidationMode.PeerTrust
' Configure chain trust.
myAuthProperties.CertificateValidationMode = X509CertificateValidationMode.ChainTrust
' Configure custom certificate validation.
myAuthProperties.CertificateValidationMode = X509CertificateValidationMode.Custom
' Specify a custom certificate validator (not shown here) that inherits 
' from the X509CertificateValidator class. 
' creds.ClientCertificate.Authentication.CustomCertificateValidator = _
'    new MyCertificateValidator()

プロパティは構成ファイル内でも設定できます。

<serviceCredentials>  
  <clientCertificate>  
     <authentication certificateValidationMode='ChainTrust' />  
  </clientCertificate>  
</serviceCredentials>  

注釈

CertificateValidationModeCustom に設定されている場合、X509CertificateValidator クラスを継承するカスタム証明書検証を作成する必要があります。 詳細については、「方法: カスタム証明書検証を使用するサービスを作成する」を参照してください。

コンストラクター

X509ClientCertificateAuthentication()

クライアント証明書を検証するための認証プロパティを指定します。

プロパティ

CertificateValidationMode

証明書検証モードを取得または設定します。

CustomCertificateValidator

カスタム クライアント証明書検証を取得または設定します。

IncludeWindowsGroups

承認コンテキストに Windows グループが含まれるかどうかを示す値を取得または設定します。

MapClientCertificateToWindowsAccount

証明書を Windows アカウントに割り当てるかどうかを示す値を取得または設定します。

RevocationMode

ChainTrust および PeerOrChainTrust X.509 証明書検証の証明書失効モードを取得または設定します。

TrustedStoreLocation

クライアント証明書チェーンを検証するためのコンテキストとなる信頼されたストアの場所を取得または設定します。

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

こちらもご覧ください