- Update from forked digitalbazaar
- BREAKING: remove cjs build
- BREAKING: remove backwards compatibility with 2018 and 2019 suites
- Change
@digitalbazaar/did-ioto@digitalcredentials/did-io(the github dependency was causing problems in Docker, downstream).
- BREAKING: Update 2020 cryptosuites to use multicodec encoding for keys.
- Add backwards compatibility, allow returning the
did:keydocument using theEd25519VerificationKey2018andX25519KeyAgreementKey2019suites.
- Add
didKeyDriver.publicKeyToDidDoc({keyPair})method. (This used to be thekeyToDidDoc()method, in<= v0.7.0, removed in v1.0 and brought back by popular demand.)
- BREAKING: Rename npm package from
did-method-keyto@digitalbazaar/did-method-key. - BREAKING: Return
{didDocument, keyPairs, methodFor}fromgenerate(). - BREAKING: Upgrade to
crypto-ldv5.0 based key suites, update to useEd25519VerificationKey2020andX25519KeyAgreementKey2020crypto suites. - BREAKING: DID Document context changed from
'https://w3id.org/did/v0.11'to the DID WG-publishedhttps://www.w3.org/ns/did/v1, plus the contexts for theEd25519VerificationKey2020andX25519KeyAgreementKey2020crypto suites. See the "Example DID Document" section of the README. - BREAKING: Rename
computeKeyId()->computeId(). - Avoid mutation of ed25519 key passed into keyToDidDoc.
- Use underscores for utility functions.
- Add
methodForandpublicMethodForconvenience functions. - BREAKING: Move the lru-cache to
did-io'sCachedResolverclass. - BREAKING:
keyToDidDocdriver method removed. (See Upgrading notes for alternatives.) - BREAKING: The
publicKeyproperty of the DID Document has been deprecated by the DID Data Model, and is now renamed toverificationMethod.
1) Check for the changed generate() return signature. The usage is now:
const {didDocument, keyPairs, methodFor} = await didKeyDriver.generate();Note that keyPairs is a js Map instance containing the public/private key
pairs for both the signing key and the X25519 key agreement key.
And the methodFor convenience function allows you to fetch a particular
public/private key pair for a given purpose. For example:
const {didDocument, keyPairs, methodFor} = await didKeyDriver.generate();
const authenticationKeyPair = methodFor({purpose: 'authentication'});
const keyAgreementKeyPair = methodFor({purpose: 'keyAgreement'});2) Make sure to adjust your documentLoader to handle the new contexts.
3) The keyToDidDoc function has been renamed to publicKeyToDidDoc() (as
of v1.1), and the return signature has changed.
// For example, if you have a key description object (such as that returned by
// a KMS system's "generate key" operation):
const publicKeyDescription = {
"@context": "https://w3id.org/security/suites/ed25519-2020/v1",
"id": "did:key:z6MkuBLrjSGt1PPADAvuv6rmvj4FfSAfffJotC6K8ZEorYmv#z6MkuBLrjSGt1PPADAvuv6rmvj4FfSAfffJotC6K8ZEorYmv",
"type": "Ed25519VerificationKey2020",
"controller": "did:key:z6MkuBLrjSGt1PPADAvuv6rmvj4FfSAfffJotC6K8ZEorYmv",
"publicKeyMultibase": "zFj5p9C2Sfqth6g6DEXtw5dWFqrtpFn4TCBBPJHGnwKzY"
};
const {didDocument} = await didKeyDriver.publicKeyToDidDoc({publicKeyDescription});
// Or, you can start with an `LDKeyPair` instance:
const keyPair = await Ed25529VerificationKey2020.generate();
const {didDocument} = await didKeyDriver.publicKeyToDidDoc({publicKeyDescription: keyPair});Don't forget that you can use the didKeyDriver.publicMethodFor({purpose})
method to fetch a particular key, after creating the DID Document.
const keyAgreementKey = didKeyDriver.publicMethodFor({didDocument, purpose: 'keyAgreement'});
// Note that the resulting keyAgreementKey pair will only have the public key material, not private- Add cache with option to configure its max size.
- BREAKING: Make
keyToDidDocasynchronous.
- Return public/private key pair from
generate(), available ondidDoc.keys.
- BREAKING: Use
x25519-key-pairv2.0.0, changed fingerprint format for X25519 keys. - Use
crypto-ldv0.3.7.
- Add
computeKeyId()andmethodto driver, to work withdid-iodownstream.
- Use x25519-key-pair@1.
driver.get()can now also resolve individual keys.
- BREAKING: Undo previous change, using
https://w3id.org/did/v0.11as@context, apologies for the confusion.
- BREAKING: Now using
'https://www.w3.org/ns/did/v1'as context.
- BREAKING: Fix - Use fingerprint hash fragment as key id.
-
Add core files.
-
See git history for changes previous to this release.