Check whether public and private key match

Customers regularly send me x509 key pairs at work 1 . Most of the time these have been forwarded a few times already, and people tend to mess up the files. This means that the public and private keys don't match anymore, and I have to ask for a new pair. Luckily, we can use OpenSSL to check whether a public and private key match. For RSA keys The classic way to compare RSA keys is to check…