note 124937 added to function.openssl-pkcs7-encrypt

From: Date: Thu, 23 Apr 2020 12:34:36 +0000
Subject: note 124937 added to function.openssl-pkcs7-encrypt
Groups: php.notes 
Request: Send a blank email to php-notes+get-214523@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/124937 Del: integrated -- https://master.php.net/note/delete/124937/integrated Del: useless -- https://master.php.net/note/delete/124937/useless Del: bad code -- https://master.php.net/note/delete/124937/bad+code Del: spam -- https://master.php.net/note/delete/124937/spam Del: non-english -- https://master.php.net/note/delete/124937/non-english Del: in docs -- https://master.php.net/note/delete/124937/in+docs Del: other reasons-- https://master.php.net/note/delete/124937 Reject -- https://master.php.net/note/reject/124937 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214523) next »