You are here: openssl « PHP Programming Language « IT news, forums, messages
openssl

Posted by Christian Barmala on 02/18/06 19:22

Hi,

if I feed a certificate to openssl_x509_parse($smimepublickey), the
returned array contains
....
[purposes] => Array
...
[4] => Array
(
[0] => 1
[1] =>
[2] => smimesign
)
....

but when I feed the same cert to

openssl_x509_checkpurpose($smimepublickey, X509_PURPOSE_SMIME_SIGN) I
get "0" ("false") as return value. These two results contradict each
other, so either this is a bug in PHP or I overlooked an important
detail. Can anyone comment?




Here is the code to reproduce the error:

<?php
$smimepublickey=<<<END
-----BEGIN CERTIFICATE-----
GIICnzCCAgigAwIBAgIDDraxMA1GCSqGSIb3DQEBBAUAMGIxCzAJBgNVBAYTAlpD
....
AQET
-----END CERTIFICATE-----
END;

echo("<pre>\n");
print_r(openssl_x509_parse($smimepublickey));
echo("</pre>\n");
print(openssl_x509_checkpurpose($smimepublickey, X509_PURPOSE_SMIME_SIGN));
?>

Christian

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация