If you google how to validate a cert and private key match most examples are RSA specific and use modulus output.
Those examples look something like: openssl x509 -in cert.pem -noout -modulus | openssl sha1
Instead use the proper OpenSSL public key support:
- Check public key of certificate:
openssl x509 -noout -pubkey -in cert.pem
- Check public key based on private key:
openssl pkey -pubout -in key.pem