Annotation of embedaddon/php/ext/openssl/tests/openssl_x509_parse_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: openssl_x509_parse() basic test
3: --SKIPIF--
4: <?php if (!extension_loaded("openssl")) print "skip"; ?>
5: --FILE--
6: <?php
7: $cert = "file://" . dirname(__FILE__) . "/cert.crt";
8:
9: var_dump(openssl_x509_parse($cert));
10: var_dump(openssl_x509_parse($cert, false));
11: ?>
12: --EXPECT--
13: array(12) {
14: ["name"]=>
15: string(96) "/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net"
16: ["subject"]=>
17: array(5) {
18: ["C"]=>
19: string(2) "BR"
20: ["ST"]=>
21: string(17) "Rio Grande do Sul"
22: ["L"]=>
23: string(12) "Porto Alegre"
24: ["CN"]=>
25: string(21) "Henrique do N. Angelo"
26: ["emailAddress"]=>
27: string(16) "hnangelo@php.net"
28: }
29: ["hash"]=>
30: string(8) "088c65c2"
31: ["issuer"]=>
32: array(5) {
33: ["C"]=>
34: string(2) "BR"
35: ["ST"]=>
36: string(17) "Rio Grande do Sul"
37: ["L"]=>
38: string(12) "Porto Alegre"
39: ["CN"]=>
40: string(21) "Henrique do N. Angelo"
41: ["emailAddress"]=>
42: string(16) "hnangelo@php.net"
43: }
44: ["version"]=>
45: int(2)
46: ["serialNumber"]=>
47: string(20) "12593567369101004962"
48: ["validFrom"]=>
49: string(13) "080630102843Z"
50: ["validTo"]=>
51: string(13) "080730102843Z"
52: ["validFrom_time_t"]=>
53: int(1214821723)
54: ["validTo_time_t"]=>
55: int(1217413723)
56: ["purposes"]=>
57: array(8) {
58: [1]=>
59: array(3) {
60: [0]=>
61: bool(true)
62: [1]=>
63: bool(true)
64: [2]=>
65: string(9) "sslclient"
66: }
67: [2]=>
68: array(3) {
69: [0]=>
70: bool(true)
71: [1]=>
72: bool(true)
73: [2]=>
74: string(9) "sslserver"
75: }
76: [3]=>
77: array(3) {
78: [0]=>
79: bool(true)
80: [1]=>
81: bool(true)
82: [2]=>
83: string(11) "nssslserver"
84: }
85: [4]=>
86: array(3) {
87: [0]=>
88: bool(true)
89: [1]=>
90: bool(true)
91: [2]=>
92: string(9) "smimesign"
93: }
94: [5]=>
95: array(3) {
96: [0]=>
97: bool(true)
98: [1]=>
99: bool(true)
100: [2]=>
101: string(12) "smimeencrypt"
102: }
103: [6]=>
104: array(3) {
105: [0]=>
106: bool(true)
107: [1]=>
108: bool(true)
109: [2]=>
110: string(7) "crlsign"
111: }
112: [7]=>
113: array(3) {
114: [0]=>
115: bool(true)
116: [1]=>
117: bool(true)
118: [2]=>
119: string(3) "any"
120: }
121: [8]=>
122: array(3) {
123: [0]=>
124: bool(true)
125: [1]=>
126: bool(true)
127: [2]=>
128: string(10) "ocsphelper"
129: }
130: }
131: ["extensions"]=>
132: array(3) {
133: ["subjectKeyIdentifier"]=>
134: string(59) "DB:7E:40:72:BD:5C:35:85:EC:29:29:81:12:E8:62:68:6A:B7:3F:7D"
135: ["authorityKeyIdentifier"]=>
136: string(202) "keyid:DB:7E:40:72:BD:5C:35:85:EC:29:29:81:12:E8:62:68:6A:B7:3F:7D
137: DirName:/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net
138: serial:AE:C5:56:CC:72:37:50:A2
139: "
140: ["basicConstraints"]=>
141: string(7) "CA:TRUE"
142: }
143: }
144: array(12) {
145: ["name"]=>
146: string(96) "/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net"
147: ["subject"]=>
148: array(5) {
149: ["countryName"]=>
150: string(2) "BR"
151: ["stateOrProvinceName"]=>
152: string(17) "Rio Grande do Sul"
153: ["localityName"]=>
154: string(12) "Porto Alegre"
155: ["commonName"]=>
156: string(21) "Henrique do N. Angelo"
157: ["emailAddress"]=>
158: string(16) "hnangelo@php.net"
159: }
160: ["hash"]=>
161: string(8) "088c65c2"
162: ["issuer"]=>
163: array(5) {
164: ["countryName"]=>
165: string(2) "BR"
166: ["stateOrProvinceName"]=>
167: string(17) "Rio Grande do Sul"
168: ["localityName"]=>
169: string(12) "Porto Alegre"
170: ["commonName"]=>
171: string(21) "Henrique do N. Angelo"
172: ["emailAddress"]=>
173: string(16) "hnangelo@php.net"
174: }
175: ["version"]=>
176: int(2)
177: ["serialNumber"]=>
178: string(20) "12593567369101004962"
179: ["validFrom"]=>
180: string(13) "080630102843Z"
181: ["validTo"]=>
182: string(13) "080730102843Z"
183: ["validFrom_time_t"]=>
184: int(1214821723)
185: ["validTo_time_t"]=>
186: int(1217413723)
187: ["purposes"]=>
188: array(8) {
189: [1]=>
190: array(3) {
191: [0]=>
192: bool(true)
193: [1]=>
194: bool(true)
195: [2]=>
196: string(10) "SSL client"
197: }
198: [2]=>
199: array(3) {
200: [0]=>
201: bool(true)
202: [1]=>
203: bool(true)
204: [2]=>
205: string(10) "SSL server"
206: }
207: [3]=>
208: array(3) {
209: [0]=>
210: bool(true)
211: [1]=>
212: bool(true)
213: [2]=>
214: string(19) "Netscape SSL server"
215: }
216: [4]=>
217: array(3) {
218: [0]=>
219: bool(true)
220: [1]=>
221: bool(true)
222: [2]=>
223: string(14) "S/MIME signing"
224: }
225: [5]=>
226: array(3) {
227: [0]=>
228: bool(true)
229: [1]=>
230: bool(true)
231: [2]=>
232: string(17) "S/MIME encryption"
233: }
234: [6]=>
235: array(3) {
236: [0]=>
237: bool(true)
238: [1]=>
239: bool(true)
240: [2]=>
241: string(11) "CRL signing"
242: }
243: [7]=>
244: array(3) {
245: [0]=>
246: bool(true)
247: [1]=>
248: bool(true)
249: [2]=>
250: string(11) "Any Purpose"
251: }
252: [8]=>
253: array(3) {
254: [0]=>
255: bool(true)
256: [1]=>
257: bool(true)
258: [2]=>
259: string(11) "OCSP helper"
260: }
261: }
262: ["extensions"]=>
263: array(3) {
264: ["subjectKeyIdentifier"]=>
265: string(59) "DB:7E:40:72:BD:5C:35:85:EC:29:29:81:12:E8:62:68:6A:B7:3F:7D"
266: ["authorityKeyIdentifier"]=>
267: string(202) "keyid:DB:7E:40:72:BD:5C:35:85:EC:29:29:81:12:E8:62:68:6A:B7:3F:7D
268: DirName:/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net
269: serial:AE:C5:56:CC:72:37:50:A2
270: "
271: ["basicConstraints"]=>
272: string(7) "CA:TRUE"
273: }
274: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>