🔑 Using kbpgp to verify messages based on a public key
$ npm install keybase-verify --save
constverify=require('keybase-verify')
constpublicKey=`-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: Keybase OpenPGP v2.0.56
Comment: https://keybase.io/jjperezaguinaga
xsFNBFfglq0BEADTvFWRPl18pcBKQmQH8WaiGQ+JXZScuv1PXAcereGrObZbQ4oN
...
`
constsignedMessage=`-----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