bool openssl_pkcs7_encrypt
(string infilename, string outfilename, mixed recipcerts, array headers [, long flags])
Warning |
This function is EXPERIMENTAL. The behaviour of this function, the name of this function, and anything else documented about this function may change in a future release of PHP without notice. Be warned and use this function at your own risk. |
openssl_pkcs7_encrypt() takes the contents of the file named infilename and encrypts them using an RC2 40-bit cipher so that they can only be read by the intended recipients specified by recipcerts, which is either a lone X.509 certificate, or an array of X.509 certificates. headers is an array of headers that will be prepended to the data after it has been encrypted. flags can be used to specify options that affect the encoding process - see PKCS7 constants. headers can be either an associative array keyed by header name, or an indexed array, where each element contains a single header line.
Example 1. openssl_pkcs7_encrypt() example
|
Note: This function was added in 4.0.6.