Name: nodemailer-openpgp
Owner: nodemailer
Description: Encrypt Nodemailer messages with PGP
Created: 2016-04-16 15:57:55.0
Updated: 2018-05-13 19:39:06.0
Pushed: 2017-08-18 13:21:41.0
Homepage: null
Size: 13
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This module allows you to send PGP encrypted messages using Nodemailer. Generated messages are in PGP/MIME format and currently it is only possible to encrypt or encrypt+sign but not just sign messages.
Install from npm
npm install nodemailer-openpgp --save
Load the openpgpEncrypt
function
openpgpEncrypt = require('nodemailer-openpgp').openpgpEncrypt;
Attach it as a 'stream' handler for a nodemailer transport object
sporter.use('stream', openpgpEncrypt(options));
Where
To encrypt outgoing messages add encryptionKeys
array that holds the public keys used to encrypt the message.
nodemailer = require('nodemailer');
transporter = nodemailer.createTransport();
openpgpEncrypt = require('nodemailer-openpgp').openpgpEncrypt;
sporter.use('stream', openpgpEncrypt());
sporter.sendMail({
from: 'sender@address',
to: 'receiver@address',
subject: 'hello',
text: 'hello world!',
encryptionKeys: ['-----BEGIN PGP PUBLIC KEY BLOCK-----?']
unction(err, response) {
console.log(err || response);
LGPL-3.0