简体   繁体   中英

Sending encrypted mail using PHP

Currently I am sending non encrypted mails. Now I want to send encrypted mails, for this I am referred to openssl_pkcs7_encrypt() .

I didn't understand the part regarding the public key certificate.

If someone knows about this, please could you explain how I can generate this public key certificate or any alternate solution to send encrypted mails.

Thanks in advance.

SSL has always eluded my proper understanding so I can not explain this easily for you. But I do know you need to have already generated an SSL key, CSR, self-signed certificates, and then the .pem file which you need.

You may want to follow this link for a brief tutorial:

Creating SSL keys, CSRs, self-signed certificates, and .pem files.

Depending on what you may have already done, what you may need may simply be just this:

`cat domain.tld.key domain.tld.crt > domain.tld.pem`

Where domain.tld.key and domain.tld.crt are the path to the generated files using the tutorial provided above. domain.tld.pem will be the path to the file to be created, which is the public key you need for openssl_pkcs7_encrypt() .

I hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM