X509ClientCertificateAuthentication.RevocationMode Propiedad

Definición

Obtiene o establece el modo de revocación de certificados para la validación de certificados ChainTrust y 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

Valor de propiedad

Uno de los valores de X509RevocationMode: NoCheck, Onlineo Offline. El valor predeterminado es Online.

Excepciones

set cuando la credencial es de solo lectura.

Ejemplos

En el código siguiente se muestra cómo establecer esta propiedad.

// 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 propiedad también se puede establecer en un archivo de configuración.

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

Comentarios

Al usar certificados, el sistema valida que el certificado de cliente no se revoca, comprobando que el certificado de cliente no está en la lista de certificados revocados. Esta comprobación se puede realizar comprobando en línea o comprobando en una lista de revocación almacenada en caché. La comprobación de revocación se puede desactivar estableciendo esta propiedad NoChecken .

Para obtener más información, vea Trabajar con certificados.

Se aplica a

Consulte también