Find out if X509Certificate2 is revoked?

后端 未结 1 1839
暗喜
暗喜 2021-02-08 06:45

How can I figure out if an X509Certificate2 has been revoked? I assume the Verify() method checks it, but it doesn\'t explicitly state it in the help.

相关标签:
1条回答
  • 2021-02-08 07:27

    Have you tried using the X509Chain?

    var chain = new X509Chain();
    chain.ChainPolicy.RevocationMode = X509RevocationMode.Online;
    chain.ChainPolicy.RevocationFlag = X509RevocationFlag.EntireChain;
    chain.ChainPolicy.UrlRetrievalTimeout = new TimeSpan(1000);
    chain.ChainPolicy.VerificationTime = DateTime.Now;
    var elementValid = chain.Build (x509certificate);
    
    0 讨论(0)
提交回复
热议问题