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.
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();
We use a JSON file to save an encrypted private key. You can find the file in ./keystore.db