Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mattcollier opened this issue Jun 27, 2024 · 0 comments

Comments

@mattcollier
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant