digitalbazaar / digitalbazaar/webkms-client

Add `generateMultikey` helper to KeystoreAgent to aid in simple generation of multikey formatted keys

Open
#45 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
6
Forks
4
PR merge metrics
No merged PRs in 30d

Description

It can be used as an alternative to generateKey and should take the key algorithm instead of a generic string type param (which is internally mapped in generateKey). It should look something like this:

async generateMultikey({
  algorithm, capability, maxCapabilityChainLength,
  publicAlias, publicAliasTemplate
} = {}) {
  const {capabilityAgent, kmsClient} = keystoreAgent;
  const invocationSigner = capabilityAgent.getSigner();
  const fullType = `urn:webkms:multikey:${algorithm}`;
  const {keyId, keyDescription} = await kmsClient.generateKey({
    type: fullType,
    // make this a const somewhere
    suiteContextUrl: 'https://w3id.org/security/suites/multikey/v1',
    invocationSigner, capability,
    maxCapabilityChainLength, publicAlias, publicAliasTemplate
  });
  const {id, type} = keyDescription;
  return new AsymmetricKey({
    id, kmsId: keyId, type, invocationSigner, kmsClient, keyDescription
  });
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the KeystoreAgent's existing generateKey path and the AsymmetricKey construction it uses. Add the generateMultikey entry point with the listed options, multikey type and suite context, and confirm it returns an AsymmetricKey with the generated key details.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.