title: C# X509Certificate2.Verify without revocation test
body: <p>I try to use X509Certificate2.Verify() function to check if a certificate chain is valid.
  The Verify function returns false and the ChainElementStatus returns "RevocationStatusUnknown".</p>
  
  <p>Is there a way to use the Verify function without the check of the RevocationStatus? The RevocationStatus can't be checked without internet connection? Is there a other function to check the chain and certificates wihtout the RevocationStatus? </p>
  
  <p>A dirty solution, is to check if the RevocationStatus is the only element in element.ChainElementStatus.</p>
  
  <p>I already use X509RevocationMode.Offline and IgnoreCertificateAuthorityRevocationUnknown.</p>
  
  <p>Code from: <a href="https://stackoverflow.com/questions/10137208/x509certificate2-verify-method-always-return-false-for-the-valid-certificate">X509Certificate2.Verify() method always return false for the valid certificate</a></p>
  
  <pre><code>X509Chain ch = new X509Chain();
  
  ch.Build(certificate);
  
  ch.ChainPolicy.RevocationMode = X509RevocationMode.Offline;
  ch.ChainPolicy.VerificationFlags = X509VerificationFlags.IgnoreCertificateAuthorityRevocationUnknown;
  
  Console.WriteLine("Chain Information");
  Console.WriteLine("Chain revocation flag: {0}", ch.ChainPolicy.RevocationFlag);
  
  Console.WriteLine("Chain revocation mode: {0}", ch.ChainPolicy.RevocationMode);
  Console.WriteLine("Chain verification flag: {0}", ch.ChainPolicy.VerificationFlags);
  Console.WriteLine("Chain verification time: {0}", ch.ChainPolicy.VerificationTime);
  Console.WriteLine("Chain status length: {0}", ch.ChainStatus.Length);
  Console.WriteLine("Chain application policy count: {0}", ch.ChainPolicy.ApplicationPolicy.Count);
  Console.WriteLine("Chain certificate policy count: {0} {1}", ch.ChainPolicy.CertificatePolicy.Count, Environment.NewLine);
  
  //Output chain element information.
  Console.WriteLine("Chain Element Information");
  Console.WriteLine("Number of chain elements: {0}", ch.ChainElements.Count);
  Console.WriteLine("Chain elements synchronized? {0} {1}", ch.ChainElements.IsSynchronized, Environment.NewLine);
  
  foreach (X509ChainElement element in ch.ChainElements)
  {
  Console.WriteLine("Element issuer name: {0}", element.Certificate.Issuer);
  Console.WriteLine("Element certificate valid until: {0}", element.Certificate.NotAfter);
  Console.WriteLine("Element certificate is valid: {0}", element.Certificate.Verify());
  Console.WriteLine("Element error status length: {0}", element.ChainElementStatus.Length);
  Console.WriteLine("Element information: {0}", element.Information);
  Console.WriteLine("Number of element extensions: {0}{1}", element.Certificate.Extensions.Count, Environment.NewLine);
  
      if (ch.ChainStatus.Length &gt;= 1)
      {
          for (int index = 0; index &lt; element.ChainElementStatus.Length; index++)
          {
              Console.WriteLine(element.ChainElementStatus[index].Status);
              Console.WriteLine(element.ChainElementStatus[index].StatusInformation);
          }
      }
  }
  </code></pre>
  
  <p>Result:</p>
  
  <p>Chain Information
  Chain revocation flag: ExcludeRoot
  Chain revocation mode: Offline
  Chain verification flag: IgnoreCertificateAuthorityRevocationUnknown
  Chain verification time: 19.11.2018 07:53:31
  Chain status length: 1
  Chain application policy count: 0
  Chain certificate policy count: 0 </p>
  
  <p>Chain Element Information
  Number of chain elements: 2
  Chain elements synchronized? False </p>
  
  <p>Element issuer name: CN=TestRootCA
  Element certificate valid until: 01.01.2019 00:00:00
  Element certificate is valid: False
  Element error status length: 1
  Element information: 
  Number of element extensions: 5</p>
  
  <p>RevocationStatusUnknown
  Die Sperrfunktion konnte keine Sperrprüfung für das Zertifikat durchführen.</p>
  
  <p>Element issuer name: CN=TestRootCA
  Element certificate valid until: 01.01.2019 00:00:00
  Element certificate is valid: True
  Element error status length: 0
  Element information: 
  Number of element extensions: 2</p>