digitalbazaar / digitalbazaar/webkms-client
Add `generateMultikey` helper to KeystoreAgent to aid in simple generation of multikey formatted keys
Open
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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