gpg-promised

0.4.12 • Public • Published

gpg-promised

The GPG interface for nodejs we were promised

 const GpgPromised = require('gpg-promised')
 const KeyChain = GpgPromised.KeyChain
 
 const keychain = new KeyChain()
 
 //! open keychain for operations
 await keychain.open()
 
 //! Make a connected security card the primary identity
 await keychain.trustCard()
 
 //! Download keys for reciepents
 for(const toEmail of toEmails){
   console.log('recvKey -', toEmail)
   const toKeyLookup = await keychain.lookupKey(toEmail)
   await keychain.recvKey(toKeyLookup.keyid)
 }
 
 const who = await keychain.whoami()
 console.log('whoami',who)
 
 const enc = await keychain.encrypt('hello world', who.concat(toEmails), who[0])
 console.log('encrypt -', enc)
 
 const dec = await keychain.decrypt(enc)

Readme

Keywords

none

Package Sidebar

Install

npm i gpg-promised

Weekly Downloads

14

Version

0.4.12

License

Apache-2.0

Unpacked Size

59.8 kB

Total Files

10

Last publish

Collaborators

  • alanm
  • nickzat