Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
NET 将证书从证书存储区导出到PFX文件中。我正在尝试使用设置X509certificate2.Export了标志的方法X509ContentType.Pfx,但不确定如何处理返回的字节数组并将其正确输出到文件。
PFX
X509certificate2.Export
X509ContentType.Pfx
任何帮助表示赞赏。
从日期来看,你可能已经想通了,但你所要做的就是将返回的字节数组直接写入文件:
byte[] certData = cert.Export(X509ContentType.Pfx, "MyPassword"); File.WriteAllBytes(@"C:\MyCert.pfx", certData);