Wie kann ich programmgesteuert prüfen, ob ein bestimmtes Zertifikat aus seiner CA CRL-Liste widerrufen wurde?C# Zertifikat in CRL-Liste überprüfen
Ich tue dies:
X509Chain ch = new X509Chain();
ch.ChainPolicy.RevocationMode = X509RevocationMode.Online;
ch.ChainPolicy.RevocationFlag = X509RevocationFlag.EntireChain;
ch.ChainPolicy.UrlRetrievalTimeout = new TimeSpan(1000);
ch.ChainPolicy.VerificationFlags = X509VerificationFlags.NoFlag;
ch.ChainPolicy.VerificationTime = DateTime.Now;
ch.Build(certificate);
foreach (X509ChainStatus s in ch.ChainStatus)
{
string str = s.Status.ToString();
Console.WriteLine("str: " + str);
}
X509Store store = new X509Store(StoreName.Disallowed, StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadWrite);
bool isRevoked = store.Certificates.Contains(certificate);
store.Close();
return !isRevoked && certificate.Verify();
Und ich bekomme "str: RevokedStatusUnknown". Nur wenn ich viele Stunden nach dem Entzug des Zertifikats warte -> wird der Status als widerrufen zurückgegeben, obwohl ich die CRL sofort nach dem Entzug des Zertifikats veröffentliche. Warum greift es nicht sofort auf die CRL zu?