@sphereon/ssi-sdk-ext.did-resolver-key 0.28.1-feature.esm.cjs.8 → 0.28.1-feature.oyd.cmsm.improv.16

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.
Files changed (54) hide show
  1. package/dist/drivers/bls12381g2.d.ts +8 -0
  2. package/dist/drivers/bls12381g2.d.ts.map +1 -0
  3. package/dist/drivers/bls12381g2.js +49 -0
  4. package/dist/drivers/bls12381g2.js.map +1 -0
  5. package/dist/drivers/ed25519.d.ts +8 -0
  6. package/dist/drivers/ed25519.d.ts.map +1 -0
  7. package/dist/drivers/ed25519.js +118 -0
  8. package/dist/drivers/ed25519.js.map +1 -0
  9. package/dist/drivers/jwk.jcs.d.ts +8 -0
  10. package/dist/drivers/jwk.jcs.d.ts.map +1 -0
  11. package/dist/drivers/jwk.jcs.js +23 -0
  12. package/dist/drivers/jwk.jcs.js.map +1 -0
  13. package/dist/drivers/secp256k1.d.ts +8 -0
  14. package/dist/drivers/secp256k1.d.ts.map +1 -0
  15. package/dist/drivers/secp256k1.js +49 -0
  16. package/dist/drivers/secp256k1.js.map +1 -0
  17. package/dist/drivers/secp256r1.d.ts +24 -0
  18. package/dist/drivers/secp256r1.d.ts.map +1 -0
  19. package/dist/drivers/secp256r1.js +99 -0
  20. package/dist/drivers/secp256r1.js.map +1 -0
  21. package/dist/drivers/secp384r1.d.ts +24 -0
  22. package/dist/drivers/secp384r1.d.ts.map +1 -0
  23. package/dist/drivers/secp384r1.js +99 -0
  24. package/dist/drivers/secp384r1.js.map +1 -0
  25. package/dist/drivers/secp521r1.d.ts +23 -0
  26. package/dist/drivers/secp521r1.d.ts.map +1 -0
  27. package/dist/drivers/secp521r1.js +87 -0
  28. package/dist/drivers/secp521r1.js.map +1 -0
  29. package/dist/index.d.ts +5 -18
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +87 -484
  32. package/dist/index.js.map +1 -1
  33. package/dist/types.d.ts +14 -0
  34. package/dist/types.d.ts.map +1 -0
  35. package/dist/types.js +6 -0
  36. package/dist/types.js.map +1 -0
  37. package/package.json +10 -22
  38. package/src/__tests__/__snapshots__/secp256r1.test.ts.snap +1 -249
  39. package/src/__tests__/__snapshots__/secp384r1.test.ts.snap +1 -249
  40. package/src/__tests__/__snapshots__/secp521r1.test.ts.snap +1 -280
  41. package/src/__tests__/key_resolver.test.ts +1 -2
  42. package/src/__tests__/secp256r1.test.ts +4 -4
  43. package/src/__tests__/secp384r1.test.ts +3 -3
  44. package/src/__tests__/secp521r1.test.ts +2 -3
  45. package/src/drivers/bls12381g2.ts +2 -3
  46. package/src/drivers/ed25519.ts +5 -7
  47. package/src/drivers/secp256k1.ts +2 -3
  48. package/src/drivers/secp256r1.ts +5 -5
  49. package/src/drivers/secp384r1.ts +2 -3
  50. package/src/drivers/secp521r1.ts +2 -3
  51. package/src/index.ts +0 -1
  52. package/dist/index.cjs +0 -520
  53. package/dist/index.cjs.map +0 -1
  54. package/dist/index.d.cts +0 -21
