openssl_x509_check_private_key

Supported Versions: PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8
Checks if a private key corresponds to a certificate
<?php openssl_x509_check_private_key(OpenSSLCertificate|string $certificate, OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key): bool