FreeKB - OpenSSL Create a PFX public / private key pair
OpenSSL - Create a PFX public / private key pair

A PFX (personal exchange format) file contains both private keys and public certificates. If you do not yet have OpenSSL installed on your Linux system, use apt-get or yum to install OpenSSL.

yum install openssl

 

Before creating the PFX file, you will first need to create the public certificate and private key. These articles describe how to create the public certificate and private key.

 

Let's say you've created the following files:

  • foo.crt (public certificate)
  • foo.key (private key)

 

The following command will create foo.pfx using the foo.crt public certificate and the foo.key private key.

openssl pkcs12 -export -out foo.pfx -inkey foo.key -in foo.crt

 

The -name option can be used to include a friendly name.

openssl pkcs12 -export -in foo.crt -inkey foo.key -out foo.pfx -name foo

 

The OpenSSL command with the -info and -in options can be used to display the contents of the PFX file.

Or the Java keytool command (if you have Java installed on your system).

keytool -list -v -keystore foo.pfx -storetype PKCS12 -storepass your_password

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 0c0ba in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |