How to remove a certificate Shop added by makecert

Using the -ss parameter of the Microsoft MakeCert.exe (-ss indicates the name store of the subject names in which the output certificate is stored), I create my own store on the server. I can delete my certificate programmatically, but I cannot delete the store itself. According to the error message, this is not supported by the provider.

I can’t even use snapin MMC (certmgr.msc) to remove it. Does anyone know how to do this?

 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 is to use CertUnregisterSystemStore Win32 API

+6
source share
4 answers

Read this and add a type with C # code using pinvoke (already done!) crypt32.dll

+4
source

I accidentally created a store called Personal and wanted to get rid of it (of course). Two personal stores to look for ughhh. In any case, I added the certificate that I created in this store, copied the fingerprint (and removed the spaces), and then searched the registry for the fingerprint. I found that I can remove them by deleting the key (in my case "Personal") in [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ SystemCertificates \ Personal] (if on the local computer) or in [HKEY_CURRENT_USER \ Software \ Microsoft \ SystemCertificates \ Personal] is current user. I knew that this is not the one called “Personal,” because the real personal store is actually stored as “My.”

EDIT: I had to remove several other keys to solve this problem, but basically scrutinize 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 it.

This post was a bit useful: http://banachowski.com/deprogramming/2011/01/deleting-unwanted-certificate-stores-from-windows/

+7
source

Use the PowerShell cmdlet:

 Remove-Item -Path cert:\LocalMachine\StoreYouWantToDelete 
+3
source

Have you tried the certificate manager tool? http://msdn.microsoft.com/en-us/library/e78byta0%28VS.80%29.aspx (see certmgr.exe / del)

0
source

Source: https://habr.com/ru/post/910772/


All Articles