|  | 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] |