title: x509Certificate revocation check using RemoteCertificateValidationCallback in C#
body: <p>In my C# project I pass a custom implementation of the RemoteCertificateValidationCallback delegate to an SslStream. It is then used to validate a server certificate. The custom implementation checks the sslPolicyErrors flag that the default implementation has set and invokes custom logic based on the results. The default implementation sets flags for several types of certificate issues such as mismatched Subject name, an incomplete certificate chain or if the certificate is expired.
  My question: Can I infer in any way, from the result of the default implementation of RemoteCertificateValidationCallback, that the certificate is revoked (i.e. is listed in any type of CRL)? Or am I required to add custom logic to my own implementation of RemoteCertificateValidationCallback for a revocation check?</p>
  
  <p>In other words, in the sample code below, if the certificate is revoked will this in any way be reflected in the <code>sslPolicyErrors</code> flag, the <code>certificate</code> object, or the <code>chain</code> object? Or will I have to add additional logic for the revocation check?</p>
  
  <pre><code>RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) =&gt;
  {
      if (sslPolicyErrors == SslPolicyErrors.None)
      {
          return true;
      }
      else if (sslPolicyErrors == SslPolicyErrors.RemoteCertificateNameMismatch)
      {
          // Custom check by additional data available for the certificate...
      }
      else
      {
          return false;
      }
  }
  </code></pre>