ghsign

2018-12-06 admin

ghsign是什么

什么是ghsign,Sign/verify data using your local ssh private key and your public key from Github

ghsign使用教程帮助文档

ghsign

Sign/verify data using your local ssh private key and your public key from Github

npm install ghsign

Build status js-standard-style

Usage

var ghsign = require('ghsign')

// create a signer (has be your own Github username)
var sign = ghsign.signer('mafintosh')

// create a verifier (can be any Github username)
var verify = ghsign.verifier('mafintosh')

// sign some data
sign('test', function(err, sig) {
  console.log('test signature is', sig)

  // verify the signature
  verify('test', sig, function(err, valid) {
    console.log('wat test signed by mafintosh?', valid)
  })
})

Creating a signer will fetch your public keys from github and use your corresponding local ssh private key to sign the data. The verifier will verify the signature by also fetching the public keys from Github.

License

MIT

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-47462.html

文章标题:ghsign

回到顶部