Skip to content

datapartyjs/gpg-promised

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

The GPG interface for nodejs we were promised

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published