X509ClientCertificateAuthentication.RevocationMode Egenskap

Definition

Hämtar eller anger läget för återkallande av certifikat för ChainTrust- och PeerOrChainTrust X.509-certifikatverifiering.

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

Egenskapsvärde

Ett av värdena i X509RevocationMode: NoCheck, Onlineeller Offline. Standardvärdet är Online.

Undantag

set när autentiseringsuppgifterna är skrivskyddade.

Exempel

Följande kod visar hur du anger den här egenskapen.

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

Egenskapen kan också anges i en konfigurationsfil.

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

Kommentarer

När du använder certifikat verifierar systemet att klientcertifikatet inte har återkallats genom att kontrollera att klientcertifikatet inte finns i listan över återkallade certifikat. Den här kontrollen kan utföras antingen genom att kontrollera online eller genom att kontrollera mot en cachelagrad återkallningslista. Återkallningskontroll kan inaktiveras genom att ställa in den här egenskapen på NoCheck.

Mer information finns i Arbeta med certifikat.

Gäller för

Se även