HoOngEe / codechain-keystore-js

A private key management library for CodeChain

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A private key management library for CodeChain

License:ISC License


Languages

Language:TypeScript 99.5%Language:JavaScript 0.5%