Is there an easy way to verify that a given private key matches a given public key? I have a few *.puband a few *.key files, and I need to check w
*.pub
*.key
Assuming you have the public keys inside X.509 certificates, and assuming they are RSA keys, then for each public key, do
openssl x509 -in certfile -modulus -noout
For each private key, do
openssl rsa -in keyfile -modulus -noout
Then match the keys by modulus.