X509ClientCertificateAuthentication.RevocationMode Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
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é
Une des valeurs dans X509RevocationMode: NoCheck, Onlineou Offline. La valeur par défaut est Online.
Exceptions
set quand 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
La propriété peut également être définie dans un fichier de configuration.
<serviceCredentials>
<clientCertificate>
<authentication certificateValidationMode='ChainTrust' revocationMode = 'NoCheck'/>
</clientCertificate>
</serviceCredentials>
Remarques
Lorsque vous utilisez des certificats, le système valide que le certificat client n’est pas révoqué, en vérifiant que le certificat client n’est pas dans la liste des certificats révoqués. Cette vérification peut être effectuée en vérifiant en ligne ou en vérifiant sur une liste de révocation mise en cache. La vérification de la révocation peut être désactivée en définissant cette propriété sur NoCheck.
Pour plus d’informations, consultez Utilisation des certificats.