Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@trustalliance/key

TrustAllianceNZ57GPL-3.0-or-later0.0.1-alpha.26TypeScript support: included

TrustAlliance key SDK

DID, DID document, Verifiable Credential, W3C, TrustAlliance, Cryptography, JSONWebKey2020

readme

ExpTrustAlliance Logo

TrustAlliance Key SDK 0.0.1-alpha.6 TrustAlliance Key SDK 0.0.1-alpha.6 Node Version Lerna

TrustAlliance DID Key SDK

Implementation of JSON Web Key 2020 https://w3c-ccg.github.io/lds-jws2020/

Based on https://github.com/w3c-ccg/lds-jws2020

IMPORTANT!

  • This is a minimum viable product suite with limited functionality.
  • Please do not use this for production
  • This is a part of SDKs for Verifiable Credentials, Verifiable Credential Presentations, DID Keys, Self Sovereign Identity and Decentralised Identifiers

Installation

yarn install

Trackback Key

Architecture

Usage

importing DID builder and resolver

ES Modules import


import { JsonWebKey2020 } from '@trustalliance/key'

CommonJS import


const { JsonWebKey2020 } = require('@trustalliance/key');

Example

Generate keypair


const keyPair = await JsonWebKey2020.generate();

// {
//   id: 'did:trustalliance:key:...-pXbFqo#...-pXbFqo',
//   type: 'JsonWebKey2020',
//   controller: 'did:trustalliance:key:...-pXbFqo',
//   publicKeyJwk: {
//     crv: 'Ed25519',
//     x: 'THLsqR-...-3FDg',
//     kty: 'OKP',
//     alg: 'EdDSA',
//   },
//   privateKeyJwk: {
//     crv: 'Ed25519',
//     d: '..-URkyPqyYhTc',
//     x: 'THLsqR-...-3FDg',
//     kty: 'OKP',
//     alg: 'EdDSA',
//   },
// }


Sign messages


const signer = keyPair.signer();
const signature = await signer.sign({message:"test"});

Verify signature


const message = {...}

const signer = keyPair.signer();
const signature = await signer.sign(message);

const verifier = keyPair.verifier();
const verified = await verifier.verify({ data: message, signature });

// true / false

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

0.0.1-alpha.26 (2022-01-23)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.25 (2022-01-23)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.24 (2022-01-23)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.23 (2022-01-23)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.22 (2021-11-25)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.21 (2021-11-25)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.20 (2021-11-25)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.19 (2021-11-25)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.18 (2021-11-25)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.17 (2021-11-24)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.16 (2021-11-24)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.15 (2021-11-24)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.14 (2021-11-23)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.13 (2021-11-23)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.12 (2021-11-18)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.11 (2021-11-18)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.10 (2021-11-18)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.9 (2021-11-18)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.8 (2021-11-17)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.7 (2021-11-16)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.6 (2021-11-15)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.5 (2021-10-28)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.4 (2021-10-28)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.3 (2021-10-28)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.2 (2021-10-26)

Note: Version bump only for package @trustalliance/key

0.0.1-alpha.1 (2021-10-26)

Note: Version bump only for package @trustalliance/key