summaryrefslogtreecommitdiff
path: root/ext/openssl/tests/openssl_x509_parse_basic.phpt
diff options
context:
space:
mode:
authorHenrique do Nascimento Angelo <hnangelo@php.net>2008-07-18 23:52:01 +0000
committerHenrique do Nascimento Angelo <hnangelo@php.net>2008-07-18 23:52:01 +0000
commit158239004e3ab8aecf05b9a96868c571566572e4 (patch)
tree64048b1c6cb333bd83f843e304e48873fe12d039 /ext/openssl/tests/openssl_x509_parse_basic.phpt
parentff9ad113e9b907e01f2a427f9482962c4ee7e3a0 (diff)
downloadphp-git-158239004e3ab8aecf05b9a96868c571566572e4.tar.gz
New tests
Diffstat (limited to 'ext/openssl/tests/openssl_x509_parse_basic.phpt')
-rw-r--r--ext/openssl/tests/openssl_x509_parse_basic.phpt274
1 files changed, 274 insertions, 0 deletions
diff --git a/ext/openssl/tests/openssl_x509_parse_basic.phpt b/ext/openssl/tests/openssl_x509_parse_basic.phpt
new file mode 100644
index 0000000000..5484bfe58d
--- /dev/null
+++ b/ext/openssl/tests/openssl_x509_parse_basic.phpt
@@ -0,0 +1,274 @@
+--TEST--
+openssl_x509_parse() basic test
+--SKIPIF--
+<?php if (!extension_loaded("openssl")) print "skip"; ?>
+--FILE--
+<?php
+$cert = "file://" . dirname(__FILE__) . "/cert.crt";
+
+var_dump(openssl_x509_parse($cert));
+var_dump(openssl_x509_parse($cert, false));
+?>
+--EXPECT--
+array(12) {
+ ["name"]=>
+ string(96) "/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net"
+ ["subject"]=>
+ array(5) {
+ ["C"]=>
+ string(2) "BR"
+ ["ST"]=>
+ string(17) "Rio Grande do Sul"
+ ["L"]=>
+ string(12) "Porto Alegre"
+ ["CN"]=>
+ string(21) "Henrique do N. Angelo"
+ ["emailAddress"]=>
+ string(16) "hnangelo@php.net"
+ }
+ ["hash"]=>
+ string(8) "088c65c2"
+ ["issuer"]=>
+ array(5) {
+ ["C"]=>
+ string(2) "BR"
+ ["ST"]=>
+ string(17) "Rio Grande do Sul"
+ ["L"]=>
+ string(12) "Porto Alegre"
+ ["CN"]=>
+ string(21) "Henrique do N. Angelo"
+ ["emailAddress"]=>
+ string(16) "hnangelo@php.net"
+ }
+ ["version"]=>
+ int(2)
+ ["serialNumber"]=>
+ string(20) "12593567369101004962"
+ ["validFrom"]=>
+ string(13) "080630102843Z"
+ ["validTo"]=>
+ string(13) "080730102843Z"
+ ["validFrom_time_t"]=>
+ int(1214821723)
+ ["validTo_time_t"]=>
+ int(1217413723)
+ ["purposes"]=>
+ array(8) {
+ [1]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(9) "sslclient"
+ }
+ [2]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(9) "sslserver"
+ }
+ [3]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(11) "nssslserver"
+ }
+ [4]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(9) "smimesign"
+ }
+ [5]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(12) "smimeencrypt"
+ }
+ [6]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(7) "crlsign"
+ }
+ [7]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(3) "any"
+ }
+ [8]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(10) "ocsphelper"
+ }
+ }
+ ["extensions"]=>
+ array(3) {
+ ["subjectKeyIdentifier"]=>
+ string(59) "DB:7E:40:72:BD:5C:35:85:EC:29:29:81:12:E8:62:68:6A:B7:3F:7D"
+ ["authorityKeyIdentifier"]=>
+ string(202) "keyid:DB:7E:40:72:BD:5C:35:85:EC:29:29:81:12:E8:62:68:6A:B7:3F:7D
+DirName:/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net
+serial:AE:C5:56:CC:72:37:50:A2
+"
+ ["basicConstraints"]=>
+ string(7) "CA:TRUE"
+ }
+}
+array(12) {
+ ["name"]=>
+ string(96) "/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net"
+ ["subject"]=>
+ array(5) {
+ ["countryName"]=>
+ string(2) "BR"
+ ["stateOrProvinceName"]=>
+ string(17) "Rio Grande do Sul"
+ ["localityName"]=>
+ string(12) "Porto Alegre"
+ ["commonName"]=>
+ string(21) "Henrique do N. Angelo"
+ ["emailAddress"]=>
+ string(16) "hnangelo@php.net"
+ }
+ ["hash"]=>
+ string(8) "088c65c2"
+ ["issuer"]=>
+ array(5) {
+ ["countryName"]=>
+ string(2) "BR"
+ ["stateOrProvinceName"]=>
+ string(17) "Rio Grande do Sul"
+ ["localityName"]=>
+ string(12) "Porto Alegre"
+ ["commonName"]=>
+ string(21) "Henrique do N. Angelo"
+ ["emailAddress"]=>
+ string(16) "hnangelo@php.net"
+ }
+ ["version"]=>
+ int(2)
+ ["serialNumber"]=>
+ string(20) "12593567369101004962"
+ ["validFrom"]=>
+ string(13) "080630102843Z"
+ ["validTo"]=>
+ string(13) "080730102843Z"
+ ["validFrom_time_t"]=>
+ int(1214821723)
+ ["validTo_time_t"]=>
+ int(1217413723)
+ ["purposes"]=>
+ array(8) {
+ [1]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(10) "SSL client"
+ }
+ [2]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(10) "SSL server"
+ }
+ [3]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(19) "Netscape SSL server"
+ }
+ [4]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(14) "S/MIME signing"
+ }
+ [5]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(17) "S/MIME encryption"
+ }
+ [6]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(11) "CRL signing"
+ }
+ [7]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(11) "Any Purpose"
+ }
+ [8]=>
+ array(3) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+ [2]=>
+ string(11) "OCSP helper"
+ }
+ }
+ ["extensions"]=>
+ array(3) {
+ ["subjectKeyIdentifier"]=>
+ string(59) "DB:7E:40:72:BD:5C:35:85:EC:29:29:81:12:E8:62:68:6A:B7:3F:7D"
+ ["authorityKeyIdentifier"]=>
+ string(202) "keyid:DB:7E:40:72:BD:5C:35:85:EC:29:29:81:12:E8:62:68:6A:B7:3F:7D
+DirName:/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net
+serial:AE:C5:56:CC:72:37:50:A2
+"
+ ["basicConstraints"]=>
+ string(7) "CA:TRUE"
+ }
+}