emailjs/emailjs-pgp-builder

Name: emailjs-pgp-builder

Owner: emailJS

Description: Builds PGP/MIME, no magic/encryption/unicorns included.

Created: 2016-04-24 23:58:57.0

Updated: 2018-05-13 21:57:01.0

Pushed: 2018-05-15 07:27:29.0

Homepage: null

Size: 7

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

emailjs-pgp-builder

Builds PGP/MIME, no magic/encryption included.

Usage
t PGPBuilder = require('emailjs-pgp-builder');
t builder = new PGPBuilder();

This is the expected data format…

message = {
 subject: 'foo',
 date: new Date(),
 from: [{
     name: 'Fred Foo',
     address: 'fred@foobar.bar'
 }],
 to: [{
     name: 'Bla Foo',
     address: 'bla@foobar.bar'
 }],
 cc: [{
     name: 'Bli Foo',
     address: 'bli@foobar.bar'
 }],
 bcc: [{
     name: 'Blu Foo',
     address: 'Blu@foobar.bar'
 }],
 id: '368357@foobar.bar',
 inReplyTo: '112342356@foobar.bar',
 text: 'asd',
 html: '<html><head></head><body>asd</body></html>',
 attachments: []

API Build a signed MIME structure
mimeRoot = builder.buildPlaintext(message);

rypto not included
signature = pgpsign(mimeRoot.build());

der.buildSigned(message, mimeRoot, signature);

ind the results of the operation here:
ole.log(message.raw)
ole.log(message.smtpEnvelope)

NB! pgpsign is whatever you use to PGP-sign the content.

Build a encrypted MIME structure
mimeRoot = builder.buildPlaintext(message);

rypto not included
ciphertext = pgpencrypt(mimeRoot.build());

der.buildEncrypted(message, ciphertext);

ind the results of the operation here:
ole.log(message.raw)
ole.log(message.smtpEnvelope)

NB! pgpencrypt is whatever you use to PGP-encrypt the content.

License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.