Unable to get P12 file content

  Kiến thức lập trình

I need to read the content of a P12 file, but when I use file_get_contents($p12_file);, the content shows like this, and I don’t get what’s wrong:
enter image description here

$p12_file is the p12 temp file when uploading it, but I am not sure if this is correct.

this is the code I have:

$file = file_get_contents($p12_file);

$p12 = [];

if (openssl_pkcs12_read($file, $p12, $pin)) {
    echo "certificate info";
    print_r($p12);
} else {
    echo "unable to read certificate info.n";
    exit;
}

Thanks in advance

LEAVE A COMMENT