Skip to content

Instantly share code, notes, and snippets.

@gmassawe
Created November 11, 2021 18:47
Show Gist options
  • Save gmassawe/e18514878a5d660009a82474dafa9c49 to your computer and use it in GitHub Desktop.
Save gmassawe/e18514878a5d660009a82474dafa9c49 to your computer and use it in GitHub Desktop.
OpenSSL Cheat Sheet
OpenSSL List Ciphers
  openssl ciphers -v | awk '{print $2}' | sort | uniq
Convert DER Format To PEM For RSA Key
  openssl rsa -inform DER -outform PEM -in certificate.der -out certificate.pem

Remove Password RSA

    openssl rsa -in certificate.pem -out certificate.key
Conver PEM Format To DER Format
  openssl rsa -inform PEM -outform DER -text -in certificate.pem -out certificate.der
Convert DER Format To PEM Format For x509
  openssl x509 -inform DER -outform PEM -text -in certificate.der -out certificate.pem

Convert PEM Format To DER Format For x509

  openssl x509 -inform PEM -outform DER -text -in certificate.der -out certificate.pem

Remove Password x509

    openssl x509 -outform der -in certificate.pem -out certificate.crt

Convert PEM Format To P7B Format For pkcs7

    openssl crl2pkcs7 -nocrl -certfile certificate.cer -out certificate.p7b -certfile CACert.cer

Convert P7B Format To PEM Format For pkcs7

    openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer

Convert P7B Format To PFX Format pkcs7

    openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer
    openssl pkcs12 -export -in certificate.cer -inkey privateKey.key -out certificate.pfx -certfile CACert.cer

Convert PFX Format To PEM Format pkcs12

    openssl pkcs12 -in certificate.pfx -out certificate.cer -nodes

Convert PEM Format To PFX Format For pkcs12

    openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment