I have a SSL certificate that the former sysadmin was issued (crt file.) Searching the filesystem I found several .key files. How do I match the crt to the key file and confirm that they match? This is Ubuntu Server 11.10 with Apache2 modssl.
Compare the modulus of the files.
Check the public key like this:
And check the private keys like this:
Compare the "modulus" data (a big block of numbers) between the certificate and the potentially matching keys. If they match, then the key and certificate are a pair.