我需要在我的构建中添加证书签名.下面是我编写的工作脚本示例,但它包含.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就存储在证书存储中,之后构建脚本中不需要密码.这是有效的,但我想确保这是最好的方法,或者更好,但有一种方法可以避免将密码放在脚本中.