php - how to decode binary string from certificate -


here code works fine , can parse data certificate. however, 1 of array key's seems have binary encoded value, how can go parsing it?

[1.3.6.1.4.1.11129.2.4.2] => �jhv�� ��x����gp <5��߸�w�� �k;͋�g0e!���]���s�0�k/�����;#�sdθ�� f�������e���l�,gx�u�-=*��&,vv�/�������d�>�fv���\�u։��k;͎=g0e -�����>�㶍���`v$���|)�u�ӡ!�j�\�i�d����'i��mn�t����k��vh���d��:���(l�qq]g��d� g��oo��k;͋�g0e!���   ct����8�/��?��nbqŀ����� ��de�oaxlx����g`�:ny��=]���� 

full screenshot of output here: http://prnt.sc/b87cj9

here php script using parse certificate:

    $pemdata = "-----begin certificate----- miig1jccbb6gawibagiqwm6l42nrur9j5hogzv8ldzanbgkqhkig9w0baqsfadbx mqswcqydvqqgewjvuzevmbmga1uechmmdghhd3rllcbjbmmumtewlwydvqqdeyh0 agf3dgugrxh0zw5kzwqgvmfsawrhdglvbibtseeyntygu1nmienbmb4xdte1mdez mdawmdawmfoxdte3mdeyotizntk1ovowge8xezarbgsrbgeeayi3paibaxmcvvmx gtaxbgsrbgeeayi3paibagwirgvsyxdhcmuxftatbgnvbaomdfroyxd0zswgsw5j ljelmakga1uebhmcvvmxezarbgnvbagmcknhbglmb3juawexfjaubgnvbacmdu1v dw50ywluifzpzxcxhtabbgnvba8tffbyaxzhdgugt3jnyw5pemf0aw9umrawdgyd vqqfewczodk4mjyxmsiwiaydvqqldbljbmzyyxn0cnvjdhvyzsbpcgvyyxrpb25z mrcwfqydvqqdda53d3cudghhd3rllmnvbtccasiwdqyjkozihvcnaqebbqadggep adccaqocggebamhju5q4nszr34zyo9rt4docx2eh/y/h24auhu/jkcwgzg+qlvsk qis2mz6r+rr6dy56rzwhn7v2jjibbz/rh0rbcg1pquqyyx9ialpafkdonmuzegqu 3gtju/bj2fdmaccthwqvf5yko8xuu8z/v9ehk+d+jucypuli6uld96f58z/0cufy 4liwojnkztzvbxdu/qdsvi1qwabq9h2juc7cdiew8xsffgwdb8b02tojm1+iwyv4 +zvmr51vwjujiryqqacevmd/zcqv32lc8nzo6xtw2czcwd4lw7pdhhtjh7w+gl1s wg3nnmfscxfpcxr+7yuehe3fh28xizb863scaweaaaocawmwggl/mcuga1udeqqe mbyccnroyxd0zs5jb22cdnd3dy50agf3dguuy29tmakga1udewqcmaawdgydvr0p aqh/baqdagwgmcsga1udhwqkmciwikaeobyggmh0dha6ly90zi5zew1jyi5jb20v dgyuy3jsmhmga1udiarsmgowaaylyiziayb4rqehmaewwtambggrbgefbqccarya ahr0chm6ly93d3cudghhd3rllmnvbs9jchmwlwyikwybbquhagiwiwwhahr0chm6 ly93d3cudghhd3rllmnvbs9yzxbvc2l0b3j5mb0ga1udjqqwmbqgccsgaqufbwmb bggrbgefbqcdajafbgnvhsmegdawgbq7jmgxolda0gq40sohdmwejnte3dbxbggr bgefbqcbaqrlmekwhwyikwybbquhmagge2h0dha6ly90zi5zew1jzc5jb20wjgyi kwybbquhmakggmh0dha6ly90zi5zew1jyi5jb20vdgyuy3j0miibfgykkwybbahw eqieagscaw4eggfqawgadgckuqmqtbhyfie7e6lmz3akpdwybpkb37jjd80oya3c eaaaaus7zyvlaaaeawbhmeuciqdeb8c8xaiwk3pvmkjll4+c0evdowujuqrtghzk zrjs2aigzqom5rp+memp2uwdwyhmtcxheidvls09hrqdkul5jiwadgbwfaaal9fc 7np14b1esj7hrna5vjkrxmdvljhv1onq3qaaaus7zy49aaaeawbhmeucic0mzcct vr0c8fu+s+o2jy3p3mbwjbb/q4h8ker129ohaieawgvkifziarh7ropg4x8q/x8n aypnbu7idjfzt6tlhmkadgbo9pj4h2scvjqm7rkohuz8cvfdz5purnekz6y7t0/7 xaaaaus7zyvlaaaeawbhmeuciqdd7t8jdun0/lobfahloj4el5jsp9/rtmjxxyd2 jo2clqighev6derlqg9heexyl4gzoubhylg6e25z//e9xfw2q/mwdqyjkozihvcn aqelbqadggebajtygoenjok5czbnq1ubtfyxjoj7iwfqdisnwuhumwi0qd+wothz mlz8uaahms/xzplzxyzmnjpt0r8aaysbqren06in/sedw+lsm5na/+lw8vsav0cu yyqgjskpcdewsil+j+sfpetzkl2yc0aoza5xapa8ur+auwslzfmn07xhe1du6rnt lhm6rkqlnqyy8dwlr2bip8wrbql4arpyctxgww48y7tbbou/gamvcdvlldux3nme 1tgorcfmam6xf9aefmydv4zk2+tpajuzspywy2uab3mpzdueukf3wpmghctbwsfm mvp85mejb8ci1z6olhoyj5mro35rizcvlom= -----end certificate-----";      // small function print data recursivly.     function print_element($item, $key)     {         if( is_array( $item ) )         {             echo "$key array:\n";             array_walk( $item, 'print_element' );             echo "$key done\n";         }         else             echo "$key = $item\n";     }      // build pem string.      // certificate resource pem string.     $cert = openssl_x509_read( $pemdata );      // parse resource , print out contents.     $cert_data = openssl_x509_parse( $cert );     //array_walk( $cert_data, 'print_element' );     echo "<pre>".print_r($cert_data,true)."</pre>";      // free resource     openssl_x509_free( $cert ); 

openssl 1.0.1 doesn't seem convert extensions asn.1 encoding readable text.

upgrade 1.0.2 fix problem , ct_precert_scts have 1.3.6.1.4.1.11129.2.4.2.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -