Veler
Veler

Reputation: 171

Create a temporary certificate manually

I would like to create a temporary certificate (required for build a metro app) by command prompt. I had try to do this with CMD :

makecert.exe -n "CN=MY_DOMAIN" -r -a sha1 -sv MY_DOMAIN.pvk MY_DOMAIN.cer –ss root

pvk2pfx -pvk MY_DOMAIN.pvk -spc MY_DOMAIN.cer -pfx MY_DOMAIN.pfx

But when I this pfx file in my project, I have the following error :

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\AppxPackage\Microsoft.AppXPackage.Targets(1142,9): error : APPX0107 : the specified certificate is not valid for signing.

Upvotes: 4

Views: 2253

Answers (1)

akton
akton

Reputation: 14386

Three changes:

  1. The certificate lacks the Code Signing OID (1.3.6.1.5.5.7.3.3) in the Enhanced Key Usage extension. Add it using the -eku 1.3.6.1.5.5.7.3.3 argument to makecert.
  2. Place the certificate into the My certificate store rather than the root certificate store by replacing -ss root with -ss My.
  3. Ensure the certificate is an end entity in the Basic Constraints extension using the -cy end argument to makecert.

See MSDN Signing an app package (Windows Store apps) for more information on signing Windows Store apps and MakeCert for more information on makecert arguments.

Upvotes: 6

Related Questions