Conversion from cert file to pfx file

怎甘沉沦 提交于 2019-12-06 02:42:14
Martin Buberl

This article describes two ways of creating a .pfx file from a .cer file:

Create your public & private Keys (You will be prompt to define the private key’s password):

makecert.exe -sv MyKey.pvk -n "CN=.NET Ready!!!" MyKey.cer

Create your PFX file from the public and private key

pvk2pfx.exe -pvk MyKey.pvk -spc MyKey.cer -pfx MyPFX.pfx -po toto

Programmaticaly you could do so in C# by writing the byte array directly to a file:

byte[] certificateData = certificate.Export(X509ContentType.Pfx, "YourPassword");
File.WriteAllBytes(@"C:\YourCert.pfx", certificateData);

And generally (if you're using IE 8) you might want to have a look at this answer on SO:

Hope that helps you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!