2007-01-19 19:23:20 +00:00
|
|
|
--TEST--
|
2007-04-04 21:39:01 +00:00
|
|
|
openssl_csr_get_subject() tests
|
2007-01-19 19:23:20 +00:00
|
|
|
--SKIPIF--
|
2007-04-04 21:39:01 +00:00
|
|
|
<?php if (!extension_loaded("openssl")) print "skip"; ?>
|
2007-01-19 19:23:20 +00:00
|
|
|
--FILE--
|
2007-04-04 21:39:01 +00:00
|
|
|
<?php
|
2007-01-19 19:23:20 +00:00
|
|
|
|
2007-04-04 21:39:01 +00:00
|
|
|
$csr = file_get_contents(dirname(__FILE__) . '/005_crt.txt');
|
|
|
|
if ($out = openssl_csr_get_subject($csr, 1)) {
|
|
|
|
var_dump($out);
|
2007-01-19 19:23:20 +00:00
|
|
|
}
|
2007-04-04 21:39:01 +00: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-19 19:23:20 +00:00
|
|
|
}
|
|
|
|
|
2007-04-04 21:39:01 +00:00
|
|
|
string(15) "*.triconnect.nl"
|