OpenSSL command can be used to verify if an SSL certificate matches a private key file. You need to find the checksum for the SSL certificate and Private key, if both checksums are the same, then the key matches.
To make this process easier, I created a PHP script to verify if the SSL certificate matches the private key provided.
Create a file
mkdir ~/bin/ vi ~/bin/ssl-verify
Add following content
#!/usr/bin/php Make it executable chmod 755 ~/bin/ssl-verify To verify an SSL and key file, go to the folder where the SSL certificate and key file are present, then run the command ssl-verify