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 shahalpk.name.key
.
- Execute the below command for the SSL certificate
openssl x509 -modulus -noout -in shahalpk.name.crt | openssl md5
Output
(stdin)= 9115096b827915e181b6b29bf5a049f1
- Execute the below command for the private key
openssl rsa -modulus -noout -in shahalpk.name.key | openssl md5
Output
(stdin)= 9115096b827915e181b6b29bf5a049f1
-
If output of both the commands are same, then your private key is matching with your SSL certificate.