I use this code to create the .key files starting from a .pfx certificate and everything works fine.
////////////////////////////////////////////Create file .key
string cParK = " pkcs12 -in certificate.pfx -out certificate.key -nocerts -nodes -nomacver -password pass:" + cPass;
System.Diagnostics.ProcessStartInfo startInfo2 = new System.Diagnostics.ProcessStartInfo("openssl.exe", cParK);
startInfo2.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo2.CreateNoWindow = true;
System.Diagnostics.Process oProcess2 = System.Diagnostics.Process.Start(startInfo2);
oProcess2.StartInfo.CreateNoWindow = true;
oProcess2.WaitForExit();
Is there any way to create the same files without using openssl but only c #?