title: X509Certificate.Export Method
body: <p>I try export cert .pfx :</p>
  
  <pre><code>string certPath = "D:\\cert.pfx";
  cert = new X509Certificate2(certPath, "pass");
  
  byte[] certData = cert.Export(X509ContentType.Pfx,"pass"); /// **error in this line** 
  
  X509Certificate newCert = new X509Certificate(certData,"pass");
  </code></pre>
  
  <p>But it finish with this error :</p>
  
  <p><strong>Key not valid for use in specified state.</strong></p>
  
  <p>Can somebody help me ??  Any solution as export certificate from store ??</p>