PKCS7 functions not working ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • eXXos

    PKCS7 functions not working ?

    Hello !

    I would like to know if anyone has successfully used the functions
    openssl_pkcs7_s ign, _encrypt, _decrypt, ... ?

    I don't manage to use them, the samples on php.net are buggy, and the
    "corrected" samples provided by users
    don't work either ! :-(

    For example, when I try this sample code :

    (...)
    // encrypt it
    if (openssl_pkcs7_ encrypt($clearf ile,$encfile, $key,
    array("To" => "you@yourdomain .com", // keyed syntax
    "From" => "HQ <hq@cia.com>" , // indexed syntax
    "Subject" => "Eyes only")))
    {
    // message encrypted - send it!
    exec(ini_get("s endmail_path") . " < $encfile");

    };
    (...)

    I always got a parse error on the line containing "array('To" => ..." .

    I got the same kind of error with the different samples files, even with
    pkcs7_decrypt, _sign, ...

    So, can anyone provide me a functionnal code ?

    I precise I tried with PHP 4.2.2 and PHP 4.3.4 under Suse Linux Pro 9.0 and
    Suse Enterprise Server 8.2

    Thanks for your help ;)

    Xos.


Working...