ethereum-keyfile-recognizer

Checks for valid structure of ethereum web3-secret-storage/presale keyfiles

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
ethereum-keyfile-recognizer
501.0.28 years ago8 years agoMinified + gzip package size for ethereum-keyfile-recognizer in KB

Readme

ethereum-keyfile-recognizer
Build Status
Checks for structural sanity (key-names and value-types) of json-keyfiles.
Currently recognized keyfiles: - Ethersale - web3-secret-storage (v3) - scrypt - pbkdf2

Installation

npm install --save ethereum-keyfile-recognizer

Usage

var fs = require('fs');
var recognizer = require('ethereum-keyfile-recognizer');

fs.readFile('keyfile.json', (err, data) => {
    var json = JSON.parse(data);
    var result = recognizer(json);
    /** result
     *               [ 'web3', 3 ]   web3 (v3) keyfile
     *  [ 'ethersale', undefined ]   Ethersale keyfile
     *                        null     invalid keyfile
     */
}));

Development

To build and run the tests:
$ npm install
$ npm test

Contributions

Contributions welcome - see CONTRIBUTING.md

License

MIT - see LICENSE.md