xref: /PHP-5.4/ext/openssl/tests/005.phpt (revision e0318e21)
1--TEST--
2openssl_csr_get_subject() tests
3--SKIPIF--
4<?php
5if (!extension_loaded("openssl")) die("skip");
6if (!function_exists("utf8_decode")) die("skip");
7?>
8--FILE--
9<?php
10
11$csr = file_get_contents(dirname(__FILE__) . '/005_crt.txt');
12if ($out = openssl_csr_get_subject($csr, 1)) {
13	var_dump($out);
14}
15echo "\n";
16$cn = utf8_decode($out['CN']);
17var_dump($cn);
18--EXPECTF--
19array(6) {
20  ["C"]=>
21  string(2) "NL"
22  ["ST"]=>
23  string(13) "Noord Brabant"
24  ["L"]=>
25  string(4) "Uden"
26  ["O"]=>
27  string(10) "Triconnect"
28  ["OU"]=>
29  string(10) "Triconnect"
30  ["CN"]=>
31  string(15) "*.triconnect.nl"
32}
33
34string(15) "*.triconnect.nl"
35