X509ClientCertificateAuthentication.RevocationMode プロパティ

定義

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

public:
 property System::Security::Cryptography::X509Certificates::X509RevocationMode RevocationMode { System::Security::Cryptography::X509Certificates::X509RevocationMode get(); void set(System::Security::Cryptography::X509Certificates::X509RevocationMode value); };
public System.Security.Cryptography.X509Certificates.X509RevocationMode RevocationMode { get; set; }
member this.RevocationMode : System.Security.Cryptography.X509Certificates.X509RevocationMode with get, set
Public Property RevocationMode As X509RevocationMode

プロパティ値

X509RevocationModeの値の 1 つ:NoCheckOnline、またはOffline。 既定値は Online です。

例外

set 資格情報が読み取り専用の場合。

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

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

// Create a binding that uses a certificate.
WSHttpBinding b = new WSHttpBinding(SecurityMode.Message);
b.Security.Message.ClientCredentialType =
    MessageCredentialType.Certificate;

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

// Configure ChainTrust with no revocation check.
myAuthProperties.CertificateValidationMode =
    X509CertificateValidationMode.ChainTrust;
myAuthProperties.RevocationMode = X509RevocationMode.NoCheck;
' Create a service host.
Dim httpUri As New Uri("http://localhost/Calculator")
Dim sh As New ServiceHost(GetType(Calculator), httpUri)

' Create a binding that uses a certificate.
Dim b As New WSHttpBinding(SecurityMode.Message)
b.Security.Message.ClientCredentialType = _
MessageCredentialType.Certificate

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

' Configure ChainTrust with no revocation check.
myAuthProperties.CertificateValidationMode = _
X509CertificateValidationMode.ChainTrust
myAuthProperties.RevocationMode = X509RevocationMode.NoCheck

このプロパティは、構成ファイルで設定することもできます。

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

注釈

証明書を使用する場合、システムは、クライアント証明書が失効した証明書の一覧に含まれていないことを確認することによって、クライアント証明書が取り消されていないことを検証します。 このチェックは、オンラインで確認するか、キャッシュされた失効リストに対してチェックすることで実行できます。 失効チェックを無効にするには、このプロパティを NoCheck に設定します。

詳細については、「 証明書の操作」を参照してください。

適用対象

こちらもご覧ください