cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting an "Error: Bad Length." when attempting sign

Getting an "Error: Bad Length." when attempting sign

Summary

Getting an "Error: Bad Length." when attempting sign

Symptoms

When attempting to sign with certain certificates the user gets "Error: Bad Length." when using isign.exe to sign. .exe and .hdr files.
Converting the spc and pvk files to a pfx allows it to sign .exe files with signtool.exe
Specifying the spc and pvk file in the signing tab of the release in the IDE also signs without error if One-Click install is set to No. Will fail with a -7274 error if set to Yes.

Cause

This appears likely to be related to the scenario discussed on MSDN where a 2048-bit key is not handled on Windows 7 with the base provider, but is on Windows Vista and earlier. CryptImportPublicKeyInfo returning NTE_BAD_LEN for 2048-bit keys on Win7


Workaround

Add -cp "Microsoft Enhanced Cryptographic Provider v1.0" to the command line:
isign.exe -spc webclientIE.spc -v webclientIE.pvk -cp "Microsoft Enhanced Cryptographic Provider v1.0" setup.exe


Additional Information

CryptImportPublicKeyInfo returning NTE_BAD_LEN for 2048-bit keys on Win7
Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Jul 13, 2018 09:28 PM
Updated by: