NajmAjmal / pgp-verify

๐Ÿ”‘ Using kbpgp to verify messages based on a public key

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

keybase-verify Build Status

js-standard-style

๐Ÿ”‘ Using kbpgp to verify messages based on a public key

Install

$ npm install keybase-verify --save

Usage

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)
}

Related

E.nigma - ๐Ÿ” e.nigma.pw / Encryption toolbox utility

License

MIT ยฉ Jose Aguinaga

About

๐Ÿ”‘ Using kbpgp to verify messages based on a public key

License:MIT License


Languages

Language:JavaScript 100.0%