@interop/did-web-resolver 4.0.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -12
- package/dist/DidWebResolver.d.ts +267 -0
- package/dist/DidWebResolver.d.ts.map +1 -0
- package/dist/DidWebResolver.js +557 -0
- package/dist/DidWebResolver.js.map +1 -0
- package/dist/assertions.d.ts +47 -0
- package/dist/assertions.d.ts.map +1 -0
- package/dist/assertions.js +90 -0
- package/dist/assertions.js.map +1 -0
- package/dist/constants.d.ts +23 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +45 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/package.json +64 -72
- package/dist/esm/DidWebResolver.d.ts +0 -147
- package/dist/esm/DidWebResolver.d.ts.map +0 -1
- package/dist/esm/DidWebResolver.js +0 -322
- package/dist/esm/DidWebResolver.js.map +0 -1
- package/dist/esm/index.d.ts +0 -8
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js +0 -6
- package/dist/esm/index.js.map +0 -1
- package/dist/src/DidWebResolver.d.ts +0 -146
- package/dist/src/DidWebResolver.js +0 -329
- package/dist/src/DidWebResolver.js.map +0 -1
- package/dist/src/index.d.ts +0 -7
- package/dist/src/index.js +0 -12
- package/dist/src/index.js.map +0 -1
- package/dist/test/DidWebResolver.spec.d.ts +0 -1
- package/dist/test/DidWebResolver.spec.js +0 -183
- package/dist/test/DidWebResolver.spec.js.map +0 -1
- package/src/DidWebResolver.ts +0 -366
- package/src/declarations.d.ts +0 -11
- package/src/index.ts +0 -8
- /package/{LICENSE → LICENSE.md} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `did:web` Resolver _(@interop/did-web-resolver)_
|
|
2
2
|
|
|
3
|
-
[](https://github.com/interop-alliance/did-web-resolver/actions?query=workflow%3A%22CI%22)
|
|
4
4
|
[](https://npm.im/@interop/did-web-resolver)
|
|
5
5
|
|
|
6
6
|
> A did:web method Decentralized Identifier (DID) resolver for the did-io library.
|
|
@@ -36,8 +36,7 @@ Other implementations:
|
|
|
36
36
|
### Initializing
|
|
37
37
|
|
|
38
38
|
```js
|
|
39
|
-
import {
|
|
40
|
-
from '@digitalcredentials/ed25519-verification-key-2020'
|
|
39
|
+
import { Ed25519VerificationKey } from '@interop/ed25519-verification-key'
|
|
41
40
|
import { X25519KeyAgreementKey2020 }
|
|
42
41
|
from '@digitalcredentials/x25519-key-agreement-key-2020'
|
|
43
42
|
import { CryptoLD } from 'crypto-ld'
|
|
@@ -45,17 +44,21 @@ import { CryptoLD } from 'crypto-ld'
|
|
|
45
44
|
import * as didWeb from '@interop/did-web-resolver'
|
|
46
45
|
|
|
47
46
|
const cryptoLd = new CryptoLD()
|
|
48
|
-
cryptoLd.use(
|
|
47
|
+
cryptoLd.use(Ed25519VerificationKey)
|
|
49
48
|
cryptoLd.use(X25519KeyAgreementKey2020)
|
|
50
49
|
|
|
51
50
|
const didWebDriver = didWeb.driver({ cryptoLd })
|
|
52
51
|
|
|
53
52
|
// Optionally use it with the CachedResolver from did-io
|
|
54
|
-
import {CachedResolver} from '@
|
|
53
|
+
import { CachedResolver } from '@interop/did-io'
|
|
55
54
|
const resolver = new CachedResolver()
|
|
56
55
|
resolver.use(didWebDriver)
|
|
57
56
|
```
|
|
58
57
|
|
|
58
|
+
> **Note:** Ed25519 verification methods are now serialized in
|
|
59
|
+
> [Multikey](https://www.w3.org/TR/cid-1.0/#Multikey) format (`type: 'Multikey'`),
|
|
60
|
+
> via `@interop/ed25519-verification-key`.
|
|
61
|
+
|
|
59
62
|
### Generating a new DID
|
|
60
63
|
|
|
61
64
|
#### Generating from seed
|
|
@@ -78,7 +81,7 @@ const { didDocument, keyPairs, methodFor } = await didWebDriver.generate({ url,
|
|
|
78
81
|
id: 'did:web:example.com',
|
|
79
82
|
assertionMethod: [{
|
|
80
83
|
id: 'did:web:example.com#z6MkmDMjfkjs9XPCN1LfoQQRHz1mJ8PEdiVYC66XKhj3wGyB',
|
|
81
|
-
type: '
|
|
84
|
+
type: 'Multikey',
|
|
82
85
|
controller: 'did:web:example.com',
|
|
83
86
|
publicKeyMultibase: 'z6MkmDMjfkjs9XPCN1LfoQQRHz1mJ8PEdiVYC66XKhj3wGyB'
|
|
84
87
|
}]
|
|
@@ -101,25 +104,25 @@ const { didDocument, keyPairs, methodFor } = await didWebDriver.generate()
|
|
|
101
104
|
id: 'did:web:example.com',
|
|
102
105
|
capabilityInvocation: [{
|
|
103
106
|
id: 'did:web:example.com#z6MkqUiWi2o5V5oDEVzqszpkDhzeJ2o9Z4zVyTWeASqgrgti',
|
|
104
|
-
type: '
|
|
107
|
+
type: 'Multikey',
|
|
105
108
|
controller: 'did:web:example.com',
|
|
106
109
|
publicKeyMultibase: 'zC2TU7nYe9YJk81A9CRruNcSeUTXJ9Bk9HSbiLAsfwU7L'
|
|
107
110
|
}],
|
|
108
111
|
authentication: [{
|
|
109
112
|
id: 'did:web:example.com#z6MksjNYAxjiTrhPFx9Ljk3SVowEtFXhFqLdsMKJHV4KrcDT',
|
|
110
|
-
type: '
|
|
113
|
+
type: 'Multikey',
|
|
111
114
|
controller: 'did:web:example.com',
|
|
112
115
|
publicKeyMultibase: 'zEH7VaiVH8KCv9TJe4B5beiPF4gFqqx6HBLQNTD6JwPS5'
|
|
113
116
|
}],
|
|
114
117
|
assertionMethod: [{
|
|
115
118
|
id: 'did:web:example.com#z6MkiyYa5mG4moiHrmXQea8bNvdEWRWi3KuouHqoiknGf7xV',
|
|
116
|
-
type: '
|
|
119
|
+
type: 'Multikey',
|
|
117
120
|
controller: 'did:web:example.com',
|
|
118
121
|
publicKeyMultibase: 'z5XHXVX1dSGDpkGghy1AkXq5EgrErdSfTDGvstUpFjuB7'
|
|
119
122
|
}],
|
|
120
123
|
capabilityDelegation: [{
|
|
121
124
|
id: 'did:web:example.com#z6MknmeMZEXLhS6g2p6YPHkQG4PkNsJev652CqnsArPm3dZa',
|
|
122
|
-
type: '
|
|
125
|
+
type: 'Multikey',
|
|
123
126
|
controller: 'did:web:example.com',
|
|
124
127
|
publicKeyMultibase: 'z9KPJxzGuMtcCvKFqhinZQxqkZJ2oWCpfWpswLaRk8QnC'
|
|
125
128
|
}],
|
|
@@ -134,15 +137,38 @@ const { didDocument, keyPairs, methodFor } = await didWebDriver.generate()
|
|
|
134
137
|
|
|
135
138
|
## Install
|
|
136
139
|
|
|
140
|
+
- Node.js 24+ is recommended.
|
|
141
|
+
|
|
142
|
+
To install via PNPM:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
pnpm install @interop/did-web-resolver
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
To install locally (for development):
|
|
149
|
+
|
|
137
150
|
```bash
|
|
138
151
|
git clone https://github.com/interop-alliance/did-web-resolver.git
|
|
139
152
|
cd did-web-resolver
|
|
140
|
-
|
|
153
|
+
pnpm install
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### React Native
|
|
157
|
+
|
|
158
|
+
This library uses the global WHATWG `URL` API, which is available natively in
|
|
159
|
+
Node.js and browsers. React Native's built-in `URL` is not spec-compliant (in
|
|
160
|
+
particular it does not support property setters such as `url.pathname = ...`,
|
|
161
|
+
which this library relies on). React Native consumers must install
|
|
162
|
+
[`react-native-url-polyfill`](https://www.npmjs.com/package/react-native-url-polyfill)
|
|
163
|
+
and import it before using this library:
|
|
164
|
+
|
|
165
|
+
```js
|
|
166
|
+
import 'react-native-url-polyfill/auto'
|
|
141
167
|
```
|
|
142
168
|
|
|
143
169
|
## Contribute
|
|
144
170
|
|
|
145
|
-
* Coding Style: [
|
|
171
|
+
* Coding Style: [Prettier](https://prettier.io/) + [ESLint](https://eslint.org/)
|
|
146
172
|
* Docs: JSDoc
|
|
147
173
|
* Readme: [standard-readme](https://github.com/RichardLitt/standard-readme)
|
|
148
174
|
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
export declare function didFromUrl({ url }?: {
|
|
2
|
+
url?: string;
|
|
3
|
+
}): string;
|
|
4
|
+
export declare function urlFromDid({ did }: {
|
|
5
|
+
did: string | undefined;
|
|
6
|
+
}): string;
|
|
7
|
+
/**
|
|
8
|
+
* Returns the subnode of a DID document identified by `id`, with the
|
|
9
|
+
* appropriate `@context` attached. Searches `verificationMethod` first, then
|
|
10
|
+
* any other top-level node (e.g. `service`), so it can dereference keys *and*
|
|
11
|
+
* non-key subnodes.
|
|
12
|
+
*
|
|
13
|
+
* @param options {object} - Options hashmap.
|
|
14
|
+
* @param options.didDocument {object} - The DID Document to search.
|
|
15
|
+
* @param options.id {string} - The full id of the subnode to return.
|
|
16
|
+
*
|
|
17
|
+
* @returns {object} The matched subnode, cloned, with `@context`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getNode({ didDocument, id }: {
|
|
20
|
+
didDocument: any;
|
|
21
|
+
id: string;
|
|
22
|
+
}): any;
|
|
23
|
+
interface VerificationMethodEntry {
|
|
24
|
+
keyPair: any;
|
|
25
|
+
fragment?: string;
|
|
26
|
+
purposes?: string[];
|
|
27
|
+
serialization?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare class DidWebResolver {
|
|
30
|
+
method: string;
|
|
31
|
+
allowList: string[];
|
|
32
|
+
fetchOptions: any;
|
|
33
|
+
logger: any;
|
|
34
|
+
_allowedKeyTypes: Map<string, {
|
|
35
|
+
fromMultibase: any;
|
|
36
|
+
generate?: any;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* @param options {object} - Options hashmap.
|
|
40
|
+
* @param [options.allowList] {string[]} - Hosts permitted as fetch targets
|
|
41
|
+
* (SSRF gate). Empty/absent means no restriction.
|
|
42
|
+
* @param [options.fetchOptions] {object} - Network limits passed to the http
|
|
43
|
+
* client (`size` in bytes, `timeout` in ms).
|
|
44
|
+
* @param [options.logger] {object} - Logger object (with .info, .error, etc).
|
|
45
|
+
*/
|
|
46
|
+
constructor({ allowList, fetchOptions, logger }?: {
|
|
47
|
+
allowList?: string[];
|
|
48
|
+
fetchOptions?: any;
|
|
49
|
+
logger?: any;
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* Registers a key suite this driver may handle when generating documents and
|
|
53
|
+
* rebuilding key pairs from plain descriptions.
|
|
54
|
+
*
|
|
55
|
+
* Preferred form: pass a `keyPairClass` exposing static `multibaseHeader`,
|
|
56
|
+
* `from`, and (optionally) `generate`. The driver reads the header off the
|
|
57
|
+
* class, so callers need not know the literal value.
|
|
58
|
+
*
|
|
59
|
+
* Lower-level form: pass `multibaseMultikeyHeader` plus a `fromMultibase`
|
|
60
|
+
* deserializer. Suites registered this way support resolution/rebuilding but
|
|
61
|
+
* not `generate()`.
|
|
62
|
+
*
|
|
63
|
+
* @param options {object} - Options hashmap.
|
|
64
|
+
* @param [options.keyPairClass] {Function} - A KeyPair suite class.
|
|
65
|
+
* @param [options.multibaseMultikeyHeader] {string} - Multibase header.
|
|
66
|
+
* @param [options.fromMultibase] {Function} - `{publicKeyMultibase}` to key.
|
|
67
|
+
*/
|
|
68
|
+
use({ keyPairClass, multibaseMultikeyHeader, fromMultibase }?: {
|
|
69
|
+
keyPairClass?: any;
|
|
70
|
+
multibaseMultikeyHeader?: string;
|
|
71
|
+
fromMultibase?: any;
|
|
72
|
+
}): void;
|
|
73
|
+
/**
|
|
74
|
+
* Adds a single verification method to a DID document: exports the key's
|
|
75
|
+
* public node, assigns it the id `${did}#${fragment}`, pushes it into
|
|
76
|
+
* `verificationMethod`, references it under each requested purpose, and
|
|
77
|
+
* accumulates the key's `@context`.
|
|
78
|
+
*
|
|
79
|
+
* This is the foundational document-building primitive; it works on a freshly
|
|
80
|
+
* created document or on one fetched and republished with rotated keys.
|
|
81
|
+
*
|
|
82
|
+
* @param options {object} - Options hashmap.
|
|
83
|
+
* @param options.didDocument {object} - Document to mutate (must have `id`).
|
|
84
|
+
* @param options.keyPair {object} - A registered key suite instance.
|
|
85
|
+
* @param [options.keyPairs] {Map} - Optional key-id to key-pair map to update.
|
|
86
|
+
* @param [options.fragment] {string} - Author-chosen fragment (defaults to
|
|
87
|
+
* the key fingerprint).
|
|
88
|
+
* @param [options.purposes] {string[]} - Verification relationships to wire.
|
|
89
|
+
* @param [options.serialization] {string} - `'multibase'` (default); `'jwk'`
|
|
90
|
+
* is reserved for when key suites expose JWK export.
|
|
91
|
+
*
|
|
92
|
+
* @returns {object} The mutated DID document.
|
|
93
|
+
*/
|
|
94
|
+
addVerificationMethod({ didDocument, keyPairs, keyPair, fragment, purposes, serialization }: {
|
|
95
|
+
didDocument: any;
|
|
96
|
+
keyPairs?: Map<string, any>;
|
|
97
|
+
keyPair: any;
|
|
98
|
+
fragment?: string;
|
|
99
|
+
purposes?: string[];
|
|
100
|
+
serialization?: string;
|
|
101
|
+
}): any;
|
|
102
|
+
/**
|
|
103
|
+
* Generates a new `did:web` DID Document.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* const { didDocument, keyPairs } = await didWeb.generate({
|
|
107
|
+
* url: 'https://example.com', verificationKeyPair
|
|
108
|
+
* })
|
|
109
|
+
* didDocument.id // -> 'did:web:example.com'
|
|
110
|
+
*
|
|
111
|
+
* Either an `id` or a `url` is required. For the single-key common case, pass
|
|
112
|
+
* a `verificationKeyPair` (or `seed`/`keyType` to generate one from a
|
|
113
|
+
* registered suite) and optionally a `keyAgreementKeyPair`. For multi-key
|
|
114
|
+
* documents, pass `verificationMethods`.
|
|
115
|
+
*
|
|
116
|
+
* @param options {object} - Options hashmap.
|
|
117
|
+
* @param [options.id] {string} - A did:web DID (else derived from `url`).
|
|
118
|
+
* @param [options.url] {string} - HTTPS url of the DID document.
|
|
119
|
+
* @param [options.seed] {string|Uint8Array} - Secret seed to derive a key.
|
|
120
|
+
* @param [options.keyType] {Function|string} - Which registered suite to
|
|
121
|
+
* generate with (a key class or its multibase header).
|
|
122
|
+
* @param [options.verificationKeyPair] {object} - A pre-made verification key.
|
|
123
|
+
* @param [options.keyAgreementKeyPair] {object} - A pre-made keyAgreement key.
|
|
124
|
+
* @param [options.verificationMethods] {Array} - Multi-key entries, each
|
|
125
|
+
* `{ keyPair, fragment?, purposes?, serialization? }`.
|
|
126
|
+
*
|
|
127
|
+
* @returns {Promise<{didDocument: object, keyPairs: Map, methodFor: Function}>}
|
|
128
|
+
*/
|
|
129
|
+
generate({ id, url, seed, keyType, verificationKeyPair, keyAgreementKeyPair, verificationMethods }?: {
|
|
130
|
+
id?: string;
|
|
131
|
+
url?: string;
|
|
132
|
+
seed?: string | Uint8Array;
|
|
133
|
+
keyType?: any;
|
|
134
|
+
verificationKeyPair?: any;
|
|
135
|
+
keyAgreementKeyPair?: any;
|
|
136
|
+
verificationMethods?: VerificationMethodEntry[];
|
|
137
|
+
}): Promise<{
|
|
138
|
+
didDocument: any;
|
|
139
|
+
keyPairs: Map<string, any>;
|
|
140
|
+
methodFor: (options: {
|
|
141
|
+
purpose: string;
|
|
142
|
+
}) => any;
|
|
143
|
+
}>;
|
|
144
|
+
/**
|
|
145
|
+
* Generates a `did:web` DID Document from existing key pairs. A `url` or `id`
|
|
146
|
+
* is required (unlike `did:key`, a `did:web` identifier is not derivable from
|
|
147
|
+
* key material alone).
|
|
148
|
+
*
|
|
149
|
+
* @param options {object} - Options hashmap.
|
|
150
|
+
* @param [options.url] {string} - HTTPS url of the DID document.
|
|
151
|
+
* @param [options.id] {string} - A did:web DID.
|
|
152
|
+
* @param [options.verificationKeyPair] {object} - A verification KeyPair.
|
|
153
|
+
* @param [options.keyAgreementKeyPair] {object} - A keyAgreement KeyPair.
|
|
154
|
+
*
|
|
155
|
+
* @returns {Promise<{didDocument: object, keyPairs: Map, methodFor: Function}>}
|
|
156
|
+
*/
|
|
157
|
+
fromKeyPair({ url, id, verificationKeyPair, keyAgreementKeyPair }?: {
|
|
158
|
+
url?: string;
|
|
159
|
+
id?: string;
|
|
160
|
+
verificationKeyPair?: any;
|
|
161
|
+
keyAgreementKeyPair?: any;
|
|
162
|
+
}): Promise<{
|
|
163
|
+
didDocument: any;
|
|
164
|
+
keyPairs: Map<string, any>;
|
|
165
|
+
methodFor: (options: {
|
|
166
|
+
purpose: string;
|
|
167
|
+
}) => any;
|
|
168
|
+
}>;
|
|
169
|
+
/**
|
|
170
|
+
* Converts a public key description to a `did:web` DID Document. A `url` or
|
|
171
|
+
* `id` is required. Unlike `generate()`, no `keyPairs` map is returned.
|
|
172
|
+
*
|
|
173
|
+
* @param options {object} - Options hashmap.
|
|
174
|
+
* @param [options.url] {string} - HTTPS url of the DID document.
|
|
175
|
+
* @param [options.id] {string} - A did:web DID.
|
|
176
|
+
* @param options.publicKeyDescription {object} - A key pair instance or a
|
|
177
|
+
* plain public key description (e.g. from a KMS).
|
|
178
|
+
*
|
|
179
|
+
* @returns {Promise<{didDocument: object}>}
|
|
180
|
+
*/
|
|
181
|
+
publicKeyToDidDoc({ url, id, publicKeyDescription }?: {
|
|
182
|
+
url?: string;
|
|
183
|
+
id?: string;
|
|
184
|
+
publicKeyDescription?: any;
|
|
185
|
+
}): Promise<{
|
|
186
|
+
didDocument: any;
|
|
187
|
+
}>;
|
|
188
|
+
/**
|
|
189
|
+
* Computes the id of a given key pair (used by `did-io` drivers). For
|
|
190
|
+
* `did:web` the id depends on the document's DID, so the key pair must
|
|
191
|
+
* already carry an `id` or a `controller`.
|
|
192
|
+
*
|
|
193
|
+
* @param options {object} - Options hashmap.
|
|
194
|
+
* @param options.keyPair {object} - The key pair.
|
|
195
|
+
*
|
|
196
|
+
* @returns {Promise<string>} The key's id.
|
|
197
|
+
*/
|
|
198
|
+
computeId({ keyPair }: {
|
|
199
|
+
keyPair: any;
|
|
200
|
+
}): Promise<string>;
|
|
201
|
+
/**
|
|
202
|
+
* Fetches a `did:web` DID Document for a given DID, or dereferences a subnode
|
|
203
|
+
* when the DID carries a `#fragment`. Applies the SSRF allow list, network
|
|
204
|
+
* limits, and verifies that the fetched document's `id` matches the DID.
|
|
205
|
+
*
|
|
206
|
+
* @param options {object} - Options hashmap.
|
|
207
|
+
* @param [options.did] {string} - For example, 'did:web:example.com'.
|
|
208
|
+
* @param [options.url] {string} - Alias for `did`, for readability.
|
|
209
|
+
* @param [options.agent] {object} - Optional agent to customize network
|
|
210
|
+
* behavior in Node.js (such as `rejectUnauthorized: false`).
|
|
211
|
+
* @param [options.fetchOptions] {object} - Per-request network limits,
|
|
212
|
+
* merged over the driver's defaults.
|
|
213
|
+
* @param [options.logger] {object} - Logger object.
|
|
214
|
+
*
|
|
215
|
+
* @throws {Error}
|
|
216
|
+
*
|
|
217
|
+
* @returns {Promise<object>} The DID Document, or a public key / subnode.
|
|
218
|
+
*/
|
|
219
|
+
get({ did, url, agent, fetchOptions, logger }?: {
|
|
220
|
+
did?: string;
|
|
221
|
+
url?: string;
|
|
222
|
+
agent?: any;
|
|
223
|
+
fetchOptions?: any;
|
|
224
|
+
logger?: any;
|
|
225
|
+
[key: string]: unknown;
|
|
226
|
+
}): Promise<object>;
|
|
227
|
+
/**
|
|
228
|
+
* Returns the public key (verification method) object for a given DID
|
|
229
|
+
* Document and purpose. Useful in conjunction with a `.get()` call.
|
|
230
|
+
*
|
|
231
|
+
* @param options {object} - Options hashmap.
|
|
232
|
+
* @param options.didDocument {object} - DID Document (retrieved via a
|
|
233
|
+
* `.get()` or from some other source).
|
|
234
|
+
* @param options.purpose {string} - Verification method purpose, such as
|
|
235
|
+
* 'authentication', 'assertionMethod', 'keyAgreement' and so on.
|
|
236
|
+
*
|
|
237
|
+
* @returns {object} The public key object (without a `@context`).
|
|
238
|
+
*/
|
|
239
|
+
publicMethodFor({ didDocument, purpose }: {
|
|
240
|
+
didDocument: any;
|
|
241
|
+
purpose: string;
|
|
242
|
+
}): any;
|
|
243
|
+
/**
|
|
244
|
+
* Generates a verification key pair from a registered suite.
|
|
245
|
+
*
|
|
246
|
+
* @param options {object} - Options hashmap.
|
|
247
|
+
* @param [options.seed] {string|Uint8Array} - Secret seed.
|
|
248
|
+
* @param [options.keyType] {Function|string} - Which registered suite to use.
|
|
249
|
+
*
|
|
250
|
+
* @returns {Promise<object>} The generated key pair.
|
|
251
|
+
*/
|
|
252
|
+
_generateKeyPair({ seed, keyType }?: {
|
|
253
|
+
seed?: string | Uint8Array;
|
|
254
|
+
keyType?: any;
|
|
255
|
+
}): Promise<any>;
|
|
256
|
+
/**
|
|
257
|
+
* Resolves a key pair instance from either a live key pair (with `.export`)
|
|
258
|
+
* or a plain public key description (rebuilt via the registry).
|
|
259
|
+
*
|
|
260
|
+
* @param description {object} - A key pair instance or key description.
|
|
261
|
+
*
|
|
262
|
+
* @returns {Promise<object>} A live key pair instance.
|
|
263
|
+
*/
|
|
264
|
+
_toKeyPair(description: any): Promise<any>;
|
|
265
|
+
}
|
|
266
|
+
export {};
|
|
267
|
+
//# sourceMappingURL=DidWebResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DidWebResolver.d.ts","sourceRoot":"","sources":["../src/DidWebResolver.ts"],"names":[],"mappings":"AAmBA,wBAAgB,UAAU,CAAE,EAAE,GAAG,EAAE,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,MAAM,CAmClE;AAED,wBAAgB,UAAU,CAAE,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,MAAM,CAgCxE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CACrB,EAAE,WAAW,EAAE,EAAE,EAAE,EAAE;IAAE,WAAW,EAAE,GAAG,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACpD,GAAG,CA2BL;AAED,UAAU,uBAAuB;IAC/B,OAAO,EAAE,GAAG,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,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