package/dist/index.js CHANGED
@@ -1,491 +1,94 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/index.ts
5
- import { decode } from "varint";
6
- import { base58btc } from "multiformats/bases/base58";
7
-
8
- // src/drivers/ed25519.ts
9
- import { toString } from "uint8arrays/to-string";
10
- import { convertPublicKeyToX25519 } from "@stablelib/ed25519";
11
-
12
- // src/types.ts
13
- var DID_LD_JSON = "application/did+ld+json";
14
- var DID_JSON = "application/did+json";
15
-
16
- // src/drivers/ed25519.ts
17
- function encodeKey(key, encodeKey2) {
18
- const bytes = new Uint8Array(key.length + 2);
19
- bytes[0] = encodeKey2 ?? 236;
20
- bytes[1] = 1;
21
- bytes.set(key, 2);
22
- return `z${toString(bytes, "base58btc")}`;
23
- }
24
- __name(encodeKey, "encodeKey");
25
- var keyToDidDoc = /* @__PURE__ */ __name((args) => {
26
- const { options } = args;
27
- if (!options?.publicKeyFormat) {
28
- return keyToDidDoc2020(args);
29
- }
30
- switch (options.publicKeyFormat) {
31
- case "Ed25519VerificationKey2018":
32
- case "X25519KeyAgreementKey2019":
33
- return keyToDidDoc2018_2019(args);
34
- case "Ed25519VerificationKey2020":
35
- case "X25519KeyAgreementKey2020":
36
- case "Multikey":
37
- return keyToDidDoc2020(args);
38
- default:
39
- throw Error(`${options.publicKeyFormat} not supported yet for the ed25519 driver`);
40
- }
41
- }, "keyToDidDoc");
42
- var keyToDidDoc2018_2019 = /* @__PURE__ */ __name(({ pubKeyBytes, fingerprint, contentType }) => {
43
- const did = `did:key:${fingerprint}`;
44
- const keyId = `${did}#${fingerprint}`;
45
- const x25519PubBytes = convertPublicKeyToX25519(pubKeyBytes);
46
- const x25519KeyId = `${did}#${encodeKey(x25519PubBytes)}`;
47
- return {
48
- ...contentType === DID_LD_JSON && {
49
- "@context": [
50
- "https://www.w3.org/ns/did/v1",
51
- "https://w3id.org/security/suites/ed25519-2018/v1",
52
- "https://w3id.org/security/suites/x25519-2019/v1"
53
- ]
54
- },
55
- id: did,
56
- verificationMethod: [
57
- {
58
- id: keyId,
59
- type: "Ed25519VerificationKey2018",
60
- controller: did,
61
- publicKeyBase58: toString(pubKeyBytes, "base58btc")
62
- },
63
- {
64
- id: x25519KeyId,
65
- type: "X25519KeyAgreementKey2019",
66
- controller: did,
67
- publicKeyBase58: toString(x25519PubBytes, "base58btc")
68
- }
69
- ],
70
- authentication: [
71
- keyId
72
- ],
73
- assertionMethod: [
74
- keyId
75
- ],
76
- capabilityDelegation: [
77
- keyId
78
- ],
79
- capabilityInvocation: [
80
- keyId
81
- ],
82
- keyAgreement: [
83
- x25519KeyId
84
- ]
85
- };
86
- }, "keyToDidDoc2018_2019");
87
- var keyToDidDoc2020 = /* @__PURE__ */ __name(({ pubKeyBytes, fingerprint, contentType }) => {
88
- const did = `did:key:${fingerprint}`;
89
- const keyId = `${did}#${fingerprint}`;
90
- const x25519PubBytes = convertPublicKeyToX25519(pubKeyBytes);
91
- const x25519KeyId = `${did}#${encodeKey(x25519PubBytes)}`;
92
- return {
93
- ...contentType === DID_LD_JSON && {
94
- "@context": [
95
- "https://www.w3.org/ns/did/v1",
96
- "https://w3id.org/security/suites/ed25519-2020/v1",
97
- "https://w3id.org/security/suites/x25519-2020/v1"
98
- ]
99
- },
100
- id: did,
101
- verificationMethod: [
102
- {
103
- id: keyId,
104
- type: "Ed25519VerificationKey2020",
105
- controller: did,
106
- publicKeyMultibase: encodeKey(pubKeyBytes, 237)
107
- }
108
- ],
109
- authentication: [
110
- keyId
111
- ],
112
- assertionMethod: [
113
- keyId
114
- ],
115
- capabilityDelegation: [
116
- keyId
117
- ],
118
- capabilityInvocation: [
119
- keyId
120
- ],
121
- keyAgreement: [
122
- {
123
- id: x25519KeyId,
124
- type: "X25519KeyAgreementKey2020",
125
- controller: did,
126
- publicKeyMultibase: encodeKey(x25519PubBytes, 236)
127
- }
128
- ]
129
- };
130
- }, "keyToDidDoc2020");
131
- var ed25519_default = {
132
- keyToDidDoc
133
- };
134
-
135
- // src/drivers/bls12381g2.ts
136
- import { toString as toString2 } from "uint8arrays/to-string";
137
- var keyToDidDoc2 = /* @__PURE__ */ __name(({ pubKeyBytes, fingerprint }) => {
138
- const did = `did:key:${fingerprint}`;
139
- const keyId = `${did}#${fingerprint}`;
140
- return {
141
- id: did,
142
- verificationMethod: [
143
- {
144
- id: keyId,
145
- type: "Bls12381G2Key2020",
146
- controller: did,
147
- publicKeyBase58: toString2(pubKeyBytes, "base58btc")
148
- }
149
- ],
150
- authentication: [
151
- keyId
152
- ],
153
- assertionMethod: [
154
- keyId
155
- ],
156
- capabilityDelegation: [
157
- keyId
158
- ],
159
- capabilityInvocation: [
160
- keyId
161
- ]
162
- };
163
- }, "keyToDidDoc");
164
- var bls12381g2_default = {
165
- keyToDidDoc: keyToDidDoc2
166
- };
167
-
168
- // src/drivers/secp256k1.ts
169
- import { toString as toString3 } from "uint8arrays/to-string";
170
- var keyToDidDoc3 = /* @__PURE__ */ __name(({ pubKeyBytes, fingerprint }) => {
171
- const did = `did:key:${fingerprint}`;
172
- const keyId = `${did}#${fingerprint}`;
173
- return {
174
- id: did,
175
- verificationMethod: [
176
- {
177
- id: keyId,
178
- type: "Secp256k1VerificationKey2018",
179
- controller: did,
180
- publicKeyBase58: toString3(pubKeyBytes, "base58btc")
181
- }
182
- ],
183
- authentication: [
184
- keyId
185
- ],
186
- assertionMethod: [
187
- keyId
188
- ],
189
- capabilityDelegation: [
190
- keyId
191
- ],
192
- capabilityInvocation: [
193
- keyId
194
- ]
195
- };
196
- }, "keyToDidDoc");
197
- var secp256k1_default = {
198
- keyToDidDoc: keyToDidDoc3
199
- };
200
-
201
- // src/drivers/secp256r1.ts
202
- import * as nist_weierstrauss from "nist-weierstrauss";
203
- import { fromString } from "uint8arrays/from-string";
204
- function keyToDidDoc4({ pubKeyBytes, fingerprint }) {
205
- const did = `did:key:${fingerprint}`;
206
- const keyId = `${did}#${fingerprint}`;
207
- const key = pubKeyBytesToXY(pubKeyBytes);
208
- return {
209
- id: did,
210
- verificationMethod: [
211
- {
212
- id: keyId,
213
- type: "JsonWebKey2020",
214
- controller: did,
215
- publicKeyJwk: {
216
- kty: "EC",
217
- crv: "P-256",
218
- x: key.xm,
219
- y: key.ym
220
- }
221
- }
222
- ],
223
- authentication: [
224
- keyId
225
- ],
226
- assertionMethod: [
227
- keyId
228
- ],
229
- capabilityDelegation: [
230
- keyId
231
- ],
232
- capabilityInvocation: [
233
- keyId
234
- ]
235
- };
236
- }
237
- __name(keyToDidDoc4, "keyToDidDoc");
238
- function pubKeyBytesToXY(pubKeyBytes) {
239
- if (!nist_weierstrauss.nist_weierstrauss_common.testUint8Array(pubKeyBytes)) {
240
- throw new TypeError("input must be a Uint8Array");
241
- }
242
- const publicKeyHex = nist_weierstrauss.nist_weierstrauss_common.pubKeyBytesToHex(pubKeyBytes);
243
- const bytesCount = publicKeyHex.length / 2;
244
- if (bytesCount == 64) {
245
- return nist_weierstrauss.nist_weierstrauss_common.publicKeyToXY(publicKeyHex);
246
- }
247
- if (bytesCount == 65) {
248
- if (publicKeyHex.slice(0, 2) == "04") {
249
- const publicKey = publicKeyHex.slice(2);
250
- return nist_weierstrauss.nist_weierstrauss_common.publicKeyToXY(publicKey);
251
- }
252
- }
253
- if (bytesCount == 33) {
254
- if (publicKeyHex.slice(0, 2) == "03" || publicKeyHex.slice(0, 2) == "02") {
255
- const publicKey = fromString(publicKeyHex, "base16");
256
- const point = nist_weierstrauss.secp256r1.ECPointDecompress(publicKey);
257
- return nist_weierstrauss.nist_weierstrauss_common.publicKeyIntToXY(point);
258
- }
259
- }
260
- throw new Error("Unexpected pubKeyBytes");
261
- }
262
- __name(pubKeyBytesToXY, "pubKeyBytesToXY");
263
- var secp256r1_default = {
264
- keyToDidDoc: keyToDidDoc4
265
- };
266
-
267
- // src/drivers/secp384r1.ts
268
- import { fromString as fromString2 } from "uint8arrays/from-string";
269
- import * as nist_weierstrauss2 from "nist-weierstrauss";
270
- function keyToDidDoc5({ pubKeyBytes, fingerprint }) {
271
- const did = `did:key:${fingerprint}`;
272
- const keyId = `${did}#${fingerprint}`;
273
- const key = pubKeyBytesToXY2(pubKeyBytes);
274
- return {
275
- id: did,
276
- verificationMethod: [
277
- {
278
- id: keyId,
279
- type: "JsonWebKey2020",
280
- controller: did,
281
- publicKeyJwk: {
282
- kty: "EC",
283
- crv: "P-384",
284
- x: key.xm,
285
- y: key.ym
286
- }
287
- }
288
- ],
289
- authentication: [
290
- keyId
291
- ],
292
- assertionMethod: [
293
- keyId
294
- ],
295
- capabilityDelegation: [
296
- keyId
297
- ],
298
- capabilityInvocation: [
299
- keyId
300
- ]
301
- };
302
- }
303
- __name(keyToDidDoc5, "keyToDidDoc");
304
- function pubKeyBytesToXY2(pubKeyBytes) {
305
- if (!nist_weierstrauss2.nist_weierstrauss_common.testUint8Array(pubKeyBytes)) {
306
- throw new TypeError("input must be a Uint8Array");
307
- }
308
- const publicKeyHex = nist_weierstrauss2.nist_weierstrauss_common.pubKeyBytesToHex(pubKeyBytes);
309
- const bytesCount = publicKeyHex.length / 2;
310
- if (bytesCount == 96) {
311
- return nist_weierstrauss2.nist_weierstrauss_common.publicKeyToXY(publicKeyHex);
312
- }
313
- if (bytesCount == 97) {
314
- if (publicKeyHex.slice(0, 2) == "04") {
315
- const publicKey = publicKeyHex.slice(2);
316
- return nist_weierstrauss2.nist_weierstrauss_common.publicKeyToXY(publicKey);
317
- }
318
- }
319
- if (bytesCount == 49) {
320
- if (publicKeyHex.slice(0, 2) == "03" || publicKeyHex.slice(0, 2) == "02") {
321
- const publicKey = fromString2(publicKeyHex, "base16");
322
- const point = nist_weierstrauss2.secp384r1.ECPointDecompress(publicKey);
323
- return nist_weierstrauss2.nist_weierstrauss_common.publicKeyIntToXY(point);
324
- }
325
- }
326
- throw new Error("Unexpected pubKeyBytes");
327
- }
328
- __name(pubKeyBytesToXY2, "pubKeyBytesToXY");
329
- var secp384r1_default = {
330
- keyToDidDoc: keyToDidDoc5
331
- };
332
-
333
- // src/drivers/secp521r1.ts
334
- import { fromString as fromString3 } from "uint8arrays/from-string";
335
- import * as nist_weierstrauss3 from "nist-weierstrauss";
336
- function keyToDidDoc6({ pubKeyBytes, fingerprint }) {
337
- const did = `did:key:${fingerprint}`;
338
- const keyId = `${did}#${fingerprint}`;
339
- const key = pubKeyBytesToXY3(pubKeyBytes);
340
- return {
341
- id: did,
342
- verificationMethod: [
343
- {
344
- id: keyId,
345
- type: "JsonWebKey2020",
346
- controller: did,
347
- publicKeyJwk: {
348
- kty: "EC",
349
- crv: "P-521",
350
- x: key.xm,
351
- y: key.ym
352
- }
353
- }
354
- ],
355
- authentication: [
356
- keyId
357
- ],
358
- assertionMethod: [
359
- keyId
360
- ],
361
- capabilityDelegation: [
362
- keyId
363
- ],
364
- capabilityInvocation: [
365
- keyId
366
- ]
367
- };
368
- }
369
- __name(keyToDidDoc6, "keyToDidDoc");
370
- function pubKeyBytesToXY3(pubKeyBytes) {
371
- if (!nist_weierstrauss3.nist_weierstrauss_common.testUint8Array(pubKeyBytes)) {
372
- throw new TypeError("input must be a Uint8Array");
373
- }
374
- const publicKeyHex = nist_weierstrauss3.nist_weierstrauss_common.pubKeyBytesToHex(pubKeyBytes);
375
- if (132 <= publicKeyHex.length && publicKeyHex.length <= 134) {
376
- if (publicKeyHex.slice(0, 2) == "03" || publicKeyHex.slice(0, 2) == "02") {
377
- const publicKey = fromString3(publicKeyHex, "base16");
378
- const point = nist_weierstrauss3.secp521r1.ECPointDecompress(publicKey);
379
- return nist_weierstrauss3.nist_weierstrauss_common.publicKeyIntToXY(point);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
380
7
  }
381
- }
382
- throw new Error("Unexpected pubKeyBytes");
383
- }
384
- __name(pubKeyBytesToXY3, "pubKeyBytesToXY");
385
- var secp521r1_default = {
386
- keyToDidDoc: keyToDidDoc6
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
387
15
  };
