2007-01-21 06:08:29 +08:00
|
|
|
--TEST--
|
2007-04-05 05:24:01 +08:00
|
|
|
openssl_csr_get_subject() tests
|
2007-01-21 06:08:29 +08:00
|
|
|
--SKIPIF--
|
2007-04-05 15:23:56 +08:00
|
|
|
<?php
|
|
|
|
if (!extension_loaded("openssl")) die("skip");
|
|
|
|
if (!function_exists("utf8_decode")) die("skip");
|
|
|
|
?>
|
2007-01-21 06:08:29 +08:00
|
|
|
--FILE--
|
2007-04-05 05:24:01 +08:00
|
|
|
<?php
|
2007-01-21 06:08:29 +08:00
|
|
|
|
2016-02-04 00:20:27 +08:00
|
|
|
$csr = file_get_contents(dirname(__FILE__) . '/cert.csr');
|
2007-04-05 05:24:01 +08:00
|
|
|
if ($out = openssl_csr_get_subject($csr, 1)) {
|
|
|
|
var_dump($out);
|
2007-01-21 06:08:29 +08:00
|
|
|
}
|
2007-04-05 05:24:01 +08:00
|
|
|
echo "\n";
|
|
|
|
$cn = utf8_decode($out['CN']);
|
|
|
|
var_dump($cn);
|
|
|
|
--EXPECTF--
|
|
|
|
array(6) {
|
|
|
|
["C"]=>
|
|
|
|
string(2) "NL"
|
|
|
|
["ST"]=>
|
|
|
|
string(13) "Noord Brabant"
|
|
|
|
["L"]=>
|
|
|
|
string(4) "Uden"
|
|
|
|
["O"]=>
|
|
|
|
string(10) "Triconnect"
|
|
|
|
["OU"]=>
|
|
|
|
string(10) "Triconnect"
|
|
|
|
["CN"]=>
|
|
|
|
string(15) "*.triconnect.nl"
|
2007-01-21 06:08:29 +08:00
|
|
|
}
|
|
|
|
|
2007-04-05 05:24:01 +08:00
|
|
|
string(15) "*.triconnect.nl"
|