Udostępnij za pośrednictwem


X509ClientCertificateAuthentication.RevocationMode Właściwość

Definicja

Pobiera lub ustawia tryb odwołania certyfikatów dla weryfikacji certyfikatów ChainTrust i 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

Wartość właściwości

X509RevocationMode

Jedna z wartości w pliku X509RevocationMode: NoCheck, Onlinelub Offline. Wartość domyślna to Online.

Wyjątki

set gdy poświadczenie jest tylko do odczytu.

Przykłady

Poniższy kod pokazuje, jak ustawić tę właściwość.

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

Właściwość można również ustawić w pliku konfiguracji.

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

Uwagi

W przypadku korzystania z certyfikatów system sprawdza, czy certyfikat klienta nie został odwołany, sprawdzając, czy certyfikat klienta nie znajduje się na liście odwołanych certyfikatów. Tę kontrolę można wykonać, sprawdzając w trybie online lub sprawdzając listę odwołania w pamięci podręcznej. Sprawdzanie odwołania można wyłączyć, ustawiając tę właściwość na NoCheckwartość .

Aby uzyskać więcej informacji, zobacz Praca z certyfikatami.

Dotyczy

Zobacz też