note 124938 added to function.openssl-pkcs7-encrypt
| From: | MatthiasBarkhausen@php.net | Date: | Thu, 23 Apr 2020 12:34:36 +0000 |
| Subject: | note 124938 added to function.openssl-pkcs7-encrypt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-214524@lists.php.net to get a copy of this message | ||
To successfully sign and encrypt an plain text E-Mail to send to and to be able to read by Outlook
and iOS Mail you need to first sign w/o headers and use the PKCS7_TEXT constant, then encrypt with
headers and cipherid 3DES, then send with sendmail/ssmtp with -t option.
Reason for 3DES ist that iOS (or Apple in general) doesnt further accept the RC40 default encryption
openssl-pkcs7-encrypt is using. Outlook would decrypt such encryption, but iOS Mail just said
"this mail has no content" and "install a profile containing your identity...".
$headers = array("To" => ...,
"From" => ...,
"Subject" => ...);
openssl_pkcs7_sign("msg.txt","signed.txt",
$mMyCertFileToIncludeForRecipient,array($mMyPrivKeyFileAsPEM,
"passphrase"),array(),PKCS7_TEXT);
openssl_pkcs7_encrypt("signed.txt","enc.txt",$pubkeyContents,$headers,0,OPENSSL_CIPHER_3DES);
shell_exec("ssmtp -t < enc.txt") #sendmail same syntax
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.195 (proxied: 2a02:908:8c4:86a0:ad50:c203:518:86b)
----
Manual Page -- http://php.net/manual/en/function.openssl-pkcs7-encrypt.php
Edit -- https://master.php.net/note/edit/124938
Del: integrated -- https://master.php.net/note/delete/124938/integrated
Del: useless -- https://master.php.net/note/delete/124938/useless
Del: bad code -- https://master.php.net/note/delete/124938/bad+code
Del: spam -- https://master.php.net/note/delete/124938/spam
Del: non-english -- https://master.php.net/note/delete/124938/non-english
Del: in docs -- https://master.php.net/note/delete/124938/in+docs
Del: other reasons-- https://master.php.net/note/delete/124938
Reject -- https://master.php.net/note/reject/124938
Search -- https://master.php.net/manage/user-notes.php