Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import Certificate to Trusted Root but not to Personal [Command Line]

I am trying to import two certificates to my local machine using the command line.

I have one certificate to add to the Personal Store of the local machine, and another one to add to the Trusted Root Certification Authorities.

Here is the command to had to Personal Store and not to add at root:

certutil -f -importpfx CA.pfx NoRoot

And to add at Trusted Root and not personal ? Is there any tag ? I didn't found at command help "/?"

like image 792
TiagoM Avatar asked May 26 '14 11:05

TiagoM


People also ask

How do I import a trusted root certification?

Expand the Computer Configuration section and open Windows Settings\Security Settings\Public Key. Right-click Trusted Root Certification Authorities and select Import. Follow the prompts in the wizard to import the root certificate (for example, rootCA. cer) and click OK.


1 Answers

Look at the documentation of certutil.exe and -addstore option.

I tried

certutil -addstore "Root" "c:\cacert.cer" 

and it worked well (meaning The certificate landed in Trusted Root of LocalMachine store).

EDIT:

If there are multiple certificates in a pfx file (key + corresponding certificate and a CA certificate) then this command worked well for me:

certutil -importpfx c:\somepfx.pfx 

EDIT2:

To import CA certificate to Intermediate Certification Authorities store run following command

certutil -addstore "CA" "c:\intermediate_cacert.cer" 
like image 193
pepo Avatar answered Sep 26 '22 01:09

pepo