title: Self-signed certificate - unable to open certificate
body: <p>I need a self-signed certificate to create a ClickOnce application in C++. I'm a real novice at deployment, so I'm following Stack Overflow question <em><a href="https://stackoverflow.com/questions/84847/how-do-i-create-a-self-signed-certificate-for-code-signing-on-windows">How to create a self signed certificate</a></em>.</p>
  
  <p>Here's the command sequence I've used</p>
  
  <pre><code>makecert -r -pe -n "CN=Watersteward" -ss CA -sr CurrentUser -sky signature -sv WaterSteward.pvk WaterSteward.cer
  makecert -pe -n "CN=Watersteward" -sky signature -ic WaterSteward.cer -iv WaterSteward.pvk -sv WsSPC.pvk WsSPC.cer
  pvk2pfx -pvk WsSPC.pvk -spc WsSPC.cer -pfx WsSPC.pfx
  mage -s Alpine.exe.manifest -CertFile WsSPC.pfx
  </code></pre>
  
  <p>The last command to sign the manifest fails with the message:</p>
  
  <blockquote>
    <p>Unable to open certificate "WsSPC.pfx": The specified network password is not correct.</p>
  </blockquote>
  
  <p>I added <em>WaterSteward.cer</em> to the Trusted Root Certificate Authorities after creation and before going on to the next step.</p>
  
  <p>During each step above, a dialog popped up asking for a password. In each case I clicked <em>None</em> (I've also tried it with  <code>-n "CN=mydomain\mylogin"</code> and giving my password in the dialogs).</p>