简体   繁体   English

安装程序的自签名证书不起作用

[英]Self Signed Certificate for a installer not working

I'm a bit confused... I digitally signed my installer.exe file, but when I copy the file to a new computer and look at the properties it has a completely different certificate.我有点困惑......我对我的 installer.exe 文件进行了数字签名,但是当我将该文件复制到一台新计算机并查看其属性时,它具有完全不同的证书。

I ran this in powershell as admin and it gave me the thumbprint我以管理员身份在 powershell 中运行它,它给了我指纹

New-SelfSignedCertificate -Type CodeSigningCert -CertStoreLocation "Cert:\LocalMachine\My" -Subject "CN=GreenSwamp Software" -TextExtension @("2.5.29.19={text}false") -KeyUsage DigitalSignature -KeyLength 2048 -NotAfter (Get-Date).AddMonths(33) -FriendlyName "GreenSwamp Software"

This i ran this with the thumbprint from above to create the pfx and this worked..这是我用上面的指纹运行它以创建 pfx 并且这有效..

$pwd = ConvertTo-SecureString -String ????????-Force -AsPlainText 
Export-PfxCertificate -cert "Cert:\LocalMachine\My\DE67300F5009BFC86BB038C8F162BA2992FEEC8C" -FilePath "C:\Users\Rob\source\repos\GSSolution\Resources\Installer\GreenSwamp.pfx" -Password $pwd

Then to sign the exe with this...然后用这个签署exe...

C:\Program Files (x86)\Windows Kits\10\Tools\bin\i386\signtool.exe sign /f "C:\Users\Rob\source\repos\GSSolution\Resources\Installer\GreenSwamp.pfx" /p ????? /d "GreenSwamp Installer"  "C:\Users\Rob\source\repos\GSSolution\Resources\Installer\ASCOMGSServer10025Setup.exe"

looking at the exe properties it has the right digital signature.查看 exe 属性,它具有正确的数字签名。 But then I copy the exe to a new computer and look at properties and it's a different signature, not mine.但随后我将 exe 复制到一台新计算机并查看属性,这是一个不同的签名,而不是我的。

Any idea?任何的想法?

我发现了这个问题,这是一个用户错误,但会留下这个问题,因为它解释了有效的步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM