openssl_pkcs7_encrypt()
openssl_pkcs7_encrypt - Encrypt an S/MIME message
Syntax
bool openssl_pkcs7_encrypt (
string $infile,
string $outfile,
mixed $recipcerts,
array $headers,
int $flags,
int $cipherid)
Arguments
- infile
- outfile
- recipcerts - Either a lone X.509 certificate, or an array of X.509 certificates.
- headers - headers is an array of headers that will be prepended to the data after it has been encrypted. headers can be either an associative array keyed by header name, or an indexed array, where each element contains a single header line.
- flags - flags can be used to specify options that affect the encoding process - see PKCS7 constants.
- cipherid - Cipher can be selected with cipherid.
Description
openssl_pkcs7_encrypt() takes the contents of the file named infile and encrypts them using an RC2 40-bit cipher so that they can only be read by the intended recipients specified by recipcerts.
Version
PHP 4.0.6, 5
Return value
Returns TRUE on success or FALSE on failure.