函数名称:openssl_x509_check_private_key() 函数描述:该函数用于检查给定的私钥是否与给定的证书匹配。 适用版本:该函数适用于PHP版本5.2.0及以上版本。 用法: b...
函数名称:openssl_x509_check_private_key()
函数描述:该函数用于检查给定的私钥是否与给定的证书匹配。
适用版本:该函数适用于PHP版本5.2.0及以上版本。
用法:
bool openssl_x509_check_private_key ( mixed $cert , mixed $key )
参数:
返回值:
示例:
$cert = file_get_contents('path/to/certificate.crt');
$key = file_get_contents('path/to/private.key');
if (openssl_x509_check_private_key($cert, $key)) {
echo "私钥与证书匹配";
} else {
echo "私钥与证书不匹配";
}
注意事项: