Quick reference for SSL certificate workflow handling for commonly used commercial SSL products
- Generate a new private key
openssl req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privateKey.key
- Generate a self-signed certificate
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout privateKey.key -out certificate.crt
- Generate a CSR for an existing private key
openssl req -out CSR.csr -key privateKey.key -new
- Generate a CSR based on an existing certificate
openssl x509 -x509toreq -in certificate.crt -out CSR.csr -signkey privateKey.key
- Generate new private key/CSR pair
openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=IT/ST=RM/L=Rome/O=COMPANY/OU=IT Division/CN=my.domain.it"
- Remove a passphrase from a private key
openssl rsa -in privateKey.pem -out newPrivateKey.pem
- Check a CSR
openssl req -text -noout -verify -in CSR.csr
- Check a private key
openssl rsa -in privateKey.key -check
- Check a certificate
openssl x509 -in certificate.crt -text -noout
- Check a PKCS#12 file (.pfx or .p12)
openssl pkcs12 -info -in keyStore.p12