OpenSSL – useful commands

OpenSSL – useful commands

Posted by on 25. J 2015 in Blog

So – my webhost Unoeuro has finally made it possible for me to add ssl-certificates to my websites. Even for subdomains – that is awesome! Althought they do claim a fee, which is why is not ssl-protected. It’s still money, you know 😉

My webhost demands .crt and unencrypted .key-files. Windows usually export to .pfx so I need to split that in 2 files. OpenSSL to the rescue.

Public key extraction
openssl pkcs12 -in mypfxfile.pfx -clcerts -nokeys -out public-cert.crt

Private key extraction
openssl pkcs12 -in mypfxfile.pfx -nocerts -out private-encrypted.key

Private key decryption
openssl rsa -in private-encrypted.key -out private-decrypted.key

And done – I’m ready to import to my webhost Unoeuro