If you would like to verify that the key and the certificate match you need to compare the modulus in both of the key file and the certificate file. You can check for differences in the modulus rather easily by sending the output of the comparison command to 'uniq'. If anything shows up, the numbers [...]