title: X509Certificate.CreateFromCertFile - the specified network password is not correct
body: <p>I have a .NET application that I want to use as a client to call an SSL SOAP web service. I have been supplied with a valid client certificate called <code>foo.pfx</code>. There is a password on the certificate itself.</p>
  
  <p>I've located the certificate at the following location: <code>C:\certs\foo.pfx</code></p>
  
  <p>To call the web service, I need to attach the client certificate. Here's the code:</p>
  
  <pre><code>public X509Certificate GetCertificateFromDisk(){
      try{             
  
         string certPath = ConfigurationManager.AppSettings["MyCertPath"].ToString(); 
         //this evaluates to "c:\\certs\\foo.pfx". So far so good.
  
         X509Certificate myCert = X509Certificate.CreateFromCertFile(certPath);
         // exception is raised here! "The specified network password is not correct" 
  
         return cert;
  
       }
      catch (Exception ex){    
          throw;
       }
  }
  </code></pre>
  
  <p>It sounds like the exception is around the .NET application trying to read the disk. The method <code>CreateFromCertFile</code> is a static method that should create a new instance of X509Certificate. The method isn't overridden, and has only one argument: the path.</p>
  
  <p>When I inspect the Exception, I find this:</p>
  
  <pre><code>_COMPlusExceptionCode = -532459699
  Source=mscorlib
  </code></pre>
  
  <p>Question: does anyone know what the cause of the exception "The specified network password is not correct" ?</p>