A library to encrypt your message given a public pgp key. Useful in things like client-side contact forms when you would like to make sure emails sent over are encrypted. Uses an openpgp standard to encrypt 🔐
var PgpContent = require('pgp-encrypt-content')
var pgpContent = PgpContent({
contents: 'i cant quit you babbyyy',
pgpKey: '-----BEGIN PGP PUBLIC KEY BLO'
})
pgpContent.send(function (err, val) {
if (err) console.log(err)
console.log(val)
})
Create an instance of pgp-encrypt-content. Takes in an opts object with the following keys:
- opts.contents: a string or an array of values you would like to encrypt
- opts.pgpKey: a public pgp key string
This returns an encrypted string to be used in your application. pgp-encrypt-content will import from an armored pgp key you provided and encrypt your message.
- kbpgp
- openpgp
Install with npm:
npm install pgp-encrypt-content