CRL and Windows Certificate Store

I need to get the CRL from the Windows Store (Windows Store for X509Certificate represents X509Store). I try this code:

string storName = "CA";//such store is exist
WinCertStorage = new X509Store(storName, storLoc);
WinCertStorage.Open(OpenFlags.ReadOnly);
foreach (X509Certificate2 cer in WinCertStorage.Certificates)
{
      if (cer.Version == 2)
           //certificate with version 2 can be CRL
}

But in the X509Store there is no CRL that I opened. Using mmc, I imported some CRL into "CA", but my code does not see it.

Can I get a CRL with the standard System.Security.Cryptography namespace? What should I use if I can’t? I need a solution for .Net. Thank.

+3
source share

Source: https://habr.com/ru/post/1778955/


All Articles