在Powershell中尝试签署代码时出现未知错误。

问题描述 投票:0回答:1

我已经创建了一个用于代码签名的证书,它在 Cert:/LocalMachine/Root 但当我尝试签署我的程序时(example.exe)它给我 未知的错误.

我已经尝试了所有的解决方案,我可以在互联网上找到,他们都没有工作。

$cert = New-SelfSignedCertificate -Subject "Certificate" -Type CodeSigningCert -CertStoreLocation cert:\LocalMachine\My

然后,我打开证书管理器,并将其移动到受信任的根权限。

Set-AuthenticodeSignature -FilePath 'C:\programs\example.exe' -Certificate $cert

错误。

SignerCertificate                   Status                    Path
-----------------                   ------                    ----
                                    UnknownError              example.exe
powershell code-signing
1个回答
0
投票

在PSGCI Cert:\LocalMachine/My -CodeSigningCert中运行,这将显示代码签名证书是否可用(应该显示拇指印)。

如果没有任何显示,请将Cert从Root*移到LM/Personaltry......Cert是否被列为可用。

再次尝试签名。

© www.soinside.com 2019 - 2024. All rights reserved.