title: How to create a working trusted and or self-signed certificate for a Windows 10 UWP application via Visual Studio 2019, 2017 and 2015
body: <p>Per this documentation:</p>
  
  <p><a href="https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/makecert" rel="noreferrer">https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/makecert</a></p>
  
  <p>The following command describes creating a windows cer-file (i.e. a certificate from a trusted provider.)  </p>
  
  <p>The issue with this is that when building an application in visual studio 2017 it only allows, via the package.windows10.appxmanifest, a pfx file.  when updating the this command line reference it doesn't produce a pvk file so one needs to add </p>
  
  <pre><code>MakeCert -r -pe -ss PrivateCertStore -n "CN=Contoso.com(Test)" testcert.cer
  </code></pre>
  
  <p>additional command line options such as /sv SubjectKeyFile which will produce the resulting pvk file.  </p>
  
  <p>However even using this command line reference:</p>
  
  <pre><code>MakeCert -r -pe -ss PrivateCertStore -n "CN=Contoso.com(Test)" -sv testcert.pvk testcert.cer
  </code></pre>
  
  <p>The resulting cert file implantation into visual studio produces this error:</p>
  
  <blockquote>
    <p>The manifest designer could not import the certificate. </p>
    
    <p>The certificate you selected is not valid for signing because it is either expired or has another issue.  For more information, see
    <a href="http://go.microsoft.com/fwlink/?LinkID=241478" rel="noreferrer">http://go.microsoft.com/fwlink/?LinkID=241478</a></p>
  </blockquote>
  
  <p>I go to the link and nothing explains really what is going on.  One person comments to create a temporary one that works but it is a nonspecific test cert that lasts only a year.  </p>
  
  <p>Is there a better way to create the script with makecert?  How do I know if the cert is ultimately building correctly or not?  Additional documentation would be helpful but I have not found anything else. </p>