Get the certificate info from a certificate

openssl x509 -noout -text -in server.crt

Check the key matches the certificate

Compare the md5 sums from the output of the following to ensure it matches

openssl x509 -noout -modulus -in <file>.crt | openssl md5

openssl rsa -noout -modulus -in <file>.key | openssl md5