Dan*_*Dan 13 msbuild password-protection pfx
我需要在我的构建中添加证书签名.下面是我编写的工作脚本示例,但它包含.pfx文件的密码.我无法在构建脚本中保留密码.在这种情况下你会使用什么"最佳实践"或黑客?
<ItemGroup Label="SignFiles">
<SignFilesInclude="$(FileLocation)\**\*.exe"/>
</ItemGroup>
<Exec Command="$(SignTool) sign /v /ac C:\MSCV-VSClass3.cer /f C:\Certificate.pfx /p Password /t http://timestamp.verisign.com/scripts/timestamp.dll %(SignFiles.Identity)"/>
Run Code Online (Sandbox Code Playgroud)
在谷歌搜索之后,我在多个地方读到,一旦你第一次使用密码运行脚本,.pfx就存储在证书存储中,之后构建脚本中不需要密码.这是有效的,但我想确保这是最好的方法,或者更好,但有一种方法可以避免将密码放在脚本中.
kbj*_*klu 19
将.pfx文件导入Windows证书管理器,以获取构建时使用的用户帐户.然后使用signtool的/ sha1开关选择正确的证书,不需要密码.
certmgr.msc12 34 56 78 90 ab cd ef 12 34 56 78 90 ab cd ef 12 34 56 78signtool /sha1 1234567890abcdef1234567890abcdef12345678 /t http://timestamp.verisign.com/scripts/timestamp.dll %(SignFiles.Identity)第8步不会要求输入密码.
| 归档时间: |
|
| 查看次数: |
2666 次 |
| 最近记录: |