-
Run Command Prompt as admin. (Press windows key, type “cmd”. Then right click and select “Run As Admin”.)
-
Copy and paste the following command into your Command Prompt to change your directory.
cd C:\Program Files (x86)\Windows Kits\8.1\bin\x64
- Run the following command to create .pvk and .cer files. Replace the publisherName parameter with your “CN=Company Name, O=Organization, C=Two Letter Country Code”. Replace the ExpirationDate parameter with an expiration date for your certificate in the mm/dd/yyyy format.
MakeCert /n publisherName /r /h 0 /eku "1.3.6.1.5.5.7.3.3,1.3.6.1.4.1.311.10.3.13" /e expirationDate /sv MyKey.pvk MyKey.cer
-
You will be prompted to create a password for your .pvk file. Make sure to note this in a secure place.
-
Run the following command to convert your .pvk and .cer files into a .pfx file. Use your .pvk and .cer file names, as well as the password you created in the previous step.
Pvk2Pfx /pvk pvkFileName.pvk /pi pvkPassword /spc cerFileName.cer /pfx pfxFileName.pfx
-
Run the following command using your password and the name of the .pfx you generated.
certutil -user -p pfxPassword -importPFX pfxFileName
-
You will be prompted by a security warning asking if you’d like to install the certificate on your computer. Select “Yes”.
-
For easier access you can move your .cer, .pfx and .pvk files from your Windows Kits folder(C:\Program Files (x86)\Windows Kits\8.1\bin\x64) to your app folder on your Desktop.
-
Double click your .cer file to open. Under the “Details” tab select “Thumbprint” to view your certificates thumbprint.
-
Open a new command prompt and change your directory to your app file.
-
Run the following command with your information.
cordova build -- --packageCertificateKeyFile="PathTopfxFile" --packageThumbprint="YourPackageThumbprint"
You now have a signed app you can submit to the Windows store.