openssl certificate convert commands https
OpenSSL is a command-line tool that can be used to convert SSL/TLS certificates from one format to another. Here are some OpenSSL commands for converting SSL/TLS certificates:
- Convert PEM to DER format:
openssl x509 -outform der -in certificate.pem -out certificate.der
This command converts a PEM-format SSL/TLS certificate to DER format.
- Convert PEM to PKCS#12 format:
openssl pkcs12 -export -out certificate.pfx -inkey private.key -in certificate.pem -certfile ca-bundle.crt
This command converts a PEM-format SSL/TLS certificate to PKCS#12 format, which includes the private key and any intermediate CA certificates.
- Convert DER to PEM format:
openssl x509 -inform der -in certificate.der -out certificate.pem
This command converts a DER-format SSL/TLS certificate to PEM format.
- Convert PKCS#12 to PEM format:
openssl pkcs12 -in certificate.pfx -out certificate.pem -nodes
This command extracts the SSL/TLS certificate and private key from a PKCS#12-format file and converts them to PEM format.
- Convert PKCS#7 to PEM format:
openssl pkcs7 -print_certs -in certificate.p7b -out certificate.pem
This command converts a PKCS#7-format SSL/TLS certificate to PEM format.
These are just a few examples of OpenSSL commands for converting SSL/TLS certificates. The exact commands may vary depending on the specific certificate format and conversion requirements.