Generating a Test Certificate for Windows 10 UWP with 10 years expiry
Generating a Test Certificate for Windows 10 UWP with 10 years expiry
I have generated a certificate using following Powershell Command:
New-SelfSignedCertificate -Type Custom -Subject "CN=Something" -TextExtension @("2.5.29.37=criticaltext1.3.6.1.5.5.7.3.3", "2.5.29.19=text") -KeyUsage DigitalSignature -FriendlyName "Friendly Name" -CertStoreLocation "Cert:LocalMachineMy" -NotBefore (Get-Date) -NotAfter (Get-Date).AddYears(10)
Then I am exporting it using following command:
Export-PfxCertificate -cert "Cert:LocalMachineMy0fa4dd7524315b780abaa9cb70dc4755da1103c" -FilePath C:testcertificate.pfx -Password $pwd
Now when I am using this certificate from Package.appxmanifest file. It is throwing following error:

I am using Visual Studio 2017 with SDK Version 1809
I have also tried to export using Certificate Management Snap in MMC.
What am I missing?
If this works for you, post it as an answer and mark it as accepted.
– kennyzx
Sep 17 '18 at 13:36
2 Answers
2
I'm not sure about the Powershell commands, but you can do this with the normal SDK commands makecert, pvk2pfx, and certutil.
makecert
pvk2pfx
certutil
You can get a sample batch file from this GitHub project but the basic commands are as follows (using an expiry date of 1/1/2030):
makecert /n CN=foo /r /h 0 /eku "1.3.6.1.5.5.7.3.3,1.3.6.1.4.1.311.10.3.13" /e 1/1/2030 /sv foo.pvk foo.cer
pvk2pfx /pvk foo.pvk /spc foo.cer /pfx foo.pfx
certutil -addstore TrustedPeople foo.cer
You can try skipping signing checks.
Open the project file (.csproj), and add the following line under the first PropertyGroup element.
PropertyGroup
<EnableSigningChecks>false</EnableSigningChecks>
Can we sideload after skipping signing checks?
– Daredevil
Sep 17 '18 at 12:17
It works in my test. - Edit: we have been doing this for years.
– kennyzx
Sep 17 '18 at 12:43
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy
So turns out that I need to import the certificate first into my system certificate store. When I run visual studio as admin, it is not failing.
– Daredevil
Sep 17 '18 at 12:18