X509ClientCertificateAuthentication.RevocationMode Proprietà

Definizione

Ottiene o imposta la modalità di revoca del certificato per la convalida del certificato ChainTrust e 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

Valore della proprietà

Uno dei valori in X509RevocationMode: NoCheck, Onlineo Offline. Il valore predefinito è Online.

Eccezioni

set quando le credenziali sono di sola lettura.

Esempio

Nel codice seguente viene illustrato come impostare questa proprietà.

// 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 proprietà può essere impostata anche in un file di configurazione.

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

Commenti

Quando si usano i certificati, il sistema verifica che il certificato client non venga revocato, verificando che il certificato client non sia presente nell'elenco di certificati revocati. Questo controllo può essere eseguito controllando online o controllando un elenco di revoche memorizzate nella cache. Il controllo delle revoche può essere disattivato impostando questa proprietà su NoCheck.

Per altre informazioni, vedere Utilizzo dei certificati.

Si applica a

Vedi anche