PHP Form for SSL PFX Conversion

PHP Form for SSL PFX Conversion

Here is some generic info about what a PFX file is.

The PKCS#12 or PFX format is a binary format for storing the server certificate, any intermediate certificates, and the private key in one encryptable file. PFX files usually have extensions such as .pfx and .p12. PFX files are typically used on Windows machines to import and export certificates and private keys.

In order to convert a your certificate and key to a PKCS#12 file (.pfx .p12), you can use the cool OpenSSL command. The command would look something like:

openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt

To speedup the procedure, I've implemented this into a nice little PHP web form that would help you do that.

Note! For security reasons
I strongly recommend using this on a private server, that only you have access to!

All you would need to do is to get the code from this repo here: GirHub Repo

You can just copy and paste the content of the convert.php file on your server and start using the converter.

The form should look something like:

SSL PFX Convertor

I would also suggest adding a cron job that would delete any files older than 60 seconds as some users might forget to hit the delete button. Here's an example that you could use:

/usr/bin/find /path/to/the/tmp-folder/tmp -mindepth 1 -mmin +1 -exec rm -rf {} \;

That is pretty much it, if you get any errors please feel free to report them to me :)



The Real-Time Data Platform for Developers

Buy me a coffeeBuy me a coffee