388
-
389
- // src/drivers/jwk.jcs.ts
390
- import { jwkJcsDecode } from "@sphereon/ssi-sdk-ext.key-utils";
391
- var keyToDidDoc7 = /* @__PURE__ */ __name(({ pubKeyBytes, fingerprint, contentType }) => {
392
- const did = `did:key:${fingerprint}`;
393
- const keyId = `${did}#${fingerprint}`;
394
- const publicKeyJwk = jwkJcsDecode(pubKeyBytes);
395
- return {
396
- ...contentType === DID_LD_JSON && {
397
- "@context": [
398
- "https://www.w3.org/ns/did/v1",
399
- "https://w3id.org/security/suites/jws-2020/v1"
400
- ]
401
- },
402
- id: did,
403
- verificationMethod: [
404
- {
405
- id: keyId,
406
- type: "JsonWebKey2020",
407
- controller: did,
408
- publicKeyJwk
409
- }
410
- ],
411
- authentication: [
412
- keyId
413
- ],
414
- assertionMethod: [
415
- keyId
416
- ],
417
- capabilityDelegation: [
418
- keyId
419
- ],
420
- capabilityInvocation: [
421
- keyId
422
- ]
423
- };
424
- }, "keyToDidDoc");
425
- var jwk_jcs_default = {
426
- keyToDidDoc: keyToDidDoc7
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
427
24
  };
428
-
429
- // src/index.ts
430
- var prefixToDriverMap = {
431
- 231: secp256k1_default,
432
- 237: ed25519_default,
433
- 4608: secp256r1_default,
434
- 4609: secp384r1_default,
435
- 4610: secp521r1_default,
436
- 235: bls12381g2_default,
437
- 60241: jwk_jcs_default
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
438
27
  };
