A private key management library for CodeChain
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src Fix a bug in getPublicKey Oct 22, 2018
.editorconfig Copied from faucet Aug 17, 2018
.gitignore Add lib folder to .gitignore Aug 23, 2018
.travis.yml Add node.js version 10 to Travis build Sep 7, 2018
LICENSE Change LICENSE to ISC Aug 22, 2018
README.md Fix badge in README.md Sep 20, 2018
jest.config.js
package.json
tsconfig.json
tslint.json

README.md

CodeChain keystore Build Status

CodeChain keystore is a private key management library. It saves CodeChain's asset transfer address safely in a disk. If you want to manage CodeChain keys using nodejs, you should use this.

Example

var CCKey = require('codechain-keystore');

async function example() {
  const cckey = await CCKey.create();
  const savedKeys = await cckey.platform.getKeys();
  console.dir(savedKeys);
  await cckey.platform.createKey({ passphrase: "my password" });
  const savedKeys_ = await cckey.platform.getKeys();
  console.dir(savedKeys_);

  await cckey.close();
};
example();

How your private key is saved

We use a JSON file to save an encrypted private key. You can find the file in ./keystore.db