exe文件签名

Ling Yu
Ling Yu

参考

New-SelfSignedCertificate -Type Custom -Subject "CN=Ling Yu, O=None, C=CN, L=, S=" -KeyUsage DigitalSignature -FriendlyName "MailTool" -CertStoreLocation "Cert:\CurrentUser\My" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}") -NotAfter (Get-Date).AddYears(10) # 会显示Thumbprint
 
# 设置密码
$password = ConvertTo-SecureString -String 928963415 -Force -AsPlainText
 
# 导出证书
Export-PfxCertificate -cert "Cert:\CurrentUser\My\<Thumbprint>" -FilePath app.pfx -Password $password
 
# 签名
signtool sign /f test.pfx /fd SHA256 /p $password /t http://timestamp.digicert.com /v "<obj>.exe"