Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果证书存在于吊销列表中,则应吊销该证书。.net 中有一个选项,您可以通过它检查证书吊销。我需要在吊销列表中探索我的证书并将其吊销,它存在于吊销列表中。因此,我使用下面的一行代码来做到这一点:
ServicePointManager.CheckCertificateRevocationList = true;
问题是上面的代码不能正常工作。我的意思是永远不会检查证书吊销。例如,如果我手动吊销证书,证书仍然有效。有什么帮助吗?
您可以使用 X509Certificate2.Verify ,如下所述:
X509Certificate2.Verify
您可以通过调用 verify 方法加载您的证书并对其进行验证。