How to use the ssb-keys.loadSync function in ssb-keys

To help you get started, we’ve selected a few ssb-keys examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ssbc / ssb-server / lib / cli.js View on Github external
return function(opts) {
    delete opts[0]
    delete opts._
    var keys = require('ssb-keys').loadSync(path.join(config.path, 'secret'))
    var rpc = scuttlebot.createClient({port: config.port, host: 'localhost'})

    // if there's data coming from stdin, pipe that into our command
    if(!process.stdin.isTTY) {
      pull(
        toPull.source(process.stdin),
        pull.collect(function (err, ary) {
          var str = Buffer.concat(ary).toString('utf8')
          var data = JSON.parse(str)
          next(data)
        })
      )
    }
    else
      next(opts)
github ssbc / ssb-identities / index.js View on Github external
}).map(function (file) {
    return ssbKeys.loadSync(path.join(dir, file))
  })