从命令行将pfx文件导入特定的证书存储 [英] Import pfx file into particular certificate store from command line

查看:2328
本文介绍了从命令行将pfx文件导入特定的证书存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用CertUtil将证书从pfx文件导入用户的个人商店相对容易:

  certutil -f -p [certificate_password] -importpfx C:\ [certificate_path_and_name] .pfx 

当前用户的个人存储。我需要它在LocalMachine的TrustedPeople。



有什么方法我可以从命令行,通过调用certutil importpfx的不同参数,使用另一个certutil命令或不同的实用程序? Powershell是另一种可能性,虽然我不太了解它。



干杯,
Matt



将证书导入到本地计算机上的受信任的根证书颁发机构:

  CERTUTIL -addstore -enterprise -f -v rootsomCertificat.cer

在本地机器上将pfx导入Personal

  CERTUTIL -f -p somepassword -importpfxsomePfx.pfx

将pfx导入本地计算机上的受信任的人 - 链接到importpfx.exe

  importpfx.exe -fsomePfx.pfx-psomePassword-t MACHINE -sTRUSTEDPEOPLE


$ b b

将本地计算机上的受信任的人导入证书

  Certutil -addstore -fTRUSTEDPEOPLEsomeCertificate.cer


It's relatively easy to import a certificate into the user's personal store from a pfx file by using CertUtil:

certutil –f –p [certificate_password] –importpfx C:\[certificate_path_and_name].pfx 

But this ends up in the Personal Store of the current user. I need it in TrustedPeople on LocalMachine.

Is there any way I can do this from the command line, either by calling different arguments on certutil importpfx, using another certutil command or a different utility? Powershell is another possibility, although I don't know much about it.

Cheers, Matt

解决方案

Anchoring my findings here for future readers.

Import certificate to Trusted Root Certification Authorities on Local Machine:

CERTUTIL -addstore -enterprise -f -v root "somCertificat.cer"

Import pfx to Personal on local machine

CERTUTIL -f -p somePassword -importpfx "somePfx.pfx"

Import pfx to Trusted People on local machine - Link to importpfx.exe

importpfx.exe -f "somePfx.pfx" -p "somePassword" -t MACHINE -s "TRUSTEDPEOPLE"

Import certificat to Trusted People on local machine

Certutil -addstore -f "TRUSTEDPEOPLE" "someCertificate.cer"

这篇关于从命令行将pfx文件导入特定的证书存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