3 ms·
I made this because the PEAR website kind of sucks, the Crypt_GPG documents are difficult to navigate, and I wanted a drop-in solution that lets you send an enc
by CiPHPerCoder 10y ago
I made this because the PEAR website kind of sucks, the Crypt_GPG documents are difficult to navigate, and I wanted a drop-in solution that lets you send an encrypted email to your recipient.
It uses zend-mail from Zend Framework and Crypt_GPG.
All you need to do is:
$gpgMailer = new GPGMailer(
new Sendmail(), // Or any other transport
['homedir' => '/homedir/containing/keyring']
);
$gpgMailer->send(
$message, // Message object from Zend\Mail
$fingerprintOrPublicKey
);
Simple as can be. (There are other steps for, e.g. importing keys in the first place, but that's neither here nor there.)
The license is dual GPL/MIT, so feel free to use it in pretty much anything. It was a minor itch to scratch.
We're using it to optionally encrypt password reset emails in a CMS we're developing:
https://twitter.com/CiPHPerCoder/status/739536854517702660 https://twitter.com/CiPHPerCoder/status/739536854517702660
The password reset feature can be entirely opted out of, too:
https://twitter.com/CiPHPerCoder/status/739537611367276545 https://twitter.com/CiPHPerCoder/status/739537611367276545