439
- var getResolver = /* @__PURE__ */ __name(() => {
440
- return {
441
- key: /* @__PURE__ */ __name(async (did, parsed, r, options) => {
442
- const contentType = options.accept || DID_LD_JSON;
443
- const response = {
444
- didResolutionMetadata: {
445
- contentType
446
- },
447
- didDocument: null,
448
- didDocumentMetadata: {}
449
- };
450
- try {
451
- const multicodecPubKey = base58btc.decode(parsed.id);
452
- const keyType = decode(multicodecPubKey);
453
- const pubKeyBytes = multicodecPubKey.slice(decode.bytes);
454
- const args = {
455
- pubKeyBytes,
456
- fingerprint: parsed.id,
457
- contentType,
458
- options
459
- };
460
- const doc = await prefixToDriverMap[keyType].keyToDidDoc(args);
461
- if (contentType === DID_LD_JSON) {
462
- if (!doc["@context"]) {
463
- doc["@context"] = "https://w3id.org/did/v1";
464
- } else if (Array.isArray(doc["@context"]) && !doc["@context"].includes("https://w3id.org/did/v1") && !doc["@context"].includes("https://www.w3.org/ns/did/v1")) {
465
- doc["@context"].push("https://w3id.org/did/v1");
466
- }
467
- response.didDocument = doc;
468
- } else if (contentType === DID_JSON) {
469
- response.didDocument = doc;
470
- } else {
471
- delete response.didResolutionMetadata.contentType;
472
- response.didResolutionMetadata.error = "representationNotSupported";
473
- }
474
- } catch (e) {
475
- response.didResolutionMetadata.error = "invalidDid";
476
- response.didResolutionMetadata.message = e.toString();
477
- }
478
- return response;
479
- }, "key")
480
- };
481
- }, "getResolver");
482
- var index_default = {
483
- getResolver
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.getResolver = void 0;
30
+ const varint_1 = require("varint");
31
+ const base58_1 = require("multiformats/bases/base58");
32
+ const ed25519_1 = __importDefault(require("./drivers/ed25519"));
33
+ const bls12381g2_1 = __importDefault(require("./drivers/bls12381g2"));
34
+ const secp256k1_1 = __importDefault(require("./drivers/secp256k1"));
35
+ const secp256r1_1 = __importDefault(require("./drivers/secp256r1"));
36
+ const secp384r1_1 = __importDefault(require("./drivers/secp384r1"));
37
+ const secp521r1_1 = __importDefault(require("./drivers/secp521r1"));
38
+ const jwk_jcs_1 = __importDefault(require("./drivers/jwk.jcs"));
39
+ const types_1 = require("./types");
40
+ __exportStar(require("./types"), exports);
41
+ const prefixToDriverMap = {
42
+ 0xe7: secp256k1_1.default,
43
+ 0xed: ed25519_1.default,
44
+ 0x1200: secp256r1_1.default,
45
+ 0x1201: secp384r1_1.default,
46
+ 0x1202: secp521r1_1.default,
47
+ 0xeb: bls12381g2_1.default,
48
+ 0xeb51: jwk_jcs_1.default,
484
49
  };
485
- export {
486
- DID_JSON,
487
- DID_LD_JSON,
488
- index_default as default,
489
- getResolver
50
+ const getResolver = () => {
51
+ return {
52
+ key: (did, parsed, r, options) => __awaiter(void 0, void 0, void 0, function* () {
53
+ const contentType = options.accept || types_1.DID_LD_JSON;
54
+ const response = {
55
+ didResolutionMetadata: { contentType },
56
+ didDocument: null,
57
+ didDocumentMetadata: {},
58
+ };
59
+ try {
60
+ const multicodecPubKey = base58_1.base58btc.decode(parsed.id);
61
+ const keyType = (0, varint_1.decode)(multicodecPubKey);
62
+ const pubKeyBytes = multicodecPubKey.slice(varint_1.decode.bytes);
63
+ const args = { pubKeyBytes, fingerprint: parsed.id, contentType, options };
64
+ const doc = yield prefixToDriverMap[keyType].keyToDidDoc(args);
65
+ if (contentType === types_1.DID_LD_JSON) {
66
+ if (!doc['@context']) {
67
+ doc['@context'] = 'https://w3id.org/did/v1';
68
+ }
69
+ else if (Array.isArray(doc['@context']) &&
70
+ !doc['@context'].includes('https://w3id.org/did/v1') &&
71
+ !doc['@context'].includes('https://www.w3.org/ns/did/v1')) {
72
+ doc['@context'].push('https://w3id.org/did/v1');
73
+ }
74
+ response.didDocument = doc;
75
+ }
76
+ else if (contentType === types_1.DID_JSON) {
77
+ response.didDocument = doc;
78
+ }
79
+ else {
80
+ delete response.didResolutionMetadata.contentType;
81
+ response.didResolutionMetadata.error = 'representationNotSupported';
82
+ }
83
+ }
84
+ catch (e) {
85
+ response.didResolutionMetadata.error = 'invalidDid';
86
+ response.didResolutionMetadata.message = e.toString();
87
+ }
88
+ return response;
89
+ }),
90
+ };
490
91
  };
92
+ exports.getResolver = getResolver;
93
+ exports.default = { getResolver: exports.getResolver };
491
94
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/drivers/ed25519.ts","../src/types.ts","../src/drivers/bls12381g2.ts","../src/drivers/secp256k1.ts","../src/drivers/secp256r1.ts","../src/drivers/secp384r1.ts","../src/drivers/secp521r1.ts","../src/drivers/jwk.jcs.ts"],"sourcesContent":["import { decode } from 'varint'\n// @ts-ignore\nimport { base58btc } from 'multiformats/bases/base58'\nimport ed25519 from './drivers/ed25519'\nimport bls12381g2 from './drivers/bls12381g2'\nimport secp256k1 from './drivers/secp256k1'\nimport secp256r1 from './drivers/secp256r1'\nimport secp384r1 from './drivers/secp384r1'\nimport secp521r1 from './drivers/secp521r1'\nimport { DIDResolutionResult, ParsedDID, Resolvable, ResolverRegistry } from 'did-resolver'\nimport jwkJcs from './drivers/jwk.jcs'\nimport { DID_JSON, DID_LD_JSON, DIDKeyResolutionOptions, KeyToDidDocArgs } from './types'\n\nexport * from './types'\n\nconst prefixToDriverMap: any = {\n 0xe7: secp256k1,\n 0xed: ed25519,\n 0x1200: secp256r1,\n 0x1201: secp384r1,\n 0x1202: secp521r1,\n 0xeb: bls12381g2,\n 0xeb51: jwkJcs,\n}\n\nexport const getResolver = (): ResolverRegistry => {\n return {\n key: async (did: string, parsed: ParsedDID, r: Resolvable, options: DIDKeyResolutionOptions) => {\n const contentType = options.accept || DID_LD_JSON\n const response: DIDResolutionResult = {\n didResolutionMetadata: { contentType },\n didDocument: null,\n didDocumentMetadata: {},\n }\n try {\n const multicodecPubKey = base58btc.decode(parsed.id)\n const keyType = decode(multicodecPubKey)\n const pubKeyBytes = multicodecPubKey.slice(decode.bytes)\n const args: KeyToDidDocArgs = { pubKeyBytes, fingerprint: parsed.id, contentType, options }\n const doc = await prefixToDriverMap[keyType].keyToDidDoc(args)\n if (contentType === DID_LD_JSON) {\n if (!doc['@context']) {\n doc['@context'] = 'https://w3id.org/did/v1'\n } else if (\n Array.isArray(doc['@context']) &&\n !doc['@context'].includes('https://w3id.org/did/v1') &&\n !doc['@context'].includes('https://www.w3.org/ns/did/v1')\n ) {\n doc['@context'].push('https://w3id.org/did/v1')\n }\n response.didDocument = doc\n } else if (contentType === DID_JSON) {\n response.didDocument = doc\n } else {\n delete response.didResolutionMetadata.contentType\n response.didResolutionMetadata.error = 'representationNotSupported'\n }\n } catch (e: any) {\n response.didResolutionMetadata.error = 'invalidDid'\n response.didResolutionMetadata.message = e.toString()\n }\n return response\n },\n }\n}\nexport default { getResolver }\n","\n// @ts-ignore\nimport { toString } from 'uint8arrays/to-string'\nimport { DIDDocument } from 'did-resolver'\n// import { edwardsToMontgomery } from '@noble/curves/ed25519'\nimport { convertPublicKeyToX25519 } from '@stablelib/ed25519'\nimport { DID_LD_JSON, KeyToDidDocArgs } from '../types'\n\nfunction encodeKey(key: Uint8Array, encodeKey?: number) {\n const bytes = new Uint8Array(key.length + 2)\n bytes[0] = encodeKey ?? 0xec\n // The multicodec is encoded as a varint so we need to add this.\n // See js-multicodec for a general implementation\n bytes[1] = 0x01\n bytes.set(key, 2)\n return `z${toString(bytes, 'base58btc')}`\n}\n\nexport const keyToDidDoc = (args: KeyToDidDocArgs) => {\n const { options } = args\n if (!options?.publicKeyFormat) {\n return keyToDidDoc2020(args)\n }\n switch (options.publicKeyFormat) {\n case 'Ed25519VerificationKey2018':\n case 'X25519KeyAgreementKey2019':\n return keyToDidDoc2018_2019(args)\n case 'Ed25519VerificationKey2020':\n case 'X25519KeyAgreementKey2020':\n case 'Multikey':\n return keyToDidDoc2020(args)\n default:\n throw Error(`${options.publicKeyFormat} not supported yet for the ed25519 driver`)\n }\n}\nconst keyToDidDoc2018_2019 = ({ pubKeyBytes, fingerprint, contentType }: KeyToDidDocArgs): DIDDocument => {\n const did = `did:key:${fingerprint}`\n const keyId = `${did}#${fingerprint}`\n\n //todo: Move to noble lib. x25519 values differ between below methods. Current implementation is correct according to DID:key spec\n // const pubKeyHex = toString(pubKeyBytes, 'base16')\n // const x25519PubBytes = edwardsToMontgomery(pubKeyHex)\n const x25519PubBytes = convertPublicKeyToX25519(pubKeyBytes)\n\n const x25519KeyId = `${did}#${encodeKey(x25519PubBytes)}`\n return {\n ...(contentType === DID_LD_JSON && {\n '@context': [\n 'https://www.w3.org/ns/did/v1',\n 'https://w3id.org/security/suites/ed25519-2018/v1',\n 'https://w3id.org/security/suites/x25519-2019/v1',\n ],\n }),\n id: did,\n verificationMethod: [\n {\n id: keyId,\n type: 'Ed25519VerificationKey2018',\n controller: did,\n publicKeyBase58: toString(pubKeyBytes, 'base58btc'),\n },\n {\n id: x25519KeyId,\n type: 'X25519KeyAgreementKey2019',\n controller: did,\n publicKeyBase58: toString(x25519PubBytes, 'base58btc'),\n },\n ],\n authentication: [keyId],\n assertionMethod: [keyId],\n capabilityDelegation: [keyId],\n capabilityInvocation: [keyId],\n keyAgreement: [x25519KeyId],\n }\n}\n\nconst keyToDidDoc2020 = ({ pubKeyBytes, fingerprint, contentType }: KeyToDidDocArgs): DIDDocument => {\n const did = `did:key:${fingerprint}`\n const keyId = `${did}#${fingerprint}`\n //todo: Move to noble lib. x25519 values differ between below methods. Current implementation is correct according to DID:key spec\n // const pubKeyHex = u8a.toString(pubKeyBytes, 'base16')\n // const x25519PubBytes = edwardsToMontgomery(pubKeyBytes)\n const x25519PubBytes = convertPublicKeyToX25519(pubKeyBytes)\n\n const x25519KeyId = `${did}#${encodeKey(x25519PubBytes)}`\n return {\n ...(contentType === DID_LD_JSON && {\n '@context': [\n 'https://www.w3.org/ns/did/v1',\n 'https://w3id.org/security/suites/ed25519-2020/v1',\n 'https://w3id.org/security/suites/x25519-2020/v1',\n ],\n }),\n id: did,\n verificationMethod: [\n {\n id: keyId,\n type: 'Ed25519VerificationKey2020',\n controller: did,\n publicKeyMultibase: encodeKey(pubKeyBytes, 0xed),\n },\n ],\n authentication: [keyId],\n assertionMethod: [keyId],\n capabilityDelegation: [keyId],\n capabilityInvocation: [keyId],\n keyAgreement: [\n {\n id: x25519KeyId,\n type: 'X25519KeyAgreementKey2020',\n controller: did,\n publicKeyMultibase: encodeKey(x25519PubBytes, 0xec),\n },\n ],\n }\n}\nexport default { keyToDidDoc }\n","import { DIDResolutionOptions } from 'did-resolver'\n\nexport const DID_LD_JSON = 'application/did+ld+json'\nexport const DID_JSON = 'application/did+json'\n\nexport type PublicKeyFormat =\n | 'JsonWebKey2020'\n | 'Ed25519VerificationKey2018'\n | 'X25519KeyAgreementKey2019'\n | 'Ed25519VerificationKey2020'\n | 'X25519KeyAgreementKey2020'\n | 'Multikey'\nexport interface KeyToDidDocArgs {\n pubKeyBytes: Uint8Array\n fingerprint: string\n contentType?: string\n options?: DIDKeyResolutionOptions\n}\n\nexport interface DIDKeyResolutionOptions extends DIDResolutionOptions {\n publicKeyFormat?: PublicKeyFormat\n}\n","import { DIDDocument } from 'did-resolver'\n// @ts-ignore\nimport { toString } from 'uint8arrays/to-string'\nimport { KeyToDidDocArgs } from '../index'\n\nexport const keyToDidDoc = ({ pubKeyBytes, fingerprint }: KeyToDidDocArgs): DIDDocument => {\n const did = `did:key:${fingerprint}`\n const keyId = `${did}#${fingerprint}`\n return {\n id: did,\n verificationMethod: [\n {\n id: keyId,\n type: 'Bls12381G2Key2020',\n controller: did,\n publicKeyBase58: toString(pubKeyBytes, 'base58btc'),\n },\n ],\n authentication: [keyId],\n assertionMethod: [keyId],\n capabilityDelegation: [keyId],\n capabilityInvocation: [keyId],\n }\n}\nexport default { keyToDidDoc }\n","// @ts-ignore\nimport { toString } from 'uint8arrays/to-string'\nimport { DIDDocument } from 'did-resolver'\nimport { KeyToDidDocArgs } from '../types'\n\nexport const keyToDidDoc = ({ pubKeyBytes, fingerprint }: KeyToDidDocArgs): DIDDocument => {\n const did = `did:key:${fingerprint}`\n const keyId = `${did}#${fingerprint}`\n return {\n id: did,\n verificationMethod: [\n {\n id: keyId,\n type: 'Secp256k1VerificationKey2018',\n controller: did,\n publicKeyBase58: toString(pubKeyBytes, 'base58btc'),\n },\n ],\n authentication: [keyId],\n assertionMethod: [keyId],\n capabilityDelegation: [keyId],\n capabilityInvocation: [keyId],\n }\n}\n\nexport default { keyToDidDoc }\n","// Brent Shambaugh <brent.shambaugh@gmail.com>. 2021.\n\nimport * as nist_weierstrauss from 'nist-weierstrauss'\nimport {base64urlPoint} from 'nist-weierstrauss'\n// @ts-ignore\nimport {fromString} from 'uint8arrays/from-string'\nimport {KeyToDidDocArgs} from '../types'\n\n/**\n * Constructs the document based on the method key\n */\nexport function keyToDidDoc({ pubKeyBytes, fingerprint }: KeyToDidDocArgs): any {\n const did = `did:key:${fingerprint}`\n const keyId = `${did}#${fingerprint}`\n const key = pubKeyBytesToXY(pubKeyBytes)\n return {\n id: did,\n verificationMethod: [\n {\n id: keyId,\n type: 'JsonWebKey2020',\n controller: did,\n publicKeyJwk: {\n kty: 'EC',\n crv: 'P-256',\n x: key.xm,\n y: key.ym,\n },\n },\n ],\n authentication: [keyId],\n assertionMethod: [keyId],\n capabilityDelegation: [keyId],\n capabilityInvocation: [keyId],\n }\n}\n\n/**\n *\n * @param pubKeyBytes - public key as uncompressed byte array with no prefix (raw key),\n * uncompressed with 0x04 prefix, or compressed with 0x02 prefix if even and 0x03 prefix if odd.\n * @returns point x,y with coordinates as multibase encoded base64urls\n *\n * See the the did:key specification: https://w3c-ccg.github.io/did-method-key/#p-256.\n * At present only raw p-256 keys are covered in the specification.\n * @throws TypeError: input cannot be null or undefined.\n * @throws Error: Unexpected pubKeyBytes\n * @internal\n */\nexport function pubKeyBytesToXY(pubKeyBytes: Uint8Array): base64urlPoint {\n if (!nist_weierstrauss.nist_weierstrauss_common.testUint8Array(pubKeyBytes)) {\n throw new TypeError('input must be a Uint8Array')\n }\n const publicKeyHex = nist_weierstrauss.nist_weierstrauss_common.pubKeyBytesToHex(pubKeyBytes)\n const bytesCount = publicKeyHex.length / 2\n\n // raw p-256 key\n if (bytesCount == 64) {\n return nist_weierstrauss.nist_weierstrauss_common.publicKeyToXY(publicKeyHex)\n }\n\n // uncompressed p-256 key, SEC format\n if (bytesCount == 65) {\n if (publicKeyHex.slice(0, 2) == '04') {\n const publicKey = publicKeyHex.slice(2)\n return nist_weierstrauss.nist_weierstrauss_common.publicKeyToXY(publicKey)\n }\n }\n\n // compressed p-256 key, SEC format\n if (bytesCount == 33) {\n if (publicKeyHex.slice(0, 2) == '03' || publicKeyHex.slice(0, 2) == '02') {\n const publicKey = fromString(publicKeyHex, 'base16')\n const point = nist_weierstrauss.secp256r1.ECPointDecompress(publicKey)\n return nist_weierstrauss.nist_weierstrauss_common.publicKeyIntToXY(point)\n }\n }\n\n throw new Error('Unexpected pubKeyBytes')\n}\n\nexport default { keyToDidDoc }\n","// Brent Shambaugh <brent.shambaugh@gmail.com>. 2021.\n\n// @ts-ignore\nimport { fromString } from 'uint8arrays/from-string'\n\nimport * as nist_weierstrauss from 'nist-weierstrauss'\nimport { base64urlPoint } from 'nist-weierstrauss'\nimport { KeyToDidDocArgs } from '../types'\n\n/**\n * Constructs the document based on the method key\n */\nexport function keyToDidDoc({ pubKeyBytes, fingerprint }: KeyToDidDocArgs): any {\n const did = `did:key:${fingerprint}`\n const keyId = `${did}#${fingerprint}`\n const key = pubKeyBytesToXY(pubKeyBytes)\n return {\n id: did,\n verificationMethod: [\n {\n id: keyId,\n type: 'JsonWebKey2020',\n controller: did,\n publicKeyJwk: {\n kty: 'EC',\n crv: 'P-384',\n x: key.xm,\n y: key.ym,\n },\n },\n ],\n authentication: [keyId],\n assertionMethod: [keyId],\n capabilityDelegation: [keyId],\n capabilityInvocation: [keyId],\n }\n}\n\n/**\n *\n * @param pubKeyBytes - public key as uncompressed byte array with no prefix (raw key),\n * uncompressed with 0x04 prefix, or compressed with 0x02 prefix if even and 0x03 prefix if odd.\n * @returns point x,y with coordinates as multibase encoded base64urls\n *\n * See the the did:key specification: https://w3c-ccg.github.io/did-method-key/#p-384.\n * At present only raw p-384 keys are covered in the specification.\n * @throws TypeError: input cannot be null or undefined.\n * @throws Error: Unexpected pubKeyBytes\n * @internal\n */\nexport function pubKeyBytesToXY(pubKeyBytes: Uint8Array): base64urlPoint {\n if (!nist_weierstrauss.nist_weierstrauss_common.testUint8Array(pubKeyBytes)) {\n throw new TypeError('input must be a Uint8Array')\n }\n const publicKeyHex = nist_weierstrauss.nist_weierstrauss_common.pubKeyBytesToHex(pubKeyBytes)\n const bytesCount = publicKeyHex.length / 2\n\n // raw p-384 key\n if (bytesCount == 96) {\n return nist_weierstrauss.nist_weierstrauss_common.publicKeyToXY(publicKeyHex)\n }\n\n // uncompressed p-384 key, SEC format\n if (bytesCount == 97) {\n if (publicKeyHex.slice(0, 2) == '04') {\n const publicKey = publicKeyHex.slice(2)\n return nist_weierstrauss.nist_weierstrauss_common.publicKeyToXY(publicKey)\n }\n }\n\n // compressed p-384 key, SEC format\n if (bytesCount == 49) {\n if (publicKeyHex.slice(0, 2) == '03' || publicKeyHex.slice(0, 2) == '02') {\n const publicKey = fromString(publicKeyHex, 'base16')\n const point = nist_weierstrauss.secp384r1.ECPointDecompress(publicKey)\n return nist_weierstrauss.nist_weierstrauss_common.publicKeyIntToXY(point)\n }\n }\n\n throw new Error('Unexpected pubKeyBytes')\n}\n\nexport default { keyToDidDoc }\n","// Brent Shambaugh <brent.shambaugh@gmail.com>. 2021.\n\n// @ts-ignore\nimport { fromString } from 'uint8arrays/from-string'\n\nimport * as nist_weierstrauss from 'nist-weierstrauss'\nimport { base64urlPoint } from 'nist-weierstrauss'\nimport { KeyToDidDocArgs } from '../types'\n\n/**\n * Constructs the document based on the method key\n */\nexport function keyToDidDoc({ pubKeyBytes, fingerprint }: KeyToDidDocArgs): any {\n const did = `did:key:${fingerprint}`\n const keyId = `${did}#${fingerprint}`\n const key = pubKeyBytesToXY(pubKeyBytes)\n return {\n id: did,\n verificationMethod: [\n {\n id: keyId,\n type: 'JsonWebKey2020',\n controller: did,\n publicKeyJwk: {\n kty: 'EC',\n crv: 'P-521',\n x: key.xm,\n y: key.ym,\n },\n },\n ],\n authentication: [keyId],\n assertionMethod: [keyId],\n capabilityDelegation: [keyId],\n capabilityInvocation: [keyId],\n }\n}\n\n/**\n *\n * @param pubKeyBytes - public key as compressed with 0x02 prefix if even and 0x03 prefix if odd.\n * @returns point x,y with coordinates as multibase encoded base64urls\n *\n * See the the did:key specification: https://w3c-ccg.github.io/did-method-key/#p-521.\n * For compression see: https://tools.ietf.org/id/draft-jivsov-ecc-compact-05.html#rfc.section.3\n * @throws TypeError: input cannot be null or undefined.\n * @throws Error: Unexpected pubKeyBytes\n * @internal\n */\nexport function pubKeyBytesToXY(pubKeyBytes: Uint8Array): base64urlPoint {\n if (!nist_weierstrauss.nist_weierstrauss_common.testUint8Array(pubKeyBytes)) {\n throw new TypeError('input must be a Uint8Array')\n }\n const publicKeyHex = nist_weierstrauss.nist_weierstrauss_common.pubKeyBytesToHex(pubKeyBytes)\n\n // compressed p-521 key, SEC format\n // publicKeyHex.length / 2.0 = 67.0 bytes\n if (132 <= publicKeyHex.length && publicKeyHex.length <= 134) {\n if (publicKeyHex.slice(0, 2) == '03' || publicKeyHex.slice(0, 2) == '02') {\n const publicKey = fromString(publicKeyHex, 'base16')\n const point = nist_weierstrauss.secp521r1.ECPointDecompress(publicKey)\n return nist_weierstrauss.nist_weierstrauss_common.publicKeyIntToXY(point)\n }\n }\n\n throw new Error('Unexpected pubKeyBytes')\n}\n\nexport default { keyToDidDoc }\n","import { DIDDocument, JsonWebKey as DIFJWK } from 'did-resolver'\nimport { DID_LD_JSON, KeyToDidDocArgs } from '../index'\nimport { jwkJcsDecode } from '@sphereon/ssi-sdk-ext.key-utils'\n\nexport const keyToDidDoc = ({ pubKeyBytes, fingerprint, contentType }: KeyToDidDocArgs): DIDDocument => {\n const did = `did:key:${fingerprint}`\n const keyId = `${did}#${fingerprint}`\n const publicKeyJwk = jwkJcsDecode(pubKeyBytes) as DIFJWK\n return {\n ...(contentType === DID_LD_JSON && {\n '@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/jws-2020/v1'],\n }),\n id: did,\n verificationMethod: [\n {\n id: keyId,\n type: 'JsonWebKey2020',\n controller: did,\n publicKeyJwk,\n },\n ],\n authentication: [keyId],\n assertionMethod: [keyId],\n capabilityDelegation: [keyId],\n capabilityInvocation: [keyId],\n }\n}\nex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AAEO,IAAMC,cAAc,6BAAA;AACzB,SAAO;IACLC,KAAK,8BAAOC,KAAaC,QAAmBC,GAAeC,YAAAA;AACzD,YAAMC,cAAcD,QAAQE,UAAUC;AACtC,YAAMC,WAAgC;QACpCC,uBAAuB;UAAEJ;QAAY;QACrCK,aAAa;QACbC,qBAAqB,CAAC;MACxB;AACA,UAAI;AACF,cAAMC,mBAAmBC,UAAUC,OAAOZ,OAAOa,EAAE;AACnD,cAAMC,UAAUF,OAAOF,gBAAAA;AACvB,cAAMK,cAAcL,iBAAiBM,MAAMJ,OAAOK,KAAK;AACvD,cAAMC,OAAwB;UAAEH;UAAaI,aAAanB,OAAOa;UAAIV;UAAaD;QAAQ;AAC1F,cAAMkB,MAAM,MAAM/B,kBAAkByB,OAAAA,EAASO,YAAYH,IAAAA;AACzD,YAAIf,gBAAgBE,aAAa;AAC/B,cAAI,CAACe,IAAI,UAAA,GAAa;AACpBA,gBAAI,UAAA,IAAc;UACpB,WACEE,MAAMC,QAAQH,IAAI,UAAA,CAAW,KAC7B,CAACA,IAAI,UAAA,EAAYI,SAAS,yBAAA,KAC1B,CAACJ,IAAI,UAAA,EAAYI,SAAS,8BAAA,GAC1B;AACAJ,gBAAI,UAAA,EAAYK,KAAK,yBAAA;UACvB;AACAnB,mBAASE,cAAcY;QACzB,WAAWjB,gBAAgBuB,UAAU;AACnCpB,mBAASE,cAAcY;QACzB,OAAO;AACL,iBAAOd,SAASC,sBAAsBJ;AACtCG,mBAASC,sBAAsBoB,QAAQ;QACzC;MACF,SAASC,GAAQ;AACftB,iBAASC,sBAAsBoB,QAAQ;AACvCrB,iBAASC,sBAAsBsB,UAAUD,EAAEE,SAAQ;MACrD;AACA,aAAOxB;IACT,GAnCK;EAoCP;AACF,GAvC2B;AAwC3B,IAAA,gBAAe;EAAET;AAAY;","names":["decode","base58btc","toString","convertPublicKeyToX25519","DID_LD_JSON","DID_JSON","encodeKey","key","bytes","Uint8Array","length","set","toString","keyToDidDoc","args","options","publicKeyFormat","keyToDidDoc2020","keyToDidDoc2018_2019","Error","pubKeyBytes","fingerprint","contentType","did","keyId","x25519PubBytes","convertPublicKeyToX25519","x25519KeyId","DID_LD_JSON","id","verificationMethod","type","controller","publicKeyBase58","authentication","assertionMethod","capabilityDelegation","capabilityInvocation","keyAgreement","publicKeyMultibase","toString","keyToDidDoc","pubKeyBytes","fingerprint","did","keyId","id","verificationMethod","type","controller","publicKeyBase58","toString","authentication","assertionMethod","capabilityDelegation","capabilityInvocation","toString","keyToDidDoc","pubKeyBytes","fingerprint","did","keyId","id","verificationMethod","type","controller","publicKeyBase58","toString","authentication","assertionMethod","capabilityDelegation","capabilityInvocation","nist_weierstrauss","fromString","keyToDidDoc","pubKeyBytes","fingerprint","did","keyId","key","pubKeyBytesToXY","id","verificationMethod","type","controller","publicKeyJwk","kty","crv","x","xm","y","ym","authentication","assertionMethod","capabilityDelegation","capabilityInvocation","nist_weierstrauss_common","testUint8Array","TypeError","publicKeyHex","pubKeyBytesToHex","bytesCount","length","publicKeyToXY","slice","publicKey","fromString","point","secp256r1","ECPointDecompress","publicKeyIntToXY","Error","fromString","nist_weierstrauss","keyToDidDoc","pubKeyBytes","fingerprint","did","keyId","key","pubKeyBytesToXY","id","verificationMethod","type","controller","publicKeyJwk","kty","crv","x","xm","y","ym","authentication","assertionMethod","capabilityDelegation","capabilityInvocation","nist_weierstrauss_common","testUint8Array","TypeError","publicKeyHex","pubKeyBytesToHex","bytesCount","length","publicKeyToXY","slice","publicKey","fromString","point","secp384r1","ECPointDecompress","publicKeyIntToXY","Error","fromString","nist_weierstrauss","keyToDidDoc","pubKeyBytes","fingerprint","did","keyId","key","pubKeyBytesToXY","id","verificationMethod","type","controller","publicKeyJwk","kty","crv","x","xm","y","ym","authentication","assertionMethod","capabilityDelegation","capabilityInvocation","nist_weierstrauss_common","testUint8Array","TypeError","publicKeyHex","pubKeyBytesToHex","length","slice","publicKey","fromString","point","secp521r1","ECPointDecompress","publicKeyIntToXY","Error","jwkJcsDecode","keyToDidDoc","pubKeyBytes","fingerprint","contentType","did","keyId","publicKeyJwk","jwkJcsDecode","DID_LD_JSON","id","verificationMethod","type","controller","authentication","assertionMethod","capabilityDelegation","capabilityInvocation","prefixToDriverMap","secp256k1","ed25519","secp256r1","secp384r1","secp521r1","bls12381g2","jwkJcs","getResolver","key","did","parsed","r","options","contentType","accept","DID_LD_JSON","response","didResolutionMetadata","didDocument","didDocumentMetadata","multicodecPubKey","base58btc","decode","id","keyType","pubKeyBytes","slice","bytes","args","fingerprint","doc","keyToDidDoc","Array","isArray","includes","push","DID_JSON","error","e","message","toString"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAA+B;AAC/B,sDAAqD;AACrD,gEAAuC;AACvC,sEAA6C;AAC7C,oEAA2C;AAC3C,oEAA2C;AAC3C,oEAA2C;AAC3C,oEAA2C;AAE3C,gEAAsC;AACtC,mCAAyF;AAEzF,0CAAuB;AAEvB,MAAM,iBAAiB,GAAQ;IAC7B,IAAI,EAAE,mBAAS;IACf,IAAI,EAAE,iBAAO;IACb,MAAM,EAAE,mBAAS;IACjB,MAAM,EAAE,mBAAS;IACjB,MAAM,EAAE,mBAAS;IACjB,IAAI,EAAE,oBAAU;IAChB,MAAM,EAAE,iBAAM;CACf,CAAA;AAEM,MAAM,WAAW,GAAG,GAAqB,EAAE;IAChD,OAAO;QACL,GAAG,EAAE,CAAO,GAAW,EAAE,MAAiB,EAAE,CAAa,EAAE,OAAgC,EAAE,EAAE;YAC7F,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,IAAI,mBAAW,CAAA;YACjD,MAAM,QAAQ,GAAwB;gBACpC,qBAAqB,EAAE,EAAE,WAAW,EAAE;gBACtC,WAAW,EAAE,IAAI;gBACjB,mBAAmB,EAAE,EAAE;aACxB,CAAA;YACD,IAAI,CAAC;gBACH,MAAM,gBAAgB,GAAG,kBAAS,CAAC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AqB,CAAC,KAAK,GAAG,YAAY,CAAA;gBACnD,QAAQ,CAAC,qBAAqB,CAAC,OAAO,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAA;YACvD,CAAC;YACD,OAAO,QAAQ,CAAA;QACjB,CAAC,CAAA;KACF,CAAA;AACH,CAAC,CAAA;AAvCY,QAAA,WAAW,eAuCvB;AACD,kBAAe,EAAE,WAAW,EAAX,mBAAW,EAAE,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { DIDResolutionOptions } from 'did-resolver';
2
+ export declare const DID_LD_JSON = "application/did+ld+json";
3
+ export declare const DID_JSON = "application/did+json";
4
+ export type PublicKeyFormat = 'JsonWebKey2020' | 'Ed25519VerificationKey2018' | 'X25519KeyAgreementKey2019' | 'Ed25519VerificationKey2020' | 'X25519KeyAgreementKey2020' | 'Multikey';
5
+ export interface KeyToDidDocArgs {
6
+ pubKeyBytes: Uint8Array;
7
+ fingerprint: string;
8
+ contentType?: string;
9
+ options?: DIDKeyResolutionOptions;
10
+ }
11
+ export interface DIDKeyResolutionOptions extends DIDResolutionOptions {
12
+ publicKeyFormat?: PublicKeyFormat;
13
+ }
14
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAEnD,eAAO,MAAM,WAAW,4BAA4B,CAAA;AACpD,eAAO,MAAM,QAAQ,yBAAyB,CAAA;AAE9C,MAAM,MAAM,eAAe,GACvB,gBAAgB,GAChB,4BAA4B,GAC5B,2BAA2B,GAC3B,4BAA4B,GAC5B,2BAA2B,GAC3B,UAAU,CAAA;AACd,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,UAAU,CAAA;IACvB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,uBAAuB,CAAA;CAClC;AAED,MAAM,WAAW,uBAAwB,SAAQ,oBAAoB;IACnE,eAAe,CAAC,EAAE,eAAe,CAAA;CAClC"}