nightjar / swiftsigner-cryptgpg
Signer for Swift Mailer - using PEAR's Crypt_GPG library for OpenPGP encryption or signing (or both) of outgoing emails.
Installs: 3 786
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- pear/crypt_gpg: ^1.6
- swiftmailer/swiftmailer: ^4.3 || ^5 || ^6
This package is not auto-updated.
Last update: 2024-11-02 01:42:50 UTC
README
This library extends the somewhat ubiqitious SwiftMailer package by providing a class to fit the Message Signer API to implement PGP encryption and optionally signing.
Usage
One must have a keyring set up and accessible, as per the requirements of the Crypt_GPG library.
This means that PHP must also have permission to shell out commands via proc_open
$encryptionKeyID = 'recipient@example.test';
$signer = new \Nightjar\SwiftSignerCryptGPG($encryptionKeyID);
/** @var Swift_Message $swiftMessage */
$swiftMessage->attachSigner($signer);
Upon sending the message it will be encrypted as per PGP/MIME (RFC 3156)
Limitations and future development
Currently encryption is mandatory, signing is optional. This should change to provide a signing only option in the future.