Convert from certificate file to pfx file

Can I convert a certificate file to a pfx file? I tried to import my cerf file into IE, but it never appears under the "personal" tab, so I can’t export there.

I am looking for if there are alternatives.

FYI, the cerf file is created using "keytool" and then export to the certificate file.

+3
source share
1 answer

This article describes two ways to create a .pfx file from a .cer file:

Create your public and private keys (you will be asked to enter the password for the private keys):

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

Create your PFX file from public and private key

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

Programmatically, you can do this in C # by writing an array of bytes directly to a file:

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

And anyway (if you are using IE 8), you can look at this answer on SO:

Hope this helps.

+6
source

All Articles