The Computer Oracle

Importing .PEM certificates on Windows 7 on the command line

-------------------------------------------------------------------------------
Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn
-------------------------------------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Secret Catacombs

--

Chapters
00:00 Question
00:55 Accepted answer (Score 68)
01:45 Thank you

--

Full question
https://superuser.com/questions/1031444/...

Question links:
[PEM certificate]: https://en.wikipedia.org/wiki/Privacy-en...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#windows7 #windows #commandline #certificate

#avk47



ACCEPTED ANSWER

Score 74


You need to use certutil.exe instead:

certutil –addstore -enterprise –f "Root" <pathtocertificatefile>

will add the certificate to the Trusted Root Certification Authorities store.

If you want to add an Intermediate Certification Authority, replace Root with CA and to add to your Personal store, change it to My.

All the above adds the certificate to the Local Computer store. To add to the User store remove the -enterprise from the command line:

certutil –addstore –f "Root" <pathtocertificatefile>

The -f in the command simply forces an overwrite in the case where the certificate is already installed.