Create a temporary certificate manually

I would like to create a temporary certificate (needed to build the metro application) on the command line. I tried to do this using 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 have 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.

+4
source share
1 answer

Three changes:

  • In the extended extension of the extended key, the certificate does not contain a signature code identifier (1.3.6.1.5.5.7.3.3). Add it using the -eku 1.3.6.1.5.5.7.3.3 argument to makecert .
  • Place the certificate in the My certificate store instead of the root certificate store, replacing -ss root with -ss My .
  • Verify that the certificate is the final entity in the Basic Constraints extension using the -cy end argument to makecert.

See MSDN Signing an Application Package (Windows Store Application) for more information on signing Windows Store applications and MakeCert for more information on makecert arguments.

+6
source

Source: https://habr.com/ru/post/1435746/


All Articles