0.0.0-6 ā€¢ Published 4 years ago

@transmute/did-wallet v0.0.0-6

Weekly downloads
6
License
Apache-2
Repository
github
Last release
4 years ago

@transmute/did-wallet

npm i @transmute/did-wallet --save

šŸš§ Under Construction.

Description

A simple javascript based key store built for DID and JSON-LD Signatures.

Usage

Creating, locking and exporting...

const wallet = didWallet.create({
  keys: [
    {
      type: "assymetric",
      encoding: "hex",
      publicKey: "1111...",
      privateKey: "222...",
      tags: ["Secp256k1VerificationKey2018", "did:example:123", "WebBrowser"],
      notes: ""
    },
    {
      type: "assymetric",
      encoding: "hex",
      publicKey: "3333...",
      privateKey: "4444...",
      tags: ["Secp256k1VerificationKey2018", "did:example:456", "OfflineOnly"],
      notes: ""
    }
  ]
});
wallet.lock("hard-to-guess-password");
const exported = wallet.export();

Importing, unlocking, and extracting...

const wallet = didWallet.create("l2aUGWXsaiRN_aANnXi9...");
wallet.unlock("hard-to-guess-password");

const onlyWebKeys = wallet.extractByTags(["WebBrowser"]);
let webWallet = didWallet.create({
  keys: [...onlyWebKeys]
});

Encoding and Standards

Developing

npm i
npm run test