Import Signature Certificate not working

I am trying to create a private key certificate (.pfx) that I can use in my application to create and verify digital signatures. I want to install this certificate in a certificate store (Windows).

I am having problems importing a certificate to a local computer. The Certificate Import Wizard always reports "Wrong password entered." This refers to the password for the private key in the pfx file that I created.

Now I know that the password is correct, so there should be another factor.

The script I use to create a key with a batch file and contains the following command:

makecert -r -pe -n "CN=%1" -b 01/01/2010 -e 01/01/2060 -sky signature %1.cer -sv %1.pvk pvk2pfx.exe -pvk %1.pvk -spc %1.cer -pfx %1.pfx 

Does anyone know what an import wizard can tell me that "the password you entered is incorrect"?

+6
source share
2 answers

As MarkW pointed out, try entering a password on the command line instead of typing in a dialog box, for example:

pvk2pfx -pvk Test.pvk -pi p4sswd -spc Test.cer -pfx Test.pfx -po p4sswd

+5
source

If you enter the password in the dialog using pvk2pfx.exe , the password will be empty if you try to import the .pfx file later. As already mentioned, you can set a password using -pi . If you do not use a password other than the secret key password, you can use -po .

pvk2pfx.exe usage instructions:

 pvk2pfx -pvk <pvk-file> [-pi <pvk-pswd>] -spc <spc-file> [-pfx <pfx-file> [-po <pfx-pswd>] [-f]] -pvk <pvk-file> - input PVK file name. -spc <spc-file> - input SPC file name. -pfx <pfx-file> - output PFX file name. -pi <pvk-pswd> - PVK password. -po <pfx-pswd> - PFX password; same as -pi if not given. -f - force overwrite existing PFX file. if -pfx option is not given, an export wizard will pop up. in this case, options -po and -f are ignored. 
+1
source

All Articles