SignTool Error: ISignedCode::Sign returned error: 0x80092006

后端 未结 5 1971
-上瘾入骨i
-上瘾入骨i 2021-01-05 13:06

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

相关标签:
5条回答
  • 2021-01-05 13:16

    To save someone time, I had this problem. It turned out my certificate somehow got corrupted. After I removed it from the certificate store and imported it again, the problem went away. I'd suggest creating the PFX file all over or copying it from a location where you know it is not corrupted.

    0 讨论(0)
  • 2021-01-05 13:16

    This can happen if your windows password is changed after the certificate was installed. Changing the password back to what it was will fix it. If you can't do that you'll need to reinstall the certificate.

    0 讨论(0)
  • 2021-01-05 13:24

    I've [just now, just once] experienced the same condition (immediately after a successful invocation with the same parameters except on a different MSI file). Rerunning succeeded on the next execution of the build script. Also using, like you

    /sm /d /du
    Not using
    /n
    Additionally using
    /t

    0 讨论(0)
  • 2021-01-05 13:37

    The problem is that your service process cannot access your private key, which is stored under your account.

    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 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.

    0 讨论(0)
  • 2021-01-05 13:37

    I've had this problem as well. Still not quite sure what caused it since I never had the time to find out. The thing I found was that the private key went missing!?

    I did what coder_2007 suggests and it worked for one complete automated build but the next one would give the same error. So something on my build server broke the private key after a complete build (including several signed applications).

    What I finally ended up doing was, immediately after importing the PFX, to go to %allusersprofile%\Microsoft\Crypto\RSA\MachineKeys and write protect the latest file (the one that match the time of import).

    0 讨论(0)
提交回复
热议问题