[dev] S/MIME help
Mike Cochrane
mike@graftonhall.co.nz
Tue, 24 Sep 2002 12:41:21 +1200
> ----- Message from green@UMDNJ.EDU ---------
> I haven't seen any pkcs12-related functions in PHP, so I'd expect to call the
> openssl binary externally. Bummer. Not Elegant.
>
Yeah... really wish someone would finish the openssl module to include pkcs12
functions....
> For what it's worth, I've been trying to extend the 'openssl_cafile' option,
> to
> use an array containing more than just the one file, per documentation. So
> far,
> no go. (I need to support our private hierarchy as well as the public one -
> I
> wonder if there should be an admin interface for this).
I had alot of problems with gettings openssl functions to work due to lack of
documentation...
not tested but this should work in theory. This will alow you set openssl_cafile
to an array of filenames in your config file.
- Mike :-)
Index: smime.php
===================================================================
RCS file: /repository/horde/lib/Crypt/smime.php,v
retrieving revision 1.6
diff -r1.6 smime.php
142c142,147
< $result = openssl_pkcs7_verify($input, PKCS7_DETACHED, $output,
array($conf['utils']['openssl_cafile']));
---
> if (!is_array($conf['utils']['openssl_cafile'])) {
> $root_certs = array($conf['utils']['openssl_cafile']);
> } else {
> $root_certs = $conf['utils']['openssl_cafile'];
> }
> $result = openssl_pkcs7_verify($input, PKCS7_DETACHED, $output,
$root_certs);