Common OpenSSL Commands with Keys and Certificates
openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar
openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar
openssl genrsa -out private.pem 2048
openssl req -sha256 -new -key private.pem -out csr.pem
openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr
openssl rsa -in server.key -outform PEM -out server.pem
openssl x509 -req -sha256 -days 365 -in csr.pem -signkey private.pem -out certificate.pem
openssl rsa -in private.pem -text -noout
openssl req -in csr.pem -text -noout
openssl x509 -in certificate.pem -text -noout
openssl x509 -inform der -in certificate.cer -text -noout
openssl x509 -inform der -in certificate.cer -out certificate.pem
openssl x509 -outform der -in certificate.pem -out certificate.cer