[英]Using Trusted Root Certification Authorities for server certificate validation in HttpClient
[英]How do I programmatically remove a certificate in Trusted Root Certification Authorities?
我需要能够从组织中的每台 PC 中删除特定证书。 是的,我可以 go 座位到座位,但我必须到星期四才能完成,而且我没有人力来 go 座位到座位。
有没有使用 C# 的编程方式?
我认为您不需要制作任何 C# - 看看certmgr.exe /del
。
如果你今天真的想写一些 C# 来做到这一点,那么看看X509Store.Remove
。
MSDN中有一个例子( 点击这里)
我认为这个例子是不言自明的,但摘录如下:
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.IO;
public class X509store2
{
public static void Main (string[] args)
{
//Create new X509 store called teststore from the local certificate store.
X509Store store = new X509Store ("ROOT", StoreLocation.CurrentUser);
store.Open (OpenFlags.ReadWrite);
...
store.Remove (certificate1);
store.RemoveRange (collection);
...
//Close the store.
store.Close ();
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.