简体   繁体   English

如何删除由makecert添加的证书存储

[英]How to remove a certificate Store added by makecert

Using the -ss option of Microsoft tool MakeCert.exe (-ss specifies the subject's certificate store name that stores the output certificate), I create my own store on a server. 使用Microsoft工具MakeCert.exe-ss选项(-ss指定存储输出证书的主题的证书存储名称),我在服务器上创建自己的存储。 I'am able to remove my certificate programaticaly, but I'am not able to remove the store itself. 我能够以programaticaly删除我的证书,但我无法删除商店本身。 According to the error message this not seems to be supported by the provider. 根据错误消息,提供者似乎不支持此消息。

I can't even use the MMC snapin (certmgr.msc) to remove it. 我甚至无法使用MMC管理单元(certmgr.msc)将其删除。 Does anybody know how to do that ? 有谁知道怎么做?

PS cert:\LocalMachine> Remove-Item .\SigningStore
Remove-Item : L'exécution du fournisseur s'est arrêtée, car le fournisseur ne prend pas en charge cette opération.
Au niveau de ligne : 1 Caractère : 12
+ Remove-Item <<<<  .\SigningStore
    + CategoryInfo          : NotImplemented: (:) [Remove-Item], PSNotSupportedException
    + FullyQualifiedErrorId : NotSupported,Microsoft.PowerShell.Commands.RemoveItemCommand

The only way I found was to use CertUnregisterSystemStore Win32 API 我发现的唯一方法是使用CertUnregisterSystemStore Win32 API

I accidentally created a store called Personal and wanted to get rid of it (of course). 我不小心创建了一个名为Personal的商店,并且想要摆脱它(当然)。 Two personal stores to look for ughhh. 两个私人商店寻找呃。 Anyways, I added a certificate that I had created to that store, copied the thumbprint (and removed the spaces) and then searched the registry for the thumbprint. 无论如何,我添加了一个我为该商店创建的证书,复制了指纹(并删除了空格),然后在注册表中搜索了指纹。 I discovered I could make them go away by deleting the key (in my case Personal) at [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\SystemCertificates\\Personal] (if in the local machine) or at [HKEY_CURRENT_USER\\Software\\Microsoft\\SystemCertificates\\Personal] is in current user. 我发现我可以通过删除[HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Microsoft \\ SystemCertificates \\ Personal](如果在本地计算机中)或[HKEY_CURRENT_USER \\ Software \\ Microsoft \\ SystemCertificates \\ Personal]中的密钥(在我的情况下是个人)来消除它们。是当前用户。 I knew that it wasn't the other one called Personal because the real personal store is actually stored as My. 我知道它不是另一个叫Personal的,因为真正的个人商店实际上存储为My。

EDIT: I had to remove a few other keys to solve this but basically search carefully and examine each entry that matches what you are trying to get rid of. 编辑:我不得不删除一些其他键来解决这个问题,但基本上仔细搜索并检查每个条目,以匹配你想要摆脱的东西。 For each match, export to a reg file and then delete and test. 对于每个匹配,导出到reg文件,然后删除并测试。

This post was a bit helpful as well: http://banachowski.com/deprogramming/2011/01/deleting-unwanted-certificate-stores-from-windows/ 这篇文章也有点帮助: http//banachowski.com/deprogramming/2011/01/deleting-unwanted-certificate-stores-from-windows/

使用PowerShell cmdlet:

Remove-Item -Path cert:\LocalMachine\StoreYouWantToDelete 

阅读此内容并使用带有pinvoke(已经完成!)的c#代码添加类型的crypt32.dll

Did you try the certificate manager tool? 您是否尝试过证书管理器工具? http://msdn.microsoft.com/en-us/library/e78byta0%28VS.80%29.aspx (see certmgr.exe /del ) http://msdn.microsoft.com/en-us/library/e78byta0%28VS.80%29.aspx (参见certmgr.exe / del)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM