This is an extremely simple bash script that ingests a certificate, private key, CA bundle, and password, and spits out a PFX bundle:
The intent of creating this is to reduce the number of times one has to google "openssl convert pem to pfx" and dick around with openssl
until you get exactly what you need. Any by 'you', I mean me.
curl -s https://raw.githubusercontent.com/checktheroads/pem-to-pfx/master/install.sh | bash
...and then probably log out & back in, or run source ~/.bashrc
or source ~/.zshrc
as the case may be.
Convert PEM bundle to PFX/PCKS12
-h Show this help menu.
-c Cert file name.
-k Key file name.
-a CA bundle file name.
-o Destination PFX file name.
-p Import/Export password.
-f Import/Export password file name. [OPTIONAL - default is current working directory]
-d Show debug output ⚠️ THIS WILL SHOW PASSWORDS ⚠️
pem-to-pfx \
-c <path to cert file> \
-k <path to key file> \
-a <path to CA bundle file> \
-o <path to new PFX file> \
-p <private key password>