信頼されたルート証明機関の証明書をプログラムで削除するにはどうすればよいですか?
-
19-08-2019 - |
質問
組織内の各PCから特定の証明書を削除できるようにする必要があります。はい、座席に行くことができますが、木曜日までにそれをやってのける必要があり、座席に行く人員がありません。
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 ();
}
}
所属していません StackOverflow