Skip to content

A KeyAgreement key is required to generate a DID document, even though KeyAgreement is an optional field #64

@wip-abramson

Description

@wip-abramson

I am attempting to use this library with https://github.com/digitalbazaar/ecdsa-secp256k1-verification-key-2019.

This requires a few tweaks like adding the fromFingerprint method. But after I get round that I run into an error when running:

const secpDidController = await didKeyDriverSecp.fromKeyPair({
    verificationKeyPair: secpKeyPair
});

The error is Error: Cannot derive key agreement key from verification key type "EcdsaSecp256k1VerificationKey2019".
After digging into the code it appears that the error comes from here

default: {

My question is why is this an error, can't you just generate the DID document without a key agreement key?

I added a specific case for EcdsaSecp256k1VerificationKey2019 with just a break, similar to the Multikey case and the DID doc generated fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions