SignTool错误:ISignedCode :: Sign返回错误:0x80092006 [英] SignTool Error: ISignedCode::Sign returned error: 0x80092006
问题描述
我正在使用受信任的CA颁发的证书对EXE程序进行签名。
我正在使用Windows SDK v6.0a中的signtool.exe。
I'm signing an EXE program with a certificate issued by a trusted CA. I'm using signtool.exe from the Windows SDK v6.0a.
证书位于计算机商店中,并且在个人中
The certificate is located in the computer store and it is in the "Personals" folder.
我的命令行是:
sign /sm /n "My company" /d MyProductName /du http://my.url.com "C:\Setup\setup.exe"
当我在命令行上运行此命令时,它可以正常工作。
当我在批处理过程中运行此命令(由Web服务调用,因此在执行该命令时没有用户登录),会发生以下错误:
When I run this command on the command line, it works fine. When I run this command in a batch process (called by a webservice, so there is no user logged in when the command is executed), the following error occur :
错误数量:1
SignTool错误:ISignedCode :: Sign返回错误:0x80092006
未为存储或对象指定提供程序。
任何人都可以帮忙吗?
推荐答案
问题是您的服务进程无法访问您的私钥,该私钥存储在您的帐户下。
The problem is that your service process cannot access your private key, which is stored under your account.
登录到运行Web服务的帐户,并将私钥导入密钥容器。例如,您可以使用 strong name工具(sn.exe) .NET的a>:
Log on into the account that is running the web service and import the private key into a key container. You can do this for example using the strong name tool (sn.exe) of .NET:
sn -i MyCertificate.pfx MyCodeSigningKey
现在,更改您的生成脚本以使用此密钥容器:
Now, change your build script to use this key container:
signtool sign /sm /a /v /csp "Microsoft Strong Cryptographic Provider" /kc MyCodeSigningKey <other parameters...>
/ kc
指定密钥容器。 / kc
要求您通过 / csp
开关指定 CSP(加密服务提供商)。 Microsoft强密码提供程序是 sn
使用的默认提供程序。
/kc
specifies the key container. /kc
requires that you specify the "CSP" (Cryptographic Service Provider) via the /csp
switch. "Microsoft Strong Cryptographic Provider" is the default provider used by sn
.
这篇关于SignTool错误:ISignedCode :: Sign返回错误:0x80092006的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!