Question

Is it possible to convert a cert file to a pfx file? I tried importing my cerf file into IE, but it is never shown under the "personal" tab, thus I cannot export there.

I am looking for if there is alternatives available.

FYI, the cerf file is created by using "keytool" and then doing an export to a cert file.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top