To valid a SSL certificate with the private key, follow the 3 steps below. I have the SSL certificate
shahalpk.name.crt and the private key
- Execute the below command for the SSL certificate
openssl x509 -modulus -noout -in shahalpk.name.crt | openssl md5
- Execute the below command for the private key
openssl rsa -check -noout -in shahalpk.name.key | openssl md5
If output of both the commands are same, then your private key is matching with your SSL certificate.