keybase-sign

2.0.0 • Public • Published

keybase-sign Build Status

js-standard-style

🔑 Using kbpgp to sign messages with on a private key

Install

$ npm install keybase-sign --save

Usage

const sign = require('keybase-sign')
 
const privateKey =  `-----BEGIN PGP PRIVATE KEY BLOCK-----
Version: Keybase OpenPGP v2.0.66
Comment: https://keybase.io/crypto
 
xcaGBFjc/2UBEADIuWmIzZNn5ZXLSs5juV+yi2RIsCqHtotcjJ/g4QqKaw4vpFYa
...
`
 
const message = 'This is a test'
const passphrase = 'password' // Only required if private key is locked
 
try {
  sign(privateKey, message, passphrase).then(detachedSignature => {
    console.log(detachedSignature)
    /*
    -----BEGIN PGP MESSAGE-----
    Version: Keybase OpenPGP v2.0.68
    Comment: https://keybase.io/crypto
    
    yMCQAnicAUQBu/7EDQMACgFK7D7a1hCEhQHLFHUAWN58I1RoaXMgaXMgYSB0ZXN0
    ...
    -----END PGP MESSAGE-----
    */
  })
} catch(err) {
    console.log('There was an error signing', err)
}
 
 

Related

E.nigma - 🔐 e.nigma.pw / Encryption toolbox utility

License

MIT © Jose Aguinaga

Package Sidebar

Install

npm i keybase-sign

Weekly Downloads

0

Version

2.0.0

License

MIT

Last publish

Collaborators

  • jjperezaguinaga