Partage via


X509ClientCertificateAuthentication.RevocationMode Propriété

Définition

Obtient ou définit le mode de révocation de certificat pour la validation de certificat ChainTrust et 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

Valeur de propriété

X509RevocationMode

L'une des valeurs dans X509RevocationMode : NoCheck, Online ou Offline. La valeur par défaut est Online.

Exceptions

set lorsque les informations d'identification sont en lecture seule.

Exemples

Le code suivant montre comment définir cette propriété.

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

Cette propriété peut également être définie dans un fichier de configuration.

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

Remarques

En cas d'utilisation d'un certificat, le système confirme que le certificat ne figure pas dans la liste des certificats révoqués. Ce contrôle peut être effectué par une vérification en ligne ou par rapport à une liste de révocation mise en cache. La vérification de la révocation peut être désactivé en affectant la valeur NoCheck à cette propriété.

Pour plus d’informations, consultez Utilisation des certificats.

S’applique à

Voir aussi