title: Exporting or Saving CX509PrivateKey
body: <p>Is it possible somehow to save or export <code>CX509PrivateKey</code>. The idea is that I create a CSR sent to CA get a Certificate and then... somehow I have to get the private key but no idea how, unfortunately nothing found on google.</p>
  
  <p>My piece of code:</p>
  
  <pre><code>var objPrivateKey = new CX509PrivateKey();
  objPrivateKey.Length = int.Parse(ConfigurationManager.AppSettings["objPrivateKeyLength"]);
  objPrivateKey.KeySpec = X509KeySpec.XCN_AT_SIGNATURE;
  objPrivateKey.KeyUsage = X509PrivateKeyUsageFlags.XCN_NCRYPT_ALLOW_ALL_USAGES;
  objPrivateKey.MachineContext = false;
  objPrivateKey.ExportPolicy = X509PrivateKeyExportFlags.XCN_NCRYPT_ALLOW_EXPORT_FLAG;
  objPrivateKey.CspInformations = objCSPs;
  objPrivateKey.Create();
  </code></pre>