Check that a certificate matches a private key or certificate request

From MyWiki
Jump to: navigation, search

You can check if an SSL certificate matches a Private Key by using the 3 easy commands below.

For your SSL certificate: openssl x509 –noout –modulus –in <file>.crt | openssl md5
For your RSA private key: openssl rsa –noout –modulus –in <file>.key | openssl md5
For your CSR: openssl req -noout -modulus -in <file>.csr | openssl md5

You just need to replace <file> with your file’s name. If all the three match, the SSL certificate matches the Private Key.