问题描述
我遵循了这个链接 签署我的exe应用程序.
I followed this link to sign my exe application.
-
我在Windows 7上安装了SDK工具,
I installed SDK tool on Windows 7,
运行C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin>makecert.exe -sv App-O.pvk -n "CN=MY DIGITAL KEY" App-O.cer
打开对话框以提供密码:
Dialog opened to provide password:
我写了密码:"fess"
I wrote password : 'fess'
新窗口打开:
我输入了"fess"
I entered: 'fess'
#Succeeded
读取了文件App-O.cer和App-O.pvk.
files App-O.cer and App-O.pvk creaded.
现在我生成pfx:
pvk2pfx.exe -pvk App-O.pvk -spc App-O.cer -pfx App-O.pfx
打开对话框以提供密码:
Dialog opened to provide password:
我粘贴了"fess"
i pasted 'fess'
文件pfx已创建.
现在我运行signtool:
Now i run signtool:
C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin>signtool.exe sign /f "App-O.pfx" /p fess "C:\Output\setup.exe"
在这里我得到了错误:
SignTool Error: The specified PFX password is not correct.
Number of files successfully Signed: 0
Number of warnings: 0
Number of errors: 1
我想念什么?
顺便说一句,我从Windows SDK的CMD shell中得到了同样的错误.
BTW, the same error I get from CMD shell of Windows SDK.
谢谢
推荐答案
有两个问题.
首先,您正在使用自签名证书,因此您应该通过在makecert命令中添加-r键显式定义它,否则在签名步骤会收到错误消息签名者的证书无效".
First of all you are using self-signed certificate, so you should define it explicitly by adding -r key to makecert command or you'll get an error "The signer's certificate is not valid for signing" at sign step.
下一步,在此步骤
signtool.exe sign /f "App-O.pfx" /p fess "C:\Output\setup.exe"
您正尝试使用密码"fess"打开pfx.但是您实际上没有为pfx文件设置任何密码.为此,您应该在pfx创建命令中添加-po键.
you are trying to open pfx using password "fess". But you actually didn't set any password for pfx file. To do it you should add -po key to pfx creation command.
之后,您可以签署您的申请.
After that you can sign your application.
因此正确的过程将是:
makecert.exe -sv App-O.pvk -n "CN=MY DIGITAL KEY" App-O.cer -r
pvk2pfx.exe -pvk App-O.pvk -spc App-O.cer -pfx App-O.pfx -po fess
signtool.exe sign /f "App-O.pfx" /p fess "C:\Output\setup.exe"
以下是一些有用的链接:
Here is some useful links:
- 如何创建证书: http://msdn.microsoft.com/en-us/library/ff699202.aspx
- pvk2pfx命令键: http://msdn.microsoft.com/zh-我们/library/windows/hardware/ff550672%28v=vs.85%29.aspx
- signtool命令键: http://msdn.microsoft.com/zh-我们/library/windows/desktop/aa387764%28v=vs.85%29.aspx
- 如何对文件签名: http://msdn.microsoft.com/zh-我们/library/windows/desktop/aa388170%28v=vs.85%29.aspx
- How to create certificate:http://msdn.microsoft.com/en-us/library/ff699202.aspx
- pvk2pfx command keys:http://msdn.microsoft.com/en-us/library/windows/hardware/ff550672%28v=vs.85%29.aspx
- signtool command keys:http://msdn.microsoft.com/en-us/library/windows/desktop/aa387764%28v=vs.85%29.aspx
- How to sign a file:http://msdn.microsoft.com/en-us/library/windows/desktop/aa388170%28v=vs.85%29.aspx
这篇关于为什么我会收到“指定的PFX密码不正确"的信息?尝试使用signtool签名应用程序时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!