Archive for the ‘ssl’ Category

Retrieving information from an SSL Certificate ( Using openssl command line)

January 25, 2008

Assume that cert.pem is the cert you have as a text file.

>> who issued the cert?
openssl x509 -noout -in cert.pem -issuer

>> to whom was it issued?
openssl x509 -noout -in cert.pem -subject
>> for what dates is it valid?
openssl x509 -noout -in cert.pem -dates

>> the above, all at once
openssl x509 -noout -in cert.pem -issuer -subject -dates

>> what is its hash value?
openssl x509 -noout -in cert.pem -hash

>> what is its MD5 fingerprint?
openssl x509 -noout -in cert.pem -fingerprint

Checking if the SSL certificate and RSA private key matches from command line

January 22, 2008

Here are two commands which you need to run from the console to check .key and .crt files

#openssl rsa -noout -text -in http://www.domainname.com.key
#openssl x509 -noout -text -in http://www.domainname.com.crt

Check for modulus part in the output of both commands

If the modulus output match, then your .crt and .key files are matching.