Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodemailer-openpgp

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodemailer-openpgp

Encrypt Nodemailer messages with PGP

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
470
decreased by-36.14%
Maintainers
1
Weekly downloads
 
Created
Source

OpenPGP module for Nodemailer

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.

Build Status

Install

Install from npm

npm install nodemailer-openpgp --save

Usage

Load the openpgpEncrypt function

var openpgpEncrypt = require('nodemailer-openpgp').openpgpEncrypt;

Attach it as a 'stream' handler for a nodemailer transport object

transporter.use('stream', openpgpEncrypt(options));

Where

  • options includes the following optional options for encryptionKeys
    • signingKey is an optional PGP private key for signing the encrypted message. If this value is not given then messages are encrypted but not signed
    • passphrase is the optional passphrase for the signing key in case it is encrypted

To encrypt outgoing messages add encryptionKeys array that holds the public keys used to encrypt the message.

Example

var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport();
var openpgpEncrypt = require('nodemailer-openpgp').openpgpEncrypt;
transporter.use('stream', openpgpEncrypt());
transporter.sendMail({
    from: 'sender@address',
    to: 'receiver@address',
    subject: 'hello',
    text: 'hello world!',
    encryptionKeys: ['-----BEGIN PGP PUBLIC KEY BLOCK-----…']
}, function(err, response) {
    console.log(err || response);
});

License

LGPL-3.0

Keywords

FAQs

Package last updated on 16 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc