如何从 .pfx 文件导入证书的私钥?我有这个代码:
X509Certificate2 cert = new X509Certificate2("C:/amazon.pfx", "hello", X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
string private_key = cert.PrivateKey.ToString();
Console.WriteLine(private_key);
但是,输出是:
System.Security.Cryptography.RSACryptoServiceProvider
如何获取字符串格式的私钥?