# eosjs-keygen

> General purpose library for private key storage and key management.

Latest version **1.3.2** (published 2018-05-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install eosjs-keygen
pnpm add eosjs-keygen
yarn add eosjs-keygen
bun add eosjs-keygen
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.2 |
| Published | 2018-05-24 |
| First published | 2017-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 1.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 71 |
| Author | jamesc |
| Maintainers | jamesc, smetelin |
| Keywords | EOS, Blockchain |

## Links

- npm: https://www.npmjs.com/package/eosjs-keygen
- Repository: https://github.com/EOSIO/eosjs-keygen
- Homepage: https://github.com/EOSIO/eosjs-keygen#readme
- Issues: https://github.com/EOSIO/eosjs-keygen/issues
- npm.io page: https://npm.io/package/eosjs-keygen

## Dependencies (4)

- [history](https://npm.io/package/history.md) ^4.7.2
- [eosjs-ecc](https://npm.io/package/eosjs-ecc.md) ^4.0.1
- [minimatch](https://npm.io/package/minimatch.md) ^3.0.4
- [localStorage](https://npm.io/package/localStorage.md) ^1.0.3

## Recent versions

- 1.3.2 (latest) — 2018-05-24
- 1.3.1 — 2018-04-05
- 1.3.0 — 2017-12-21
- 1.2.4 — 2017-12-20
- 1.2.3 — 2017-12-20
- 1.2.2 — 2017-12-14
- 1.2.1 — 2017-12-13
- 1.2.0 — 2017-12-07
- 1.1.4 — 2017-12-03
- 1.1.3 — 2017-12-01
- 1.1.1 — 2017-11-30
- 1.0.0 — 2017-11-22

## README

<!--[![Build Status](https://travis-ci.org/EOSIO/eosjs-keygen.svg?branch=master)](https://travis-ci.org/EOSIO/eosjs-keygen)-->
[![NPM](https://img.shields.io/npm/v/eosjs-keygen.svg)](https://www.npmjs.org/package/eosjs-keygen)

# Repository

Provides hierarchical deterministic key generation, storage, and management.

General purpose cryptography is found in [eosjs-ecc](http://github.com/eosio/eosjs-ecc) library.

### Usage

```javascript
let {Keystore, Keygen} = require('eosjs-keygen')
Eos = require('eosjs')

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

keystore = Keystore('myaccount', sessionConfig)
eos = Eos.Testnet({keyProvider: keystore.keyProvider})

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

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

})
```

See [./API](./API.md)

# Development

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

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

# Browser

```bash
git clone https://github.com/EOSIO/eosjs-keygen.git
cd eosjs-keygen
npm install
npm run build
# builds: ./dist/eosjs-keygen.js
```

```html
<script src="eosjs-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.

---
_Source: https://npm.io/package/eosjs-keygen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
