openssl_pkcs7_encryptEncrypt an S/MIME message
&reftitle.description;
boolopenssl_pkcs7_encryptstringinfilestringoutfilemixedrecipcertsarrayheadersintflags0intcipheridOPENSSL_CIPHER_RC2_40openssl_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.
&reftitle.parameters;
infileoutfilerecipcerts
Either a lone X.509 certificate, or an array of X.509 certificates.
headersheaders 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.
flagsflags can be used to specify options that affect
the encoding process - see PKCS7
constants.
cipherid
One of cipher constants.
&reftitle.returnvalues;
&return.success;
&reftitle.examples;
openssl_pkcs7_encrypt example
"nighthawk@example.com", // keyed syntax
"From: HQ ", // indexed syntax
"Subject" => "Eyes only"))) {
// message encrypted - send it!
exec(ini_get("sendmail_path") . " < enc.txt");
}
?>
]]>