如何使用signtool.exe对CAB文件进行签名?

发布于 2024-08-20 03:53:46 字数 397 浏览 6 评论 0原文

  1. 我有 3 个文件
    mycert.cer
    mycert.pvk
    mycert.spc

有人可以解释一下吗 - 我应该使用这个文件做什么?

  1. 我需要从命令行使用signtool.exe 签署Test.cab 文件。 但我不明白 - 该怎么做。
    手册 http://msdn.microsoft.com/en- us/library/8s9b9yaz(VS.80).aspx 不太好:(

提前谢谢您。

  1. I have 3 files
    mycert.cer
    mycert.pvk
    mycert.spc

Could someone please explain me - what this files should I use for?

  1. I need to sign Test.cab file using signtool.exe from command line.
    But I do not understand - how to do it.
    Manual http://msdn.microsoft.com/en-us/library/8s9b9yaz(VS.80).aspx is not very good :(

Thank you in advance.

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

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

发布评论

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

评论(3

淡莣 2024-08-27 03:53:46

Microsoft 支持页面准确解释了您要执行的操作。这是关于“signcode.exe”的过时教程,与“signtool.exe”类似但不等于。

如果您想要一个简单的解决方案,您可能需要尝试signtool的向导模式(执行signtool signwizard),例如解释此处。但如果需要命令行执行,请查看 示例在 Microsoft 的支持页面上

The Microsoft Support Page explains exactly what you're trying to do. It is an outdated tutorial on "signcode.exe" which is similar but not equal to "signtool.exe".

If you want a simple solution, you may want to try signtool's wizard mode (execute signtool signwizard), e.g. explained here. But if command line execution is needed, check out the examples on Microsoft's support page.

若无相欠,怎会相见 2024-08-27 03:53:46

我只花了大约 1 个小时来完成这些工作。 所以我没有证书密码。

只是为了简化所有命令,请使用以下步骤

  1. 使用此文件夹C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin

  2. 将您的MyApp.cab复制到此文件夹文件。

  3. 像我一样使用此命令创建 2 个文件,无需密码。 忽略在出现的弹出窗口中输入密码。

makecert -r -pe -n "CN=yourcompanyaddress.com" -b 01/01/2016 -e
01/01/2030 -天空交换companyCert.cer -sv companyPvk.pvk

  1. 此后执行另一个命令来创建 PFX 文件

pvk2pfx.exe -pvk 公司Pvk.pvk -spc 公司Cert.cer -pfx
公司Pfx.pfx

现在你可以在这个文件夹中看到 companyPfx.pfx

  1. 最后使用 PFX 文件签署你的 CAB 文件

SignTool 签名 /f companyPfx.pfx MyApp.cab

  1. 打开此文件的属性,您应该看到它已经签名。

我希望它会有用。

I just spend about 1 hour to get working this stuff. So I did it without certificate's password.

Just to simplify all commands use following steps

  1. Use this folder C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin

  2. Copy to this folder your MyApp.cab file.

  3. Create 2 files using this command without password as I did. Ignore to input password in popup that appears.

makecert -r -pe -n "CN=yourcompanyaddress.com" -b 01/01/2016 -e
01/01/2030 -sky exchange companyCert.cer -sv companyPvk.pvk

  1. After this execute another command to create PFX file

pvk2pfx.exe -pvk companyPvk.pvk -spc companyCert.cer -pfx
companyPfx.pfx

So now you see in this folder companyPfx.pfx

  1. And finally sign your CAB file like this using PFX file

SignTool sign /f companyPfx.pfx MyApp.cab

  1. Open properties of this file and you should see that it is signed already.

I hope it will be useful.

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