-
Notifications
You must be signed in to change notification settings - Fork 10
Add did key spec 7 validators #47
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
base: main
Are you sure you want to change the base?
Changes from all commits
a9d5787
de54f3c
71c631b
890472b
8067182
d8e7b3c
018cbd7
64d7741
3621bf9
971ee7c
9f6089f
46b2058
6f4233a
cfd3765
0f58597
8d69300
79fa10a
2a8affe
add28ac
dc6089d
23173d5
39ced6b
75c2b16
3c969b5
e03957f
e94064a
7bb57e8
4f14324
56f551a
877883b
048e695
ad51d3d
49e302a
df187bc
5696f2e
9904378
2d7fdf3
3ffb238
2153da1
c9b2cae
3c84f1d
767cf25
4e7bc2a
ab06c99
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,9 +184,31 @@ To get a DID Document for an existing `did:key` DID: | |
const did = 'did:key:z6MknCCLeeHBUaHu4aHSVLDCYQW9gjVJ7a63FpMvtuVMy53T'; | ||
const didDocument = await didKeyDriver.get({did}); | ||
``` | ||
|
||
(Results in the [example DID Doc](#example-did-document) above). | ||
|
||
### Options for `get`, `publicKeyToDidDoc`, and `generate` | ||
|
||
`get`, `publicKeyToDidDoc`, and `generate` both take an options object with the following options: | ||
|
||
```js | ||
const options = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be nice to have better docs here. Unclear what some of these do beyond what the names imply. Some of the comments are redundant ("defaults to false", then it's set to false). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added more expansive documentation for the first 2 options: ab06c99 |
||
// default publicKeyFormat for the keys in the didDocument | ||
publicKeyFormat: 'Ed25519VerificationKey2020', | ||
// enableExperimentalPublicKeyTypes defaults to false. Setting it to true enables | ||
// the use of key types that are not Multikey, JsonWebKey2020, or Ed25519VerificationKey2020. | ||
enableExperimentalPublicKeyTypes: false, | ||
// the context for the resulting did document | ||
// the default is just the did context | ||
defaultContext: [DID_CONTEXT_URL], | ||
// if false no keyAgreementKey is included | ||
// defaults to true | ||
enableEncryptionKeyDerivation: true | ||
}; | ||
|
||
const did = 'did:key:z6MknCCLeeHBUaHu4aHSVLDCYQW9gjVJ7a63FpMvtuVMy53T'; | ||
const didDoc = await didKeyDriver.get({did, options}); | ||
``` | ||
|
||
#### Getting just the key object by key id | ||
|
||
You can also use a `.get()` to retrieve an individual key, if you know it's id | ||
|
@@ -254,17 +276,17 @@ If you need DID Documents that are using the 2018/2019 crypto suites, | |
you can customize the driver as follows. | ||
|
||
```js | ||
import { | ||
Ed25519VerificationKey2018 | ||
} from '@digitalbazaar/ed25519-verification-key-2018'; | ||
import * as didKey from '@digitalbazaar/did-method-key'; | ||
|
||
const didKeyDriver2018 = didKey.driver({ | ||
verificationSuite: Ed25519VerificationKey2018 | ||
}); | ||
const didKeyDriver = didKey.driver(); | ||
|
||
const did = 'did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH'; | ||
await didKeyDriver2018.get({did}); | ||
const options = { | ||
publicKeyFormat: 'Ed25519VerificationKey2018', | ||
// this defaults to false | ||
enableExperimentalPublicKeyTypes: true | ||
}; | ||
await didKeyDriver.get({did, options}); | ||
// -> | ||
{ | ||
'@context': [ | ||
|
Uh oh!
There was an error while loading. Please reload this page.