title: How can I tell whether a .PFX file requires a password
body: <p>In .NET, I'm loading a certificate from a .PFX file using the following:</p>
  
  <pre><code>var signingCertificate = new X509Certificate2(pfxFileName);
  </code></pre>
  
  <p>If the .PFX file requires a password, it throws a <code>CryptographicException</code>. How can I tell that the file requires a password (so that I can prompt for one)?</p>