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:
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