🔑 Using kbpgp to verify messages based on a public key
$ npm install keybase-verify --save
const verify = require('keybase-verify')
const publicKey = `-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: Keybase OpenPGP v2.0.56
Comment: https://keybase.io/jjperezaguinaga
xsFNBFfglq0BEADTvFWRPl18pcBKQmQH8WaiGQ+JXZScuv1PXAcereGrObZbQ4oN
...
`
const signedMessage = `-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
This is a sample message signed by @jjperezaguinaga
-----BEGIN PGP SIGNATURE-----
Version: Keybase OpenPGP v2.0.58
Comment: https://keybase.io/crypto
wsBcBAABCgAGBQJYOMpcAAoJEEcNV2F2U20cE4gH/jhCSVZ3LUh6fnn9eZjkQi1t
...
`
try {
verify(publicKey, signedMessage).then(() => {
console.log('The user signed the message')
})
} catch(err) {
console.log('The user didn‘t sign the message', err)
}
E.nigma - 🔐 e.nigma.pw / Encryption toolbox utility
MIT © Jose Aguinaga