Tracy Phillips

Archive for the ‘openssl’ tag

How to check that private key and certificate match

leave a comment

You can check to make sure that you your ssl’s private key and ssl certificate are in the correct format and match each other. To do this, give the commands below to decrypt the private key in one terminal window and decrypt the certificate in the other.

What you will be comparing are the Modulus and the Exponent of each key. If the modulus and exponent from the key matches the set from the certificate, you have just confirmed that your certificate and key are correctly paired.

To view the contents of the certificate:

[server][user][~]$ openssl x509 -noout -text -in filename.crt

To view the contents of the private key:

[server][user][~]$ openssl rsa -noout -text -in filename.key

Written by Tracy

January 4th, 2006 at 12:23 pm

Posted in FreeBSD, Linux

Tagged with ,