pcjs-keygen
General purpose library for private key storage and key management.
Last updated a year ago by rise.worlds .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install pcjs-keygen 
SYNC missed versions from official npm registry.

NPM

Repository

Provides hierarchical deterministic key generation, storage, and management.

General purpose cryptography is found in pcjs-ecc library.

Usage

let {Keystore, Keygen} = require('pcjs-keygen')
PC = require('pcjs')

sessionConfig = {
  timeoutInMin: 30,
  uriRules: {
    'owner' : '/account_recovery',
    'active': '/(transfer|contracts)',
    'active/**': '/producers'
  }
}

keystore = Keystore('myaccount', sessionConfig)
pc = PC.Testnet({keyProvider: keystore.keyProvider})

Keygen.generateMasterKeys().then(keys => {
  // create blockchain account called 'myaccount'
  console.log(keys)

  pc.getAccount('myaccount').then(account => {
    keystore.deriveKeys({
      parent: keys.masterPrivateKey,
      accountPermissions: account.permissions
    })
  })

})

See ./API

Development

let {Keystore, Keygen} = require('./src')

Use Node v8+ (updates package-lock.json)

Browser

git clone https://gitee.com/rise/pcjs-keygen.git
cd pcjs-keygen
npm install
npm run build
# builds: ./dist/pcjs-keygen.js
<script src="pcjs-keygen.js"></script>
<script>
//kos.Keystore
//kos.Keygen
//...
</script>

Runtime Environment

Node 6+ and browser (browserify, webpack, etc)

Built with React Native in mind, create an issue if you find a bug.

Current Tags

  • 1.0.0                                ...           latest (a year ago)

1 Versions

  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (4)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |