Generate PFX file at the command line

A PFX (Personal Information Exchange) file is packed in a standard file format called PKCS#12, and used by both Microsoft ISA and IIS products.

PKCS#12 format contains the certificate, private key, and all the CA’s in a certificate chain. Here is how you generate it from the openssl command line:

1) Generate private key
openssl genrsa -out 1024

2) Generate CSR
openssl req -new -key -out

3) Get the certificate signed by CSA

4) Save the resulting signed certificate into a file.

4) Concatenate the private key and certificate into a new file.
cat >

5) Export the concatenated file in PFX format.
openssl pkcs12 -export -in -out