1

I'm currently developping an UWP application for another company. I don't have the real certificate used to sign the app so i tried to generate a temporary certificate using a given publisher name. The publisher name should look like this so the other company could override the appxbundle signature:

E=email@company.com, CN=COMPANY NAME, O=COMPANY NAME, L=City, S=Region, C=FR

I tried to generate a certificate using these commands:

"C:\Program Files (x86)\Windows Kits\10\bin\x64\makecert.exe" -r -n "E=email@company.com, CN=COMPANY NAME, O=COMPANY NAME, L=City, S=Region, C=FR" -sv mycert.pvk mycert.cer

"C:\Program Files (x86)\Windows Kits\10\bin\x64\pvk2pfx.exe"  –pvk infoliaison.pvk –spc mycert.cer –pfx mycert.pfx –po mycert

or

New-SelfSignedCertificate -Type Custom -Subject "E=email@company.com, CN=COMPANY NAME, O=COMPANY NAME, L=City, S=Region, C=FR" -KeyUsage DigitalSignature -FriendlyName myproject -CertStoreLocation "Cert:\LocalMachine\My"

but Visual studio 2015 refuses to import them. I checked and they are not expired

If I try to generate a test certificate with visual studio with my publisher, the manifest in the appxbundle is modified like this:

<Identity Name="[...]" Publisher="CN=&quot;E=email@company.com, CN=COMPANY NAME, O=COMPANY NAME, L=City, S=Region, C=FR&quot;"/>

Is there any way i can do this?

Estar
  • 111
  • 6
  • Please refer the similar question,[code signing certificate](https://social.msdn.microsoft.com/Forums/onedrive/en-US/044f0f9b-ba22-41bc-813a-7db6e1d1bb56/uwp-code-signing-certificate?forum=wpdevelop). – Jayden May 02 '17 at 02:59
  • I managed to create a certificate with New-SelfSignedCertificate and it is accepted by Visual Studio (basic constraint was missing). However, it adds "CN=" in front of my publisher name... – Estar May 02 '17 at 09:01

1 Answers1

2

I finally managed to create a valid certificate, working with Visual Studio with the following command in powershell with admin rights

New-SelfSignedCertificate -Type Custom -Subject "E=email@company.com, CN=COMPANY NAME, O=COMPANY NAME, L=City, S=Region, C=FR" -KeyUsage DigitalSignature -FriendlyName myproject -CertStoreLocation "Cert:\LocalMachine\My" -TextExtension '2.5.29.37={text}1.3.6.1.5.5.7.3.3','2.5.29.19={critical}{text}ca=0'

I then exported the certificate in a pfx file and used it to sign my app

Estar
  • 111
  • 6