Skip to content

Improve the description of the breaking changes introduced by the removal of the generate API. #67

@mattcollier

Description

@mattcollier

https://github.com/digitalbazaar/did-method-key/blob/main/CHANGELOG.md#removed

In v5 of this module the generate API was removed. This was done in part to remove any dealings that this module has with private key material. DID documents are designed to be public facing documents and therefore, private key material is never exposed.

The changelog states that the generate method has been replaced by the new method fromKeyPair. This language and the fact that the return value of the two methods appear to be identical {didDocument, keyPairs} would lead one to believe that the keyPairs returned by generate and those returned by fromKeyPair would be identical but this is not the case.

The keyPairs returned by the generate API did return keys that had their private key material intact and therefore a pattern of usage developed that involved using those keys as signers for various purposes. However, the keyPairs returned by the fromKeyPair API do not have private key material and therefore cannot be used as a signer.

Tests are being rev'd up in other libraries that demonstrate the new recommended pattern of usage when using v5 of this module. We will link to those tests here.

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