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.
https://github.com/digitalbazaar/did-method-key/blob/main/CHANGELOG.md#removed
In v5 of this module the
generateAPI 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
generatemethod has been replaced by the new methodfromKeyPair. 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 thekeyPairsreturned bygenerateand those returned byfromKeyPairwould be identical but this is not the case.The
keyPairsreturned by thegenerateAPI did return keys that had their private key material intact and therefore a pattern of usage developed that involved using those keys assignersfor various purposes. However, thekeyPairsreturned by thefromKeyPairAPI do not have private key material and therefore cannot be used as asigner.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.