X509ClientCertificateAuthentication.RevocationMode Vlastnost

Definice

Získá nebo nastaví režim odvolání certifikátu pro ChainTrust a PeerOrChainTrust X.509 ověření certifikátu.

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

Hodnota vlastnosti

X509RevocationMode

Jedna z hodnot v X509RevocationMode: NoCheck, Onlinenebo Offline. Výchozí formát je Online.

Výjimky

set pokud je přihlašovací údaje jen pro čtení.

Příklady

Následující kód ukazuje, jak nastavit tuto vlastnost.

// 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

Vlastnost lze také nastavit v konfiguračním souboru.

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

Poznámky

Při použití certifikátů systém ověří, že klientský certifikát není odvolán, tím, že zkontroluje, zda klientský certifikát není v seznamu odvolaných certifikátů. Tuto kontrolu lze provést buď kontrolou online, nebo kontrolou seznamu odvolaných certifikátů uložených v mezipaměti. Kontrolu odvolání lze vypnout nastavením této vlastnosti na NoCheckhodnotu .

Další informace naleznete v tématu Práce s certifikáty.

Platí pro

Viz také