3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x509_res = openssl_x509_parse('-----BEGIN CERTIFICATE----- MIIGxDCCBaygAwIBAgINIZ2fBVduqYDQyj0hCjANBgkqhkiG9w0BAQsFADBqMQsw CQYDVQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2Vj IEx0ZC4xFDASBgNVBAsMC2UtU3ppZ25vIENBMRowGAYDVQQDDBFlLVN6aWdubyBU ZXN0IENBMzAeFw0xNTAyMDUxNTEyMTFaFw0xNzAyMDUxNTEyMTFaMIHSMQswCQYD VQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIHpy dC4xLjAsBgNVBAsMJWUtU3ppZ27DsyBIaXRlbGVzw610w6lzIFN6b2xnw6FsdGF0 w7MxIDAeBgNVBAMMF2lmai4gVGVzenRlbMWRIFDDqXRlcmtlMR8wHQYJKoZIhvcN AQkBFhBpbmZvQGUtc3ppZ25vLmh1MSUwIwYDVQQFExwxLjMuNi4xLjQuMS4yMTUy OC4yLjIuOTkuNzYxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1h7o UWGa6ZrEqjIS9+4z/bQMYwhU07ebHGztt3a093LIwN10kVqWK2s0Nnhua1YGTnZ+ W3SFtCPGZ3vY3AY7ypuBEogOnO1pOLoHWJIhQVTlb3HL3jOIsfdJQTErutmZZB1A ffnJJtifxnME2PM9hfP89OEAlyJW5NuOJQzWZ2s2FlKwZ1kdUCK3KSOfCOhrHdn7 t/E82mpRIH7LUXVWXPoopB+xkWoWUQWJctHR+3sHz/LGB//GNCu5ZUllYjIctmeD RnPiXHBIufw62wxSX6b84t6Jr5+4A8lCDc5nVmB9N6QesuER/uFxswS4BGfbUJOs nqAbDIAdsVktGKBILQIDAQABo4IC/jCCAvowDAYDVR0TAQH/BAIwADAOBgNVHQ8B Af8EBAMCBsAwEwYDVR0lBAwwCg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AVm5mqAPMz5jUL8nOUSahQIhbU00wK77ZkBB3pbGmfmlZ/S6pjGX/DQjfe06Am0e uAEMv/RdXC801Fd5E7LXtEmwr/mrpH6UPu1dvg98bhoonY0CnEN+eOvApJRwxMKF V8s54DVurI2xftEpW5o5hn6aD4+oZXtOF0Cy1oayoN52g/K5DvAHqzgoKDe6HMCI bvf24g4m1z1emBFqGwO8sL3uS20SljKY0M4L8FXOAJUkcOiBUzX68G4rhB2XA6Rx DhN+Hijbleg= -----END CERTIFICATE-----'); //$x509_res = openssl_x509_parse('12345'); var_dump($x509_res); if(!$x509_res) { echo 'x509 cert could not be read'."\n"; }
based on a9INn
Output for 7.0.20, 7.1.5 - 7.2.0
array(16) { ["name"]=> string(214) "/C=HU/L=Budapest/O=Microsec zrt./OU=e-Szign\xC3\xB3 Hiteles\xC3\xADt\xC3\xA9s Szolg\xC3\xA1ltat\xC3\xB3/CN=ifj. Tesztel\xC5\x91 P\xC3\xA9terke/emailAddress=info@e-szigno.hu/serialNumber=1.3.6.1.4.1.21528.2.2.99.761" ["subject"]=> array(7) { ["C"]=> string(2) "HU" ["L"]=> string(8) "Budapest" ["O"]=> string(13) "Microsec zrt." ["OU"]=> string(37) "e-Szignó Hitelesítés Szolgáltató" ["CN"]=> string(23) "ifj. Tesztelő Péterke" ["emailAddress"]=> string(16) "info@e-szigno.hu" ["serialNumber"]=> string(28) "1.3.6.1.4.1.21528.2.2.99.761" } ["hash"]=> string(8) "419270dc" ["issuer"]=> array(5) { ["C"]=> string(2) "HU" ["L"]=> string(8) "Budapest" ["O"]=> string(13) "Microsec Ltd." ["OU"]=> string(11) "e-Szigno CA" ["CN"]=> string(17) "e-Szigno Test CA3" } ["version"]=> int(2) ["serialNumber"]=> string(31) "2663310753942666237425947058442" ["serialNumberHex"]=> string(26) "219D9F05576EA980D0CA3D210A" ["validFrom"]=> string(13) "150205151211Z" ["validTo"]=> string(13) "170205151211Z" ["validFrom_time_t"]=> int(1423149131) ["validTo_time_t"]=> int(1486307531) ["signatureTypeSN"]=> string(10) "RSA-SHA256" ["signatureTypeLN"]=> string(23) "sha256WithRSAEncryption" ["signatureTypeNID"]=> int(668) ["purposes"]=> array(9) { [1]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(9) "sslclient" } [2]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(9) "sslserver" } [3]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(11) "nssslserver" } [4]=> array(3) { [0]=> bool(true) [1]=> bool(false) [2]=> string(9) "smimesign" } [5]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(12) "smimeencrypt" } [6]=> array(3) { [0]=> bool(false) [1]=> bool(false) [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(false) [2]=> string(10) "ocsphelper" } [9]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(13) "timestampsign" } } ["extensions"]=> array(9) { ["basicConstraints"]=> string(8) "CA:FALSE" ["keyUsage"]=> string(34) "Digital Signature, Non Repudiation" ["extendedKeyUsage"]=> string(17) "E-mail Protection" ["certificatePolicies"]=> string(106) "Policy: 1.3.6.1.4.1.21528.2.1.1.100 CPS: http://srv.e-szigno.hu/THR/ User Notice: Explicit Text: " ["subjectKeyIdentifier"]=> string(59) "C7:65:F4:7F:C3:42:59:FC:40:A3:B2:72:EB:13:B6:83:11:20:34:93" ["authorityKeyIdentifier"]=> string(66) "keyid:DC:E6:02:28:EF:37:30:8F:89:3E:A0:AD:20:55:F3:EF:36:E8:F0:CD " ["subjectAltName"]=> string(47) "email:info@e-szigno.hu, othername:<unsupported>" ["crlDistributionPoints"]=> string(52) " Full Name: URI:http://teszt.e-szigno.hu/TCA3.crl " ["authorityInfoAccess"]=> string(99) "OCSP - URI:http://teszt.e-szigno.hu/testca3ocsp CA Issuers - URI:http://teszt.e-szigno.hu/TCA3.crt " } }
Output for 5.5.24 - 7.0.6, 7.1.0
array(15) { ["name"]=> string(214) "/C=HU/L=Budapest/O=Microsec zrt./OU=e-Szign\xC3\xB3 Hiteles\xC3\xADt\xC3\xA9s Szolg\xC3\xA1ltat\xC3\xB3/CN=ifj. Tesztel\xC5\x91 P\xC3\xA9terke/emailAddress=info@e-szigno.hu/serialNumber=1.3.6.1.4.1.21528.2.2.99.761" ["subject"]=> array(7) { ["C"]=> string(2) "HU" ["L"]=> string(8) "Budapest" ["O"]=> string(13) "Microsec zrt." ["OU"]=> string(37) "e-Szignó Hitelesítés Szolgáltató" ["CN"]=> string(23) "ifj. Tesztelő Péterke" ["emailAddress"]=> string(16) "info@e-szigno.hu" ["serialNumber"]=> string(28) "1.3.6.1.4.1.21528.2.2.99.761" } ["hash"]=> string(8) "419270dc" ["issuer"]=> array(5) { ["C"]=> string(2) "HU" ["L"]=> string(8) "Budapest" ["O"]=> string(13) "Microsec Ltd." ["OU"]=> string(11) "e-Szigno CA" ["CN"]=> string(17) "e-Szigno Test CA3" } ["version"]=> int(2) ["serialNumber"]=> string(31) "2663310753942666237425947058442" ["validFrom"]=> string(13) "150205151211Z" ["validTo"]=> string(13) "170205151211Z" ["validFrom_time_t"]=> int(1423149131) ["validTo_time_t"]=> int(1486307531) ["signatureTypeSN"]=> string(10) "RSA-SHA256" ["signatureTypeLN"]=> string(23) "sha256WithRSAEncryption" ["signatureTypeNID"]=> int(668) ["purposes"]=> array(9) { [1]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(9) "sslclient" } [2]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(9) "sslserver" } [3]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(11) "nssslserver" } [4]=> array(3) { [0]=> bool(true) [1]=> bool(false) [2]=> string(9) "smimesign" } [5]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(12) "smimeencrypt" } [6]=> array(3) { [0]=> bool(false) [1]=> bool(false) [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(false) [2]=> string(10) "ocsphelper" } [9]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(13) "timestampsign" } } ["extensions"]=> array(9) { ["basicConstraints"]=> string(8) "CA:FALSE" ["keyUsage"]=> string(34) "Digital Signature, Non Repudiation" ["extendedKeyUsage"]=> string(17) "E-mail Protection" ["certificatePolicies"]=> string(106) "Policy: 1.3.6.1.4.1.21528.2.1.1.100 CPS: http://srv.e-szigno.hu/THR/ User Notice: Explicit Text: " ["subjectKeyIdentifier"]=> string(59) "C7:65:F4:7F:C3:42:59:FC:40:A3:B2:72:EB:13:B6:83:11:20:34:93" ["authorityKeyIdentifier"]=> string(66) "keyid:DC:E6:02:28:EF:37:30:8F:89:3E:A0:AD:20:55:F3:EF:36:E8:F0:CD " ["subjectAltName"]=> string(47) "email:info@e-szigno.hu, othername:<unsupported>" ["crlDistributionPoints"]=> string(52) " Full Name: URI:http://teszt.e-szigno.hu/TCA3.crl " ["authorityInfoAccess"]=> string(99) "OCSP - URI:http://teszt.e-szigno.hu/testca3ocsp CA Issuers - URI:http://teszt.e-szigno.hu/TCA3.crt " } }
Output for 5.4.15 - 5.4.45
array(12) { ["name"]=> string(214) "/C=HU/L=Budapest/O=Microsec zrt./OU=e-Szign\xC3\xB3 Hiteles\xC3\xADt\xC3\xA9s Szolg\xC3\xA1ltat\xC3\xB3/CN=ifj. Tesztel\xC5\x91 P\xC3\xA9terke/emailAddress=info@e-szigno.hu/serialNumber=1.3.6.1.4.1.21528.2.2.99.761" ["subject"]=> array(7) { ["C"]=> string(2) "HU" ["L"]=> string(8) "Budapest" ["O"]=> string(13) "Microsec zrt." ["OU"]=> string(37) "e-Szignó Hitelesítés Szolgáltató" ["CN"]=> string(23) "ifj. Tesztelő Péterke" ["emailAddress"]=> string(16) "info@e-szigno.hu" ["serialNumber"]=> string(28) "1.3.6.1.4.1.21528.2.2.99.761" } ["hash"]=> string(8) "419270dc" ["issuer"]=> array(5) { ["C"]=> string(2) "HU" ["L"]=> string(8) "Budapest" ["O"]=> string(13) "Microsec Ltd." ["OU"]=> string(11) "e-Szigno CA" ["CN"]=> string(17) "e-Szigno Test CA3" } ["version"]=> int(2) ["serialNumber"]=> string(31) "2663310753942666237425947058442" ["validFrom"]=> string(13) "150205151211Z" ["validTo"]=> string(13) "170205151211Z" ["validFrom_time_t"]=> int(1423149131) ["validTo_time_t"]=> int(1486307531) ["purposes"]=> array(9) { [1]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(9) "sslclient" } [2]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(9) "sslserver" } [3]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(11) "nssslserver" } [4]=> array(3) { [0]=> bool(true) [1]=> bool(false) [2]=> string(9) "smimesign" } [5]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(12) "smimeencrypt" } [6]=> array(3) { [0]=> bool(false) [1]=> bool(false) [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(false) [2]=> string(10) "ocsphelper" } [9]=> array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> string(13) "timestampsign" } } ["extensions"]=> array(9) { ["basicConstraints"]=> string(8) "CA:FALSE" ["keyUsage"]=> string(34) "Digital Signature, Non Repudiation" ["extendedKeyUsage"]=> string(17) "E-mail Protection" ["certificatePolicies"]=> string(106) "Policy: 1.3.6.1.4.1.21528.2.1.1.100 CPS: http://srv.e-szigno.hu/THR/ User Notice: Explicit Text: " ["subjectKeyIdentifier"]=> string(59) "C7:65:F4:7F:C3:42:59:FC:40:A3:B2:72:EB:13:B6:83:11:20:34:93" ["authorityKeyIdentifier"]=> string(66) "keyid:DC:E6:02:28:EF:37:30:8F:89:3E:A0:AD:20:55:F3:EF:36:E8:F0:CD " ["subjectAltName"]=> string(47) "email:info@e-szigno.hu, othername:<unsupported>" ["crlDistributionPoints"]=> string(52) " Full Name: URI:http://teszt.e-szigno.hu/TCA3.crl " ["authorityInfoAccess"]=> string(99) "OCSP - URI:http://teszt.e-szigno.hu/testca3ocsp CA Issuers - URI:http://teszt.e-szigno.hu/TCA3.crt " } }
Output for 5.3.21 - 5.4.14
Fatal error: Call to undefined function openssl_x509_parse() in /in/r1naA on line 3
Process exited with code 255.