Useful openssl Command Examples

Check version of openssl:
# openssl version
Print available commands for openssl:
# openssl list -standard-commands

	or				

# openssl help
Check SSL certificate of mentioned URL:
# openssl s_client -connect varelite.com:443 -showcerts	
To generate rsa key:
# openssl genrsa -out testing.key 2048
Generate CSR and RSA key:
# openssl req -out testing.csr -newkey rsa:2048 -nodes -keyout testing.key
Generate a self signed certificate:
# openssl req -x509 -sha256 -nodes -newkey rsa:2048 -keyout testing1.key -out testing1.pem
Check CSR file:
# openssl req -noout -text -in testing.csr
Check RSA key: (It will prompted for pass phrase if exists)
# openssl rsa -in testing.key -check
Verify Certificate:
# openssl x509 -in testing1.pem -text -noout
Check hash value of a certificate:
# openssl x509 -noout -hash -in testing1.pem
Print CSA (Certificate Signer Authority) of certificate:
# openssl x509 -in testing1.pem -text -noout -issuer -issuer_hash
Print public key:
# openssl rsa -in testing.key -pubout
Print Modulus and public key:
# openssl rsa -in testing.key -pubout -modulus
Print RSA key in textual format:
# openssl rsa -in testing.key -text -noout
Print session information when the program exits:
# openssl s_client -connect varelite.com:443 -prexit

Leave a Reply

Your email address will not be published. Required fields are marked *