静默接受 .pfx 证书 [英] Silent accept .pfx certificates

查看:40
本文介绍了静默接受 .pfx 证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这样的问题:我需要在我的安装 (WiX 3.5) 中导入 .pfx 证书.我需要接受在没有任何(!)用户交互的情况下导入它们,甚至接受(需要这样才能测试构建服务器和测试市场)

Such a problem: I need to import .pfx certificates in my installation (WiX 3.5). I need to accept importing them without any(!) user interaction, even acception (need to be so for testion on building servers and testing makets)

尝试使用 WiXIISExtension 的标准 WiX 解决方案,但没有用于安静(静默)导入的选项.

Tried standard WiX solution, using WiXIISExtension, but there is no option for quiet(silent) import.

在 C++ 上尝试过这样的解决方案(从 wix 中的 dll 延迟自定义操作):

Tried such solutions on C++ (deferred custom actions from dll in wix):

  1. PfxImportCertStore - CertEnumCertificatesStore - CertAddCertificateContextToStore:证书管理器要求接受...

  1. Chain PfxImportCertStore - CertEnumCertificatesStore - CertAddCertificateContextToStore: Certificate manager asked for acception...

CryptUIWizImport 带有标志 CRYPTUI_WIZ_NO_UI:CryptoAPI 尝试访问私钥,并且经理要求接受...

CryptUIWizImport with flag CRYPTUI_WIZ_NO_UI: CryptoAPI tried to access to a private key, and manager asked for acception...

有没有办法解决这个问题?或者我真的需要编写一个自定义服务来接受?

Is there any way of solving this? or I really need to write a custom service for acception?

推荐答案

好吧,我解决了我的问题.就我而言,它只是用户保护证书的标志.只是我的假人.但是,这两天我意识到:

Well, I solved my problem. In my case it was just the flag of user protected certificate. Just my dummy. but, in these two days I realised:

  • 注意导入证书的方法.当您需要使用从文件导入或从上下文导入时,您应该了解不同的情况.

  • Be carefully with the methods of importing certificate. You should know different situations, when you need to use import from file or from context.

注意标志,你使用过(如果你使用一些例子,更多)

Pay attention to the flags, you used (the more if you use some examples)

确保您的证书获得批准.

Be sure your certificate has approvals.

附言如果有人需要导入不同证书的工作代码的好例子,请评论我.

P.S. Comment me if somebody needs good examples of working codes of importing different certificates.

这篇关于静默接受 .pfx 证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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