1.2.1 • Published 7 years ago

openpgp-wrapper v1.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

openpgpWrapper.js

little wrapper around the npm's openpgp module

const OpenPGP = require('openpgp-wrapper');

(async()=>{
	let pgp = new OpenPGP();
	let keys = await pgp.generateKeys(512, { name:'Jon Smith', email:'jon@example.com' }, "secret passphrase")

	console.log(keys.privateKey);
	console.log(keys.publicKey);

	let encrypted = await pgp.encrypt("hello world", keys.publicKey, true);
	console.log(encrypted)

	let decrypted = await pgp.decryptAndVerifySignature(encrypted, keys.publicKey);
	console.log(decrypted);
})();