php读取.cer文件

$certificateCAcerContent = file_get_contents($filePath);
$certificateCApemContent = '-----BEGIN CERTIFICATE-----' . PHP_EOL
. chunk_split(base64_encode($certificateCAcerContent), 64, PHP_EOL)
. '-----END CERTIFICATE-----' . PHP_EOL;

php读取.fpx文件

$pkcs12 = file_get_contents($filePath);
$res = openssl_pkcs12_read($pkcs12, $certs, '密码');