Or to put it another way...
Does this certificate I have actually work with this private key I have?
Where server.crt
is your certificate and server.key
is your private key:
$ certMod=$(openssl x509 -text -noout -modulus -in server.crt | grep "Modulus=") && \
keyMod=$(openssl rsa -text -noout -modulus -in server.key | grep "Modulus=") && \
[[ $certMod == $keyMod ]] && echo "Equal"
If certificate works with private key - you should be greeted with a response of Equal
.