如何从存储中干净地删除证书
您可以使用 certmgr.msc 中的向导将证书安装到证书存储中(右键单击安装)?有谁知道如何使用向导/代码(首选)/脚本“干净地”删除所有证书?
我希望能够从 LocalMachine 和/或 CurrentUser 存储中删除所有内容(我之前安装的),而不留下任何残留物。
谢谢
You can install certificate into certificate store using Wizard in certmgr.msc (Right click install)? Does anyone knows how to "cleanly" remove all the certificate by either using wizard/Code (pref.) /Script ?
I want to be able to remove everything (that I have installed earlier) from the LocalMachine and/or CurrentUser Store without leaving any residue.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以尝试使用 .Net Framework 中的
X509Store
和相关类从证书存储中删除证书。以下代码示例从当前用户的“我的”商店中删除证书:开始编辑:
根据评论部分中的评论,我用代码示例更新了我的答案,显示如何删除证书和链中的所有证书:
END EDIT
希望,这会有所帮助。
You could try the
X509Store
and releated classes in the .Net Framework to delete a certificate from the certificate store. The following code example deletes a certificate from the current user's My store:BEGIN EDIT:
Based on the comments in the comment section I've updated my answer with a code sample showing how to remove a certificate and all certificates in the chain:
END EDIT
Hope, this helps.
老线程,但我只是使用 Win 7 按照下面的链接帖子操作,效果很好......使用管理控制台。
来源:
http://windowssecrets.com/top-story/certificate-大多数个人计算机的清理/
Old thread, but I just followed the linked post below using Win 7 and it worked nicely... Uses the Management Console.
Source:
http://windowssecrets.com/top-story/certificate-cleanup-for-most-personal-computers/
您可以尝试 certmgr.exe。以下命令从本地用户个人\证书存储中删除 cn 为“commoncertname”的证书。
您可以在此处找到有关 certmgr.exe 的更多信息: http://msdn.microsoft.com/en-us/library/windows/desktop/aa376553%28v=vs.85%29.aspx
更新
呃!我不敢相信我没有尝试过这个!您可以使用以下命令删除证书:
You can try certmgr.exe. The following command removes a certificate with a cn of 'commoncertname ' from the local user personal\certificates store.
You can find more information about certmgr.exe here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa376553%28v=vs.85%29.aspx
UPDATE
Duh! I can't believe I didn't try this! You can remove certificates with the following: