title: X509Certificate2Collection.Find() method, using FindByTimeValid criteria, not working
body: <p>I am using the following code to get only the valid (by time) certificates on the machine:</p>
  
  <pre><code>var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
  store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
  var storeCol = store.Certificates;
  store.Close();
  
  var notExpiredCol = storeCol.Find(X509FindType.FindByTimeValid, DateTime.Now, true);
  </code></pre>
  
  <p>On my machine it's working perfectly. But, on another machine with same configuration (Windows 10, Visual Studio Community 2017 and exactly the same certificate installed), it returns nothing.</p>
  
  <p>The original collection from the store, without filters, has the certificate. If we look at the certificates under Internet Explorer, the certificate is there. If we look under MMC with Certificates snap-in, the certificate is there. We tried installing the certificate under Current User and Local Machine, the code is getting the certificates collection from Current User.</p>
  
  <p>I've just tried using <strong>FindByTimeExpired</strong> and <strong>FindByTimeNotYetValid</strong> criteria, and same result, both returns an empty collection:</p>
  
  <pre><code>var expiredCol = storeCol.Find(X509FindType.FindByTimeExpired, DateTime.Now, true);
  var notYetValidCol = storeCol.Find(X509FindType.FindByTimeNotYetValid, DateTime.Now, true);
  </code></pre>
  
  <p>Does anyone have any idea what's going on or what we could check to resolve the issue?</p>
  
  <p>By the way, what is exactly the role of the <strong><em>validOnly</em></strong> parameter on the X509Certificate2Collection.Find() method? If I use the value <em>false</em> on it, the method returns the certificate on the collection.</p>