【发布时间】:2016-07-12 03:59:40
【问题描述】:
使用Set-AuthenticodeSignature 时,有一个名为IncludeChain 的选项。虽然有关于每个选项是什么的文档,但我无法发现围绕每个设置的优点/缺点的太多指导(当你选择一个设置而不是另一个设置时)。
我在示例中看到IncludeChain 的任何地方,它总是设置为All。我认为All 可能是最好的答案,但我想了解每种设置的优缺点。
-
Signer -
NotRoot(默认) All
除了All让文件有点大,每个设置的具体优缺点是什么?
参考文献
- https://technet.microsoft.com/en-us/library/hh847874.aspx
- http://go.microsoft.com/fwlink/?LinkID=113391
- How Can I Prevent Needing to Re-sign My Code Every 1 or 2 Years?
示例
$certPfx = "super secret location"
$certPassword = "super secret password"
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($certPfx, $certPassword)
Set-AuthenticodeSignature -Filepath "ps1 file location" `
-Cert $cert `
-TimeStampServer "url to timestamp server" `
-IncludeChain All `
-HashAlgorithm SHA256
【问题讨论】: