title: C# Export cert in pfx format
body: <p>NET to export a certificate from the cert store into a <code>PFX</code> file. I'm trying to use the <code>X509certificate2.Export</code> method with the <code>X509ContentType.Pfx</code> flag set, but am unsure how to handle the returned byte array and output it correctly to file.</p>
  
  <p>Any help appreciated.</p>