CakeFest 2025 Madrid: The Official CakePHP Conference

Voting

: seven minus five?
(Example: nine)

The Note You're Voting On

zioproto at gmail dot com
17 years ago
To read an extension from a X.509 certificate, you can proceed like this if you know the OID

//Read the certificate from file
$cert = file_get_contents('test.crt');
$ssl = openssl_x509_parse($cert);

$ext_value = $ssl['extensions']['1.2.3.4.5.6'];
echo $ext_value

--------------------------------

Because the $ssl array is not documented, you can easily see its contents like this:

//To print out all the array!
print_r(array_values($ssl));
print_r(array_keys($ssl));

<< Back to user notes page

To Top