通过 wix 安装了 .pfx 证书,给我一个密钥集不存在错误,但手动安装却没有

发布于 2024-11-09 07:42:36 字数 432 浏览 0 评论 0原文

我看了这个答案: 在用户存储中安装 pfx 证书在 Windows 中使用 WiX 要通过wix安装证书并且似乎工作正常,证书(我需要两个)安装在正确的位置存储中,并且具有正确的问题值和颁发者值。

但是,当我尝试在已安装的应用程序中使用它们时,出现键集不存在异常。

当我使用 MMC-> 从 wix 中定义的位置导入来手动安装 pfx 文件时,它工作正常。

权限略有不同,因为 wix 添加了所有者权限和 msiserver 权限,并删除了我无法手动添加的临时 S-1-5-5-0-XXXXX 读取权限。

有谁知道什么会导致这个问题?

I looked at this answer:
Install a pfx certificate in a users store in Windows using WiX
to install the certificate through wix and seemed to work fine, the certificates (i need two) were installed in the correct location stores and had the correct values for issues to and issued by.

However, when i tried to use them in my installed application, i get keyset does not exist exception.

When i manually install the pfx file using MMC->import from exactly the defined location in wix, it works fine.

The permissions are slightly different in the sense that wix has added owner rights and msiserver permissions and removes the temporary S-1-5-5-0-XXXXX read permission that i cannot manually add.

Does anyone have any idea what would be causing this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽梦忆笙歌 2024-11-16 07:42:36

这不是权限问题,而是 msi 安装方式的问题。

要获得安装证书所需的权限,此操作必须作为延迟操作运行,该操作在系统帐户下运行。

系统帐户没有配置文件,我认为这是使用私钥安装证书所必需的(我认为私钥在移动到 MachineKey 存储之前会暂时写入配置文件)。

我已经设法让我的 msi 使用私钥安装证书,但这有点任务......

  1. 我创建了一个生成并导入证书的控制台应用程序。
  2. 作为安装的一部分,将此 exe 放入安装文件夹中。
  3. 使用模拟 CustomAction,生成提升的 PowerShell 命令 (-Verb RunAs)。
  4. 运行一个执行 exe 的脚本。

正如我所说,有一点使命,但现在效果很好! :)

This is not a permissions issue but a problem with the way msi's are installed.

To get the required permissions to install a cert, this action has to be run as a deferred action, which runs under the system account.

The system account has no profile which I believe is required to install the cert with the private key (I reckon the private key is temporarily written to the profile before moving to the MachineKey store).

I have managed to get my msi to install the certificate with the private key but it was a bit of a mission...

  1. I created a console app that generates and imports the cert.
  2. Drop this exe in the installation folder as part of the installation.
  3. Using an impersonating CustomAction, spawn an elevated PowerShell command (-Verb RunAs).
  4. Run a script that executes the exe.

As I said a bit of a mission but in now works perfectly! :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文