PDA

View Full Version : How do I install a certificate?



BRYPIE
12-22-2004, 10:15 AM
Hi,

In my installation, I need to install a certificate file on the target machine (*.cer)

Is there a special way to do this, and to get it installed and registered properly on the target machine?

If it helps, I also have a *.pfx file, which will install the certificate from a seperate installer - do I have to run this from within my installation?

Chas_Gregory
01-05-2005, 01:31 PM
I want to do the same thing and came to the conclusion that there was no built-in way of installing a certificate into the workstation certificate store.

Luckily there is a Microsoft utility called certmgr.exe which seems to work OK according to the tests I've done today. I was planning on including some commands using this utility as a Custom Action within my install. I found it in part of the IE 5 SDK here:

http://www.microsoft.com/downloads/details.aspx?familyid=2b742795-d0f0-4a66-b27f-22a95fcd3425&displaylang=en

The syntax I've been using is:

Adding Root Certs: certmgr -add -c root.cer -s -r localmachine root
Adding Intermediate Certs: certmgr -add -c inter.cer -s -r localmachine CA

I've been putting the certificates into the Local Machine store so they apply to whoever logs on - but you can specify Per User certificates too.

Hope that helps,
Chas

BRYPIE
01-19-2005, 06:35 AM
I haven't tried this yet, but it certainly sounds like it will help.

Thanks a lot. :)

teognost
02-11-2005, 09:14 AM
I tried this command:
certmgr -add -c root.cer -s -r localmachine root
but I got an err message:
"Error: Failed to open the source store"
Any idea why?

teognost
02-11-2005, 10:12 AM
I discovered what was wrong.
This command works :
certmgr -add -c c:\root.cer -s -r localmachine root