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
You can then use OpenSSL to verify that the PFX file contains both the certificate and private key.
openssl pkcs12 -info -in foo.pfx
Or the Java keytool command (if you have Java installed on your system).
keytool -list -v -keystore foo.pfx -storetype PKCS12 -storepass your_password