adelphia
adelphia

Reputation: 187

Delete a self signed certificate created using makecert

I created a self-signed certificate using the following command:

makecert -r -pe -n "CN=aaa" -sky exchange -ss my -sr localmachine aaa.cer

This certificate shows up as a server certificate in my IIS manager, which is what i want.

Now I wish to delete this programmatically (C#), what is the command line by which I can do that?

Upvotes: 1

Views: 1989

Answers (2)

adelphia
adelphia

Reputation: 187

I figured out what the solution is,

certmgr -del -c -n "aaa" -s -r localMachine My

Upvotes: 0

enb081
enb081

Reputation: 4051

You can delete it just like you delete any other file in C#:

        string path = @"C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\aaa.cer";
        FileInfo myfileinf = new FileInfo(path);
        myfileinf.Delete();

Upvotes: 1

Related Questions