keybase-sign
v2.0.0
Published
Sign a message given a private key
Downloads
4
Maintainers
Readme
keybase-sign
🔑 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