0.0.4 • Published 5 years ago

@holo-host/chaperone-key-manager v0.0.4

Weekly downloads
5
License
-
Repository
github
Last release
5 years ago

Overview

Usage

const { KeyManager } = require('@holo-host/chaperone-key-manager');
const crypto = require('crypto');

const seed = crypto.randomBytes( 32 );
// or derive seed
const seed = KeyManager.deriveSeed("some dna hash", "someone@example.com", "Passw0rd!");

const message = "Hello World";
const keys = new KeyManager( seed );

const signature = keys.sign( message );
const verified = keys.verify( message, signature );

Bundle for web

bootstrap.js

import("./index.js")
    .then(m => Object.assign(window, m))
    .catch(e => console.error("Error importing `index.js`:", e));

index.js

const { KeyManager } = require("@holo-host/chaperone-key-manager");

module.exports = {
    KeyManager,
};

webpack.config.js

module.exports = {
    target: "web",

    entry: "./bootstrap.js",

    // Assign 'module.exports' to the window variable
    output: {
        libraryTarget: "window",
    },
};
0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

0.0.0

5 years ago