@sphereon/ssi-sdk.credential-vcdm-jsonld-provider 0.33.1-feature.jose.vcdm.59

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 (61) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +287 -0
  3. package/dist/index.cjs +3147 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +222 -0
  6. package/dist/index.d.ts +222 -0
  7. package/dist/index.js +3117 -0
  8. package/dist/index.js.map +1 -0
  9. package/package.json +122 -0
  10. package/plugin.schema.json +12425 -0
  11. package/src/__tests__/context.loader.test.ts +41 -0
  12. package/src/__tests__/diwala.test.ts +129 -0
  13. package/src/__tests__/fixtures/diwala.ts +43 -0
  14. package/src/__tests__/issue-verify-flow-statuslist.test.ts +94 -0
  15. package/src/__tests__/issue-verify-flow-vcdm2.test.ts +268 -0
  16. package/src/__tests__/issue-verify-flow.test.ts +306 -0
  17. package/src/__tests__/localAgent.test.ts +36 -0
  18. package/src/__tests__/mocks.ts +473 -0
  19. package/src/__tests__/restAgent.test.ts +58 -0
  20. package/src/__tests__/shared/vcHandlerLocalAgentLogic.ts +160 -0
  21. package/src/agent/CredentialProviderJsonld.ts +281 -0
  22. package/src/agent/index.ts +1 -0
  23. package/src/contexts/X25519KeyAgreementKey2019.json +26 -0
  24. package/src/contexts/bbs-bls-signature-2020-v1.json +129 -0
  25. package/src/contexts/citizenship-v1.json +54 -0
  26. package/src/contexts/did_v0.11.json +64 -0
  27. package/src/contexts/ed25519-signature-2018-v1.json +91 -0
  28. package/src/contexts/ed25519-signature-2020-v1.json +77 -0
  29. package/src/contexts/eip712.json +93 -0
  30. package/src/contexts/json-web-signature-2020-v1.json +71 -0
  31. package/src/contexts/kyc-v1.json +8 -0
  32. package/src/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.json +21 -0
  33. package/src/contexts/odrl.json +199 -0
  34. package/src/contexts/profile-v1.json +8 -0
  35. package/src/contexts/socialmedia-v1.json +7 -0
  36. package/src/contexts/transmute_v1.json +21 -0
  37. package/src/contexts/vc-revocation-list-2020-v1.json +46 -0
  38. package/src/contexts/vc-status-list-2021-v1.json +48 -0
  39. package/src/contexts/veramo.io_contexts_profile_v1.json +8 -0
  40. package/src/contexts/w3id.org_security_suites_ed25519-2018_v1.json +63 -0
  41. package/src/contexts/w3id.org_security_suites_secp256k1recovery-2020_v2.json +87 -0
  42. package/src/contexts/w3id.org_security_suites_x25519-2019_v1.json +26 -0
  43. package/src/contexts/w3id.org_security_v1.json +50 -0
  44. package/src/contexts/w3id.org_security_v2.json +63 -0
  45. package/src/contexts/w3id.org_security_v3-unstable.json +722 -0
  46. package/src/contexts/www.w3.org_2018_credentials_v1.json +237 -0
  47. package/src/contexts/www.w3.org_ns_credentials_v2.json +331 -0
  48. package/src/contexts/www.w3.org_ns_did_v1.json +58 -0
  49. package/src/enums.ts +28 -0
  50. package/src/index.ts +12 -0
  51. package/src/ld-context-loader.ts +32 -0
  52. package/src/ld-credential-module.ts +281 -0
  53. package/src/ld-default-contexts.ts +49 -0
  54. package/src/ld-document-loader.ts +156 -0
  55. package/src/ld-suite-loader.ts +83 -0
  56. package/src/ld-suites.ts +41 -0
  57. package/src/modules.d.ts +13 -0
  58. package/src/suites/EcdsaSecp256k1RecoverySignature2020.ts +100 -0
  59. package/src/suites/Ed25519Signature2018.ts +109 -0
  60. package/src/suites/Ed25519Signature2020.ts +93 -0
  61. package/src/suites/index.ts +3 -0
package/dist/index.js ADDED
@@ -0,0 +1,3117 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
+ var __commonJS = (cb, mod) => function __require() {
5
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
6
+ };
7
+
8
+ // src/contexts/www.w3.org_2018_credentials_v1.json
9
+ var require_www_w3_org_2018_credentials_v1 = __commonJS({
10
+ "src/contexts/www.w3.org_2018_credentials_v1.json"(exports, module) {
11
+ module.exports = {
12
+ "@context": {
13
+ "@version": 1.1,
14
+ "@protected": true,
15
+ id: "@id",
16
+ type: "@type",
17
+ VerifiableCredential: {
18
+ "@id": "https://www.w3.org/2018/credentials#VerifiableCredential",
19
+ "@context": {
20
+ "@version": 1.1,
21
+ "@protected": true,
22
+ id: "@id",
23
+ type: "@type",
24
+ cred: "https://www.w3.org/2018/credentials#",
25
+ sec: "https://w3id.org/security#",
26
+ xsd: "http://www.w3.org/2001/XMLSchema#",
27
+ credentialSchema: {
28
+ "@id": "cred:credentialSchema",
29
+ "@type": "@id",
30
+ "@context": {
31
+ "@version": 1.1,
32
+ "@protected": true,
33
+ id: "@id",
34
+ type: "@type",
35
+ cred: "https://www.w3.org/2018/credentials#",
36
+ JsonSchemaValidator2018: "cred:JsonSchemaValidator2018"
37
+ }
38
+ },
39
+ credentialStatus: { "@id": "cred:credentialStatus", "@type": "@id" },
40
+ credentialSubject: { "@id": "cred:credentialSubject", "@type": "@id" },
41
+ evidence: { "@id": "cred:evidence", "@type": "@id" },
42
+ expirationDate: { "@id": "cred:expirationDate", "@type": "xsd:dateTime" },
43
+ holder: { "@id": "cred:holder", "@type": "@id" },
44
+ issued: { "@id": "cred:issued", "@type": "xsd:dateTime" },
45
+ issuer: { "@id": "cred:issuer", "@type": "@id" },
46
+ issuanceDate: { "@id": "cred:issuanceDate", "@type": "xsd:dateTime" },
47
+ proof: { "@id": "sec:proof", "@type": "@id", "@container": "@graph" },
48
+ refreshService: {
49
+ "@id": "cred:refreshService",
50
+ "@type": "@id",
51
+ "@context": {
52
+ "@version": 1.1,
53
+ "@protected": true,
54
+ id: "@id",
55
+ type: "@type",
56
+ cred: "https://www.w3.org/2018/credentials#",
57
+ ManualRefreshService2018: "cred:ManualRefreshService2018"
58
+ }
59
+ },
60
+ termsOfUse: { "@id": "cred:termsOfUse", "@type": "@id" },
61
+ validFrom: { "@id": "cred:validFrom", "@type": "xsd:dateTime" },
62
+ validUntil: { "@id": "cred:validUntil", "@type": "xsd:dateTime" }
63
+ }
64
+ },
65
+ VerifiablePresentation: {
66
+ "@id": "https://www.w3.org/2018/credentials#VerifiablePresentation",
67
+ "@context": {
68
+ "@version": 1.1,
69
+ "@protected": true,
70
+ id: "@id",
71
+ type: "@type",
72
+ cred: "https://www.w3.org/2018/credentials#",
73
+ sec: "https://w3id.org/security#",
74
+ holder: { "@id": "cred:holder", "@type": "@id" },
75
+ proof: { "@id": "sec:proof", "@type": "@id", "@container": "@graph" },
76
+ verifiableCredential: { "@id": "cred:verifiableCredential", "@type": "@id", "@container": "@graph" }
77
+ }
78
+ },
79
+ EcdsaSecp256k1Signature2019: {
80
+ "@id": "https://w3id.org/security#EcdsaSecp256k1Signature2019",
81
+ "@context": {
82
+ "@version": 1.1,
83
+ "@protected": true,
84
+ id: "@id",
85
+ type: "@type",
86
+ sec: "https://w3id.org/security#",
87
+ xsd: "http://www.w3.org/2001/XMLSchema#",
88
+ challenge: "sec:challenge",
89
+ created: { "@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime" },
90
+ domain: "sec:domain",
91
+ expires: { "@id": "sec:expiration", "@type": "xsd:dateTime" },
92
+ jws: "sec:jws",
93
+ nonce: "sec:nonce",
94
+ proofPurpose: {
95
+ "@id": "sec:proofPurpose",
96
+ "@type": "@vocab",
97
+ "@context": {
98
+ "@version": 1.1,
99
+ "@protected": true,
100
+ id: "@id",
101
+ type: "@type",
102
+ sec: "https://w3id.org/security#",
103
+ assertionMethod: { "@id": "sec:assertionMethod", "@type": "@id", "@container": "@set" },
104
+ authentication: { "@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set" }
105
+ }
106
+ },
107
+ proofValue: "sec:proofValue",
108
+ verificationMethod: { "@id": "sec:verificationMethod", "@type": "@id" }
109
+ }
110
+ },
111
+ EcdsaSecp256r1Signature2019: {
112
+ "@id": "https://w3id.org/security#EcdsaSecp256r1Signature2019",
113
+ "@context": {
114
+ "@version": 1.1,
115
+ "@protected": true,
116
+ id: "@id",
117
+ type: "@type",
118
+ sec: "https://w3id.org/security#",
119
+ xsd: "http://www.w3.org/2001/XMLSchema#",
120
+ challenge: "sec:challenge",
121
+ created: { "@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime" },
122
+ domain: "sec:domain",
123
+ expires: { "@id": "sec:expiration", "@type": "xsd:dateTime" },
124
+ jws: "sec:jws",
125
+ nonce: "sec:nonce",
126
+ proofPurpose: {
127
+ "@id": "sec:proofPurpose",
128
+ "@type": "@vocab",
129
+ "@context": {
130
+ "@version": 1.1,
131
+ "@protected": true,
132
+ id: "@id",
133
+ type: "@type",
134
+ sec: "https://w3id.org/security#",
135
+ assertionMethod: { "@id": "sec:assertionMethod", "@type": "@id", "@container": "@set" },
136
+ authentication: { "@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set" }
137
+ }
138
+ },
139
+ proofValue: "sec:proofValue",
140
+ verificationMethod: { "@id": "sec:verificationMethod", "@type": "@id" }
141
+ }
142
+ },
143
+ Ed25519Signature2018: {
144
+ "@id": "https://w3id.org/security#Ed25519Signature2018",
145
+ "@context": {
146
+ "@version": 1.1,
147
+ "@protected": true,
148
+ id: "@id",
149
+ type: "@type",
150
+ sec: "https://w3id.org/security#",
151
+ xsd: "http://www.w3.org/2001/XMLSchema#",
152
+ challenge: "sec:challenge",
153
+ created: { "@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime" },
154
+ domain: "sec:domain",
155
+ expires: { "@id": "sec:expiration", "@type": "xsd:dateTime" },
156
+ jws: "sec:jws",
157
+ nonce: "sec:nonce",
158
+ proofPurpose: {
159
+ "@id": "sec:proofPurpose",
160
+ "@type": "@vocab",
161
+ "@context": {
162
+ "@version": 1.1,
163
+ "@protected": true,
164
+ id: "@id",
165
+ type: "@type",
166
+ sec: "https://w3id.org/security#",
167
+ assertionMethod: { "@id": "sec:assertionMethod", "@type": "@id", "@container": "@set" },
168
+ authentication: { "@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set" }
169
+ }
170
+ },
171
+ proofValue: "sec:proofValue",
172
+ verificationMethod: { "@id": "sec:verificationMethod", "@type": "@id" }
173
+ }
174
+ },
175
+ RsaSignature2018: {
176
+ "@id": "https://w3id.org/security#RsaSignature2018",
177
+ "@context": {
178
+ "@version": 1.1,
179
+ "@protected": true,
180
+ challenge: "sec:challenge",
181
+ created: { "@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime" },
182
+ domain: "sec:domain",
183
+ expires: { "@id": "sec:expiration", "@type": "xsd:dateTime" },
184
+ jws: "sec:jws",
185
+ nonce: "sec:nonce",
186
+ proofPurpose: {
187
+ "@id": "sec:proofPurpose",
188
+ "@type": "@vocab",
189
+ "@context": {
190
+ "@version": 1.1,
191
+ "@protected": true,
192
+ id: "@id",
193
+ type: "@type",
194
+ sec: "https://w3id.org/security#",
195
+ assertionMethod: { "@id": "sec:assertionMethod", "@type": "@id", "@container": "@set" },
196
+ authentication: { "@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set" }
197
+ }
198
+ },
199
+ proofValue: "sec:proofValue",
200
+ verificationMethod: { "@id": "sec:verificationMethod", "@type": "@id" }
201
+ }
202
+ },
203
+ proof: { "@id": "https://w3id.org/security#proof", "@type": "@id", "@container": "@graph" }
204
+ }
205
+ };
206
+ }
207
+ });
208
+
209
+ // src/contexts/www.w3.org_ns_credentials_v2.json
210
+ var require_www_w3_org_ns_credentials_v2 = __commonJS({
211
+ "src/contexts/www.w3.org_ns_credentials_v2.json"(exports, module) {
212
+ module.exports = {
213
+ "@context": {
214
+ "@protected": true,
215
+ id: "@id",
216
+ type: "@type",
217
+ description: "https://schema.org/description",
218
+ digestMultibase: {
219
+ "@id": "https://w3id.org/security#digestMultibase",
220
+ "@type": "https://w3id.org/security#multibase"
221
+ },
222
+ digestSRI: {
223
+ "@id": "https://www.w3.org/2018/credentials#digestSRI",
224
+ "@type": "https://www.w3.org/2018/credentials#sriString"
225
+ },
226
+ mediaType: {
227
+ "@id": "https://schema.org/encodingFormat"
228
+ },
229
+ name: "https://schema.org/name",
230
+ VerifiableCredential: {
231
+ "@id": "https://www.w3.org/2018/credentials#VerifiableCredential",
232
+ "@context": {
233
+ "@protected": true,
234
+ id: "@id",
235
+ type: "@type",
236
+ confidenceMethod: {
237
+ "@id": "https://www.w3.org/2018/credentials#confidenceMethod",
238
+ "@type": "@id"
239
+ },
240
+ credentialSchema: {
241
+ "@id": "https://www.w3.org/2018/credentials#credentialSchema",
242
+ "@type": "@id"
243
+ },
244
+ credentialStatus: {
245
+ "@id": "https://www.w3.org/2018/credentials#credentialStatus",
246
+ "@type": "@id"
247
+ },
248
+ credentialSubject: {
249
+ "@id": "https://www.w3.org/2018/credentials#credentialSubject",
250
+ "@type": "@id"
251
+ },
252
+ description: "https://schema.org/description",
253
+ evidence: {
254
+ "@id": "https://www.w3.org/2018/credentials#evidence",
255
+ "@type": "@id"
256
+ },
257
+ issuer: {
258
+ "@id": "https://www.w3.org/2018/credentials#issuer",
259
+ "@type": "@id"
260
+ },
261
+ name: "https://schema.org/name",
262
+ proof: {
263
+ "@id": "https://w3id.org/security#proof",
264
+ "@type": "@id",
265
+ "@container": "@graph"
266
+ },
267
+ refreshService: {
268
+ "@id": "https://www.w3.org/2018/credentials#refreshService",
269
+ "@type": "@id"
270
+ },
271
+ relatedResource: {
272
+ "@id": "https://www.w3.org/2018/credentials#relatedResource",
273
+ "@type": "@id"
274
+ },
275
+ renderMethod: {
276
+ "@id": "https://www.w3.org/2018/credentials#renderMethod",
277
+ "@type": "@id"
278
+ },
279
+ termsOfUse: {
280
+ "@id": "https://www.w3.org/2018/credentials#termsOfUse",
281
+ "@type": "@id"
282
+ },
283
+ validFrom: {
284
+ "@id": "https://www.w3.org/2018/credentials#validFrom",
285
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
286
+ },
287
+ validUntil: {
288
+ "@id": "https://www.w3.org/2018/credentials#validUntil",
289
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
290
+ }
291
+ }
292
+ },
293
+ EnvelopedVerifiableCredential: "https://www.w3.org/2018/credentials#EnvelopedVerifiableCredential",
294
+ VerifiablePresentation: {
295
+ "@id": "https://www.w3.org/2018/credentials#VerifiablePresentation",
296
+ "@context": {
297
+ "@protected": true,
298
+ id: "@id",
299
+ type: "@type",
300
+ holder: {
301
+ "@id": "https://www.w3.org/2018/credentials#holder",
302
+ "@type": "@id"
303
+ },
304
+ proof: {
305
+ "@id": "https://w3id.org/security#proof",
306
+ "@type": "@id",
307
+ "@container": "@graph"
308
+ },
309
+ termsOfUse: {
310
+ "@id": "https://www.w3.org/2018/credentials#termsOfUse",
311
+ "@type": "@id"
312
+ },
313
+ verifiableCredential: {
314
+ "@id": "https://www.w3.org/2018/credentials#verifiableCredential",
315
+ "@type": "@id",
316
+ "@container": "@graph",
317
+ "@context": null
318
+ }
319
+ }
320
+ },
321
+ EnvelopedVerifiablePresentation: "https://www.w3.org/2018/credentials#EnvelopedVerifiablePresentation",
322
+ JsonSchemaCredential: "https://www.w3.org/2018/credentials#JsonSchemaCredential",
323
+ JsonSchema: {
324
+ "@id": "https://www.w3.org/2018/credentials#JsonSchema",
325
+ "@context": {
326
+ "@protected": true,
327
+ id: "@id",
328
+ type: "@type",
329
+ jsonSchema: {
330
+ "@id": "https://www.w3.org/2018/credentials#jsonSchema",
331
+ "@type": "@json"
332
+ }
333
+ }
334
+ },
335
+ BitstringStatusListCredential: "https://www.w3.org/ns/credentials/status#BitstringStatusListCredential",
336
+ BitstringStatusList: {
337
+ "@id": "https://www.w3.org/ns/credentials/status#BitstringStatusList",
338
+ "@context": {
339
+ "@protected": true,
340
+ id: "@id",
341
+ type: "@type",
342
+ encodedList: {
343
+ "@id": "https://www.w3.org/ns/credentials/status#encodedList",
344
+ "@type": "https://w3id.org/security#multibase"
345
+ },
346
+ statusPurpose: "https://www.w3.org/ns/credentials/status#statusPurpose",
347
+ ttl: "https://www.w3.org/ns/credentials/status#ttl"
348
+ }
349
+ },
350
+ BitstringStatusListEntry: {
351
+ "@id": "https://www.w3.org/ns/credentials/status#BitstringStatusListEntry",
352
+ "@context": {
353
+ "@protected": true,
354
+ id: "@id",
355
+ type: "@type",
356
+ statusListCredential: {
357
+ "@id": "https://www.w3.org/ns/credentials/status#statusListCredential",
358
+ "@type": "@id"
359
+ },
360
+ statusListIndex: "https://www.w3.org/ns/credentials/status#statusListIndex",
361
+ statusPurpose: "https://www.w3.org/ns/credentials/status#statusPurpose",
362
+ statusMessage: {
363
+ "@id": "https://www.w3.org/ns/credentials/status#statusMessage",
364
+ "@context": {
365
+ "@protected": true,
366
+ id: "@id",
367
+ type: "@type",
368
+ message: "https://www.w3.org/ns/credentials/status#message",
369
+ status: "https://www.w3.org/ns/credentials/status#status"
370
+ }
371
+ },
372
+ statusReference: {
373
+ "@id": "https://www.w3.org/ns/credentials/status#statusReference",
374
+ "@type": "@id"
375
+ },
376
+ statusSize: {
377
+ "@id": "https://www.w3.org/ns/credentials/status#statusSize",
378
+ "@type": "https://www.w3.org/2001/XMLSchema#integer"
379
+ }
380
+ }
381
+ },
382
+ DataIntegrityProof: {
383
+ "@id": "https://w3id.org/security#DataIntegrityProof",
384
+ "@context": {
385
+ "@protected": true,
386
+ id: "@id",
387
+ type: "@type",
388
+ challenge: "https://w3id.org/security#challenge",
389
+ created: {
390
+ "@id": "http://purl.org/dc/terms/created",
391
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
392
+ },
393
+ cryptosuite: {
394
+ "@id": "https://w3id.org/security#cryptosuite",
395
+ "@type": "https://w3id.org/security#cryptosuiteString"
396
+ },
397
+ domain: "https://w3id.org/security#domain",
398
+ expires: {
399
+ "@id": "https://w3id.org/security#expiration",
400
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
401
+ },
402
+ nonce: "https://w3id.org/security#nonce",
403
+ previousProof: {
404
+ "@id": "https://w3id.org/security#previousProof",
405
+ "@type": "@id"
406
+ },
407
+ proofPurpose: {
408
+ "@id": "https://w3id.org/security#proofPurpose",
409
+ "@type": "@vocab",
410
+ "@context": {
411
+ "@protected": true,
412
+ id: "@id",
413
+ type: "@type",
414
+ assertionMethod: {
415
+ "@id": "https://w3id.org/security#assertionMethod",
416
+ "@type": "@id",
417
+ "@container": "@set"
418
+ },
419
+ authentication: {
420
+ "@id": "https://w3id.org/security#authenticationMethod",
421
+ "@type": "@id",
422
+ "@container": "@set"
423
+ },
424
+ capabilityDelegation: {
425
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
426
+ "@type": "@id",
427
+ "@container": "@set"
428
+ },
429
+ capabilityInvocation: {
430
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
431
+ "@type": "@id",
432
+ "@container": "@set"
433
+ },
434
+ keyAgreement: {
435
+ "@id": "https://w3id.org/security#keyAgreementMethod",
436
+ "@type": "@id",
437
+ "@container": "@set"
438
+ }
439
+ }
440
+ },
441
+ proofValue: {
442
+ "@id": "https://w3id.org/security#proofValue",
443
+ "@type": "https://w3id.org/security#multibase"
444
+ },
445
+ verificationMethod: {
446
+ "@id": "https://w3id.org/security#verificationMethod",
447
+ "@type": "@id"
448
+ }
449
+ }
450
+ },
451
+ "...": {
452
+ "@id": "https://www.iana.org/assignments/jwt#..."
453
+ },
454
+ _sd: {
455
+ "@id": "https://www.iana.org/assignments/jwt#_sd",
456
+ "@type": "@json"
457
+ },
458
+ _sd_alg: {
459
+ "@id": "https://www.iana.org/assignments/jwt#_sd_alg"
460
+ },
461
+ aud: {
462
+ "@id": "https://www.iana.org/assignments/jwt#aud",
463
+ "@type": "@id"
464
+ },
465
+ cnf: {
466
+ "@id": "https://www.iana.org/assignments/jwt#cnf",
467
+ "@context": {
468
+ "@protected": true,
469
+ kid: {
470
+ "@id": "https://www.iana.org/assignments/jwt#kid",
471
+ "@type": "@id"
472
+ },
473
+ jwk: {
474
+ "@id": "https://www.iana.org/assignments/jwt#jwk",
475
+ "@type": "@json"
476
+ }
477
+ }
478
+ },
479
+ exp: {
480
+ "@id": "https://www.iana.org/assignments/jwt#exp",
481
+ "@type": "https://www.w3.org/2001/XMLSchema#nonNegativeInteger"
482
+ },
483
+ iat: {
484
+ "@id": "https://www.iana.org/assignments/jwt#iat",
485
+ "@type": "https://www.w3.org/2001/XMLSchema#nonNegativeInteger"
486
+ },
487
+ iss: {
488
+ "@id": "https://www.iana.org/assignments/jose#iss",
489
+ "@type": "@id"
490
+ },
491
+ jku: {
492
+ "@id": "https://www.iana.org/assignments/jose#jku",
493
+ "@type": "@id"
494
+ },
495
+ kid: {
496
+ "@id": "https://www.iana.org/assignments/jose#kid",
497
+ "@type": "@id"
498
+ },
499
+ nbf: {
500
+ "@id": "https://www.iana.org/assignments/jwt#nbf",
501
+ "@type": "https://www.w3.org/2001/XMLSchema#nonNegativeInteger"
502
+ },
503
+ sub: {
504
+ "@id": "https://www.iana.org/assignments/jose#sub",
505
+ "@type": "@id"
506
+ },
507
+ x5u: {
508
+ "@id": "https://www.iana.org/assignments/jose#x5u",
509
+ "@type": "@id"
510
+ }
511
+ }
512
+ };
513
+ }
514
+ });
515
+
516
+ // src/suites/Ed25519Signature2018.ts
517
+ import { Ed25519Signature2018 } from "@digitalbazaar/ed25519-signature-2018";
518
+ import { asArray } from "@veramo/utils";
519
+ import suiteContext2018 from "ed25519-signature-2018-context";
520
+ import * as u8a from "uint8arrays";
521
+ import { Ed25519VerificationKey2018 } from "@digitalbazaar/ed25519-verification-key-2018";
522
+
523
+ // src/ld-suites.ts
524
+ var SphereonLdSignature = class {
525
+ static {
526
+ __name(this, "SphereonLdSignature");
527
+ }
528
+ preSigningPresModification(presentation) {
529
+ const sanitizedPresentation = presentation;
530
+ if (sanitizedPresentation?.verifier?.length == 0) {
531
+ delete sanitizedPresentation.verifier;
532
+ }
533
+ }
534
+ };
535
+
536
+ // src/suites/Ed25519Signature2018.ts
537
+ import { base64ToBytes, bytesToBase64 } from "@sphereon/ssi-sdk.core";
538
+ var SphereonEd25519Signature2018 = class extends SphereonLdSignature {
539
+ static {
540
+ __name(this, "SphereonEd25519Signature2018");
541
+ }
542
+ constructor() {
543
+ super();
544
+ suiteContext2018?.constants;
545
+ }
546
+ getSupportedVerificationType() {
547
+ return "Ed25519VerificationKey2018";
548
+ }
549
+ getSupportedProofType() {
550
+ return "Ed25519Signature2018";
551
+ }
552
+ getSupportedKeyType() {
553
+ return "Ed25519";
554
+ }
555
+ getContext() {
556
+ return "https://w3id.org/security/suites/ed25519-2018/v1";
557
+ }
558
+ getSuiteForSigning(key, issuerDid, verificationMethodId, context) {
559
+ const controller = issuerDid;
560
+ const id = verificationMethodId;
561
+ const signer = {
562
+ // returns a JWS detached
563
+ sign: /* @__PURE__ */ __name(async (args) => {
564
+ const messageString = bytesToBase64(args.data);
565
+ const signature = await context.agent.keyManagerSign({
566
+ keyRef: key.kid,
567
+ algorithm: "EdDSA",
568
+ data: messageString,
569
+ encoding: "base64"
570
+ });
571
+ return base64ToBytes(signature);
572
+ }, "sign")
573
+ };
574
+ const options = {
575
+ id,
576
+ controller,
577
+ publicKeyBase58: u8a.toString(u8a.fromString(key.publicKeyHex, "base16"), "base58btc"),
578
+ signer,
579
+ type: this.getSupportedVerificationType()
580
+ };
581
+ const verificationKey = new Ed25519VerificationKey2018(options);
582
+ verificationKey.signer = () => signer;
583
+ return new Ed25519Signature2018({
584
+ key: verificationKey,
585
+ signer
586
+ });
587
+ }
588
+ preVerificationCredModification(credential) {
589
+ const vcJson = JSON.stringify(credential);
590
+ if (vcJson.indexOf("Ed25519Signature2018 DISABLED") > -1) {
591
+ if (vcJson.indexOf(this.getContext()) === -1) {
592
+ credential["@context"] = [
593
+ ...asArray(credential["@context"] || []),
594
+ this.getContext()
595
+ ];
596
+ }
597
+ const v1Idx = vcJson.indexOf("https://w3id.org/security/v1");
598
+ if (v1Idx > -1 && Array.isArray(credential["@context"])) {
599
+ delete credential["@context"][v1Idx];
600
+ }
601
+ const v3Idx = vcJson.indexOf("https://w3id.org/security/v3-unstable");
602
+ if (v3Idx === -1 && Array.isArray(credential["@context"])) {
603
+ credential["@context"].push("https://w3id.org/security/v3-unstable");
604
+ }
605
+ }
606
+ }
607
+ getSuiteForVerification() {
608
+ return new Ed25519Signature2018();
609
+ }
610
+ // preSigningCredModification(credential: CredentialPayload): void {
611
+ preSigningCredModification() {
612
+ }
613
+ // preDidResolutionModification(didUrl: string, didDoc: DIDDocument): void {
614
+ preDidResolutionModification(didUrl, didDoc) {
615
+ }
616
+ };
617
+
618
+ // src/suites/Ed25519Signature2020.ts
619
+ import { Ed25519Signature2020 } from "@digitalcredentials/ed25519-signature-2020";
620
+ import { Ed25519VerificationKey2020 } from "@digitalcredentials/ed25519-verification-key-2020";
621
+ import { base64ToBytes as base64ToBytes2, bytesToBase64 as bytesToBase642, hexToMultibase } from "@sphereon/ssi-sdk.core";
622
+ import suiteContext2020 from "ed25519-signature-2020-context";
623
+ var SphereonEd25519Signature2020 = class extends SphereonLdSignature {
624
+ static {
625
+ __name(this, "SphereonEd25519Signature2020");
626
+ }
627
+ constructor() {
628
+ super();
629
+ suiteContext2020?.constants;
630
+ }
631
+ getSupportedVerificationType() {
632
+ return [
633
+ "Ed25519VerificationKey2020",
634
+ "Ed25519VerificationKey2018"
635
+ ];
636
+ }
637
+ getSupportedProofType() {
638
+ return "Ed25519Signature2020";
639
+ }
640
+ getSupportedKeyType() {
641
+ return "Ed25519";
642
+ }
643
+ getContext() {
644
+ return "https://w3id.org/security/suites/ed25519-2020/v1";
645
+ }
646
+ getSuiteForSigning(key, issuerDid, verificationMethodId, context) {
647
+ const controller = issuerDid;
648
+ const id = verificationMethodId;
649
+ const signer = {
650
+ // returns a JWS detached
651
+ sign: /* @__PURE__ */ __name(async (args) => {
652
+ const messageString = bytesToBase642(args.data);
653
+ const signature = await context.agent.keyManagerSign({
654
+ keyRef: key.kid,
655
+ algorithm: "EdDSA",
656
+ data: messageString,
657
+ encoding: "base64"
658
+ });
659
+ return base64ToBytes2(signature);
660
+ }, "sign")
661
+ };
662
+ const options = {
663
+ id,
664
+ controller,
665
+ publicKeyMultibase: hexToMultibase(key.publicKeyHex, key.type).value,
666
+ signer: /* @__PURE__ */ __name(() => signer, "signer"),
667
+ type: this.getSupportedVerificationType()
668
+ };
669
+ const verificationKey = new Ed25519VerificationKey2020(options);
670
+ verificationKey.signer = () => signer;
671
+ return new Ed25519Signature2020({
672
+ key: verificationKey,
673
+ signer
674
+ });
675
+ }
676
+ preVerificationCredModification(credential) {
677
+ }
678
+ getSuiteForVerification() {
679
+ return new Ed25519Signature2020();
680
+ }
681
+ // preSigningCredModification(_credential: CredentialPayload): void {}
682
+ preSigningCredModification() {
683
+ }
684
+ // preDidResolutionModification(_didUrl: string, _didDoc: DIDDocument): void {
685
+ preDidResolutionModification() {
686
+ }
687
+ };
688
+
689
+ // src/suites/EcdsaSecp256k1RecoverySignature2020.ts
690
+ import { asArray as asArray2, encodeJoseBlob } from "@veramo/utils";
691
+ import ldsEcdsa from "@veramo-community/lds-ecdsa-secp256k1-recovery2020";
692
+ import { concat as concatArrays } from "uint8arrays/concat";
693
+ import { fromString as fromString2 } from "uint8arrays/from-string";
694
+ var { EcdsaSecp256k1RecoveryMethod2020, EcdsaSecp256k1RecoverySignature2020 } = ldsEcdsa;
695
+ var SphereonEcdsaSecp256k1RecoverySignature2020 = class extends SphereonLdSignature {
696
+ static {
697
+ __name(this, "SphereonEcdsaSecp256k1RecoverySignature2020");
698
+ }
699
+ getSupportedVerificationType() {
700
+ return "EcdsaSecp256k1RecoveryMethod2020";
701
+ }
702
+ getSupportedProofType() {
703
+ return "EcdsaSecp256k1RecoverySignature2020";
704
+ }
705
+ getSupportedKeyType() {
706
+ return "Secp256k1";
707
+ }
708
+ getSuiteForSigning(key, did, verifiableMethodId, context) {
709
+ const controller = did;
710
+ const signer = {
711
+ //returns a JWS detached
712
+ sign: /* @__PURE__ */ __name(async (args) => {
713
+ const header = {
714
+ alg: "ES256K-R",
715
+ b64: false,
716
+ crit: [
717
+ "b64"
718
+ ]
719
+ };
720
+ const headerString = encodeJoseBlob(header);
721
+ const messageBuffer = concatArrays([
722
+ fromString2(`${headerString}.`, "utf-8"),
723
+ args.data
724
+ ]);
725
+ const signature = await context.agent.keyManagerSign({
726
+ keyRef: key.kid,
727
+ algorithm: "ES256K-R",
728
+ data: messageBuffer,
729
+ encoding: "base64"
730
+ });
731
+ return `${headerString}..${signature}`;
732
+ }, "sign")
733
+ };
734
+ const suite = new EcdsaSecp256k1RecoverySignature2020({
735
+ // signer,
736
+ key: new EcdsaSecp256k1RecoveryMethod2020({
737
+ publicKeyHex: key.publicKeyHex,
738
+ signer: /* @__PURE__ */ __name(() => signer, "signer"),
739
+ type: this.getSupportedVerificationType(),
740
+ controller,
741
+ id: verifiableMethodId
742
+ })
743
+ });
744
+ suite.ensureSuiteContext = ({ document }) => {
745
+ document["@context"] = [
746
+ ...asArray2(document["@context"] || []),
747
+ this.getContext()
748
+ ];
749
+ };
750
+ return suite;
751
+ }
752
+ getSuiteForVerification() {
753
+ return new EcdsaSecp256k1RecoverySignature2020();
754
+ }
755
+ preVerificationCredModification() {
756
+ }
757
+ preSigningCredModification(credential) {
758
+ credential["@context"] = [
759
+ ...asArray2(credential["@context"] || []),
760
+ "https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld"
761
+ ];
762
+ }
763
+ preDidResolutionModification(didUrl, didDoc) {
764
+ const idx = didDoc["@context"]?.indexOf("https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld") || -1;
765
+ if (Array.isArray(didDoc["@context"]) && idx !== -1) {
766
+ didDoc["@context"][idx] = this.getContext();
767
+ }
768
+ if (didUrl.toLowerCase().startsWith("did:ethr")) {
769
+ didDoc.verificationMethod?.forEach((x) => {
770
+ if (x.blockchainAccountId) {
771
+ x.ethereumAddress = x.blockchainAccountId.substring(0, x.blockchainAccountId.lastIndexOf("@"));
772
+ }
773
+ });
774
+ }
775
+ }
776
+ getContext() {
777
+ return "https://w3id.org/security/suites/secp256k1recovery-2020/v2";
778
+ }
779
+ };
780
+
781
+ // src/ld-credential-module.ts
782
+ import sigpkg3 from "@digitalcredentials/jsonld-signatures";
783
+ import * as vc2 from "@digitalcredentials/vc";
784
+ import { contextHasPlugin } from "@sphereon/ssi-sdk.agent-config";
785
+ import Debug2 from "debug";
786
+
787
+ // src/ld-document-loader.ts
788
+ import sigpkg from "@digitalcredentials/jsonld-signatures";
789
+ import * as vc from "@digitalcredentials/vc";
790
+ import { fetch } from "cross-fetch";
791
+ import Debug from "debug";
792
+ import { getAgentResolver } from "@sphereon/ssi-sdk-ext.did-utils";
793
+ var debug = Debug("sphereon:ssi-sdk:credential-jsonld");
794
+ var LdDocumentLoader = class {
795
+ static {
796
+ __name(this, "LdDocumentLoader");
797
+ }
798
+ ldContextLoader;
799
+ ldSuiteLoader;
800
+ localResolution;
801
+ uniresolverResolution;
802
+ resolverResolution;
803
+ constructor(options) {
804
+ this.ldContextLoader = options.ldContextLoader;
805
+ this.ldSuiteLoader = options.ldSuiteLoader;
806
+ this.localResolution = options?.documentLoader?.localResolution;
807
+ this.uniresolverResolution = options?.documentLoader?.uniresolverResolution;
808
+ this.resolverResolution = options?.documentLoader?.resolverResolution;
809
+ }
810
+ getLoader(context, { attemptToFetchContexts = false, verifiableData }) {
811
+ return sigpkg.extendContextLoader(async (url) => {
812
+ if (!url || url.trim().length === 0) {
813
+ throw Error("URL needs to be provided to load a context!");
814
+ }
815
+ if (url.startsWith("#") && verifiableData.issuer !== void 0) {
816
+ url = (typeof verifiableData.issuer === "string" ? verifiableData.issuer : verifiableData.issuer.id) + url;
817
+ debug(url);
818
+ }
819
+ if (url.toLowerCase().startsWith("did:")) {
820
+ const resolutionResult = await getAgentResolver(context, {
821
+ localResolution: this.localResolution,
822
+ resolverResolution: this.resolverResolution,
823
+ uniresolverResolution: this.uniresolverResolution
824
+ }).resolve(url);
825
+ let didDoc = resolutionResult.didDocument;
826
+ if (!didDoc) {
827
+ throw new Error(`Could not fetch DID document with url: ${url}. Did you enable the the driver?`);
828
+ }
829
+ this.ldSuiteLoader.getAllSignatureSuites().forEach((x) => x.preDidResolutionModification(url, didDoc));
830
+ if (didDoc.publicKey) {
831
+ if (!didDoc.verificationMethod) {
832
+ didDoc.verificationMethod = [];
833
+ }
834
+ didDoc.verificationMethod = [
835
+ ...didDoc.verificationMethod,
836
+ ...didDoc.publicKey
837
+ ];
838
+ if (didDoc.verificationMethod.length === 0) {
839
+ throw new Error(`No verification method available for ${url}`);
840
+ }
841
+ delete didDoc.publicKey;
842
+ }
843
+ const origUrl = url;
844
+ if (url.indexOf("#") > 0 && didDoc && typeof didDoc === "object" && "@context" in didDoc) {
845
+ const component = await context.agent.getDIDComponentById({
846
+ didDocument: didDoc,
847
+ didUrl: origUrl
848
+ });
849
+ debug("OYD DID component:");
850
+ debug(JSON.stringify(component));
851
+ if (component && typeof component !== "string" && component.id) {
852
+ const contexts = this.ldSuiteLoader.getAllSignatureSuites().filter((x) => x.getSupportedVerificationType() === component.type).filter((value, index, self) => self.indexOf(value) === index).map((value) => value.getContext());
853
+ const fragment = {
854
+ ...component,
855
+ ...Array.isArray(contexts) && contexts.length > 0 ? {
856
+ "@context": contexts
857
+ } : {
858
+ "@context": didDoc["@context"]
859
+ }
860
+ };
861
+ return {
862
+ contextUrl: null,
863
+ documentUrl: url,
864
+ document: fragment
865
+ };
866
+ }
867
+ }
868
+ return {
869
+ contextUrl: null,
870
+ documentUrl: url,
871
+ document: didDoc
872
+ };
873
+ }
874
+ if (this.ldContextLoader.has(url)) {
875
+ const contextDoc = await this.ldContextLoader.get(url);
876
+ return {
877
+ contextUrl: null,
878
+ documentUrl: url,
879
+ document: contextDoc
880
+ };
881
+ } else {
882
+ if (attemptToFetchContexts) {
883
+ debug("WARNING: attempting to fetch the doc directly for ", url);
884
+ try {
885
+ const response = await fetch(url, {
886
+ redirect: "follow"
887
+ });
888
+ if (response.status === 200) {
889
+ const document = await response.json();
890
+ if (url.startsWith("https://vc-api.sphereon.io/services/credentials/")) {
891
+ delete document._id;
892
+ }
893
+ return {
894
+ contextUrl: null,
895
+ documentUrl: url,
896
+ document
897
+ };
898
+ }
899
+ } catch (e) {
900
+ debug("WARNING: unable to fetch the doc or interpret it as JSON", e);
901
+ }
902
+ }
903
+ }
904
+ debug(`WARNING: Possible unknown context/identifier for ${url}
905
+ falling back to default documentLoader`);
906
+ return vc.defaultDocumentLoader(url);
907
+ });
908
+ }
909
+ };
910
+
911
+ // src/enums.ts
912
+ import sigpkg2 from "@digitalcredentials/jsonld-signatures";
913
+ var ProofPurpose = sigpkg2.purposes.ProofPurpose;
914
+ var ControllerProofPurpose = sigpkg2.purposes.ControllerProofPurpose;
915
+ var AssertionProofPurpose = sigpkg2.purposes.AssertionProofPurpose;
916
+ var AuthenticationProofPurpose = sigpkg2.purposes.AuthenticationProofPurpose;
917
+ var MethodNames = /* @__PURE__ */ function(MethodNames2) {
918
+ MethodNames2["createVerifiableCredential"] = "createVerifiableCredential";
919
+ MethodNames2["createVerifiablePresentation"] = "createVerifiablePresentation";
920
+ MethodNames2["verifyCredential"] = "verifyCredential";
921
+ MethodNames2["verifyPresentation"] = "verifyPresentation";
922
+ return MethodNames2;
923
+ }({});
924
+ var events = /* @__PURE__ */ function(events2) {
925
+ events2["CREDENTIAL_ISSUED"] = "credentialIssued";
926
+ events2["CREDENTIAL_VERIFIED"] = "credentialVerified";
927
+ events2["PRESENTATION_VERIFIED"] = "presentationVerified";
928
+ events2["PRESENTATION_VERIFY_FAILED"] = "presentationVerificationFailed";
929
+ events2["CREDENTIAL_VERIFY_FAILED"] = "credentialVerificationFailed";
930
+ return events2;
931
+ }({});
932
+
933
+ // src/ld-credential-module.ts
934
+ var { purposes } = sigpkg3;
935
+ var ProofPurpose2 = purposes.ProofPurpose;
936
+ var AssertionProofPurpose2 = purposes.AssertionProofPurpose;
937
+ var AuthenticationProofPurpose2 = purposes.AuthenticationProofPurpose;
938
+ var debug2 = Debug2("sphereon:ssi-sdk:ld-credential-module-local");
939
+ var LdCredentialModule = class {
940
+ static {
941
+ __name(this, "LdCredentialModule");
942
+ }
943
+ /**
944
+ * TODO: General Implementation Notes
945
+ * - (SOLVED) EcdsaSecp256k1Signature2019 (Signature) and EcdsaSecp256k1VerificationKey2019 (Key)
946
+ * are not useable right now, since they are not able to work with blockChainId and ECRecover.
947
+ * - DID Fragment Resolution.
948
+ * - Key Manager and Verification Methods: Veramo currently implements no link between those.
949
+ */
950
+ ldSuiteLoader;
951
+ ldDocumentLoader;
952
+ constructor(options) {
953
+ this.ldSuiteLoader = options.ldSuiteLoader;
954
+ this.ldDocumentLoader = new LdDocumentLoader(options);
955
+ }
956
+ async issueLDVerifiableCredential(args, context) {
957
+ const { key, issuerDid, verificationMethodId, credential } = args;
958
+ const purpose = args.purpose;
959
+ debug2(`Issue VC method called for ${key.kid}...`);
960
+ const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(key.type, key.meta?.verificationMethod?.type ?? "")[0];
961
+ const documentLoader = this.ldDocumentLoader.getLoader(context, {
962
+ attemptToFetchContexts: true,
963
+ verifiableData: credential
964
+ });
965
+ suite.preSigningCredModification(credential);
966
+ debug2(`Signing suite will be retrieved for ${verificationMethodId}...`);
967
+ const signingSuite = await suite.getSuiteForSigning(key, issuerDid, verificationMethodId, context);
968
+ debug2(`Issuer ${issuerDid} will create VC for ${key.kid}...`);
969
+ if (contextHasPlugin(context, "slAddStatusToCredential")) {
970
+ if (credential.credentialStatus && !credential.credentialStatus.statusListCredential) {
971
+ const credentialStatusVC = await context.agent.slAddStatusToCredential({
972
+ ...args.credentialStatusOpts,
973
+ credential
974
+ });
975
+ if (credentialStatusVC.credentialStatus) {
976
+ credential.credentialStatus = credentialStatusVC.credentialStatus;
977
+ }
978
+ }
979
+ }
980
+ let verifiableCredential;
981
+ if (key.type === "Bls12381G2") {
982
+ verifiableCredential = await sigpkg3.jsigs.sign(credential, {
983
+ suite: signingSuite,
984
+ purpose,
985
+ documentLoader,
986
+ compactProof: true
987
+ });
988
+ } else {
989
+ verifiableCredential = await vc2.issue({
990
+ credential,
991
+ purpose,
992
+ suite: signingSuite,
993
+ documentLoader,
994
+ compactProof: false
995
+ });
996
+ }
997
+ debug2(`Issuer ${issuerDid} created VC for ${key.kid}`);
998
+ return verifiableCredential;
999
+ }
1000
+ async signLDVerifiablePresentation(presentation, holderDid, key, verificationMethodId, challenge, domain, purpose = !challenge ? new AssertionProofPurpose2() : new AuthenticationProofPurpose2({
1001
+ domain,
1002
+ challenge
1003
+ }), context) {
1004
+ const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(key.type, key.meta?.verificationMethod?.type ?? "")[0];
1005
+ const documentLoader = this.ldDocumentLoader.getLoader(context, {
1006
+ attemptToFetchContexts: true,
1007
+ verifiableData: presentation
1008
+ });
1009
+ suite.preSigningPresModification(presentation);
1010
+ if (key.type === "Bls12381G2") {
1011
+ return await sigpkg3.jsigs.sign(presentation, {
1012
+ suite: await suite.getSuiteForSigning(key, holderDid, verificationMethodId, context),
1013
+ purpose,
1014
+ documentLoader,
1015
+ compactProof: true
1016
+ });
1017
+ }
1018
+ return await vc2.signPresentation({
1019
+ presentation,
1020
+ suite: await suite.getSuiteForSigning(key, holderDid, verificationMethodId, context),
1021
+ challenge,
1022
+ domain,
1023
+ documentLoader,
1024
+ purpose,
1025
+ compactProof: false
1026
+ });
1027
+ }
1028
+ async verifyCredential(credential, context, fetchRemoteContexts = false, purpose = new AssertionProofPurpose2(), checkStatus) {
1029
+ const verificationSuites = this.getAllVerificationSuites(context);
1030
+ this.ldSuiteLoader.getAllSignatureSuites().forEach((suite) => suite.preVerificationCredModification(credential));
1031
+ const documentLoader = this.ldDocumentLoader.getLoader(context, {
1032
+ attemptToFetchContexts: fetchRemoteContexts,
1033
+ verifiableData: credential
1034
+ });
1035
+ const result = await vc2.verifyCredential({
1036
+ credential,
1037
+ suite: verificationSuites,
1038
+ documentLoader,
1039
+ purpose,
1040
+ compactProof: false,
1041
+ checkStatus
1042
+ });
1043
+ if (result.verified) {
1044
+ void context.agent.emit(events.CREDENTIAL_VERIFIED, {
1045
+ credential,
1046
+ ...result
1047
+ });
1048
+ } else {
1049
+ debug2(`Error verifying LD Verifiable Credential: ${JSON.stringify(result, null, 2)}`);
1050
+ console.log(`ERROR verifying LD VC:
1051
+ ${JSON.stringify(result, null, 2)}`);
1052
+ void context.agent.emit(events.CREDENTIAL_VERIFY_FAILED, {
1053
+ credential,
1054
+ ...result
1055
+ });
1056
+ }
1057
+ return result;
1058
+ }
1059
+ getAllVerificationSuites(context) {
1060
+ return this.ldSuiteLoader.getAllSignatureSuites().map((x) => x.getSuiteForVerification(context));
1061
+ }
1062
+ async verifyPresentation(presentation, challenge, domain, context, fetchRemoteContexts = false, presentationPurpose = !challenge ? new AssertionProofPurpose2() : new AuthenticationProofPurpose2({
1063
+ domain,
1064
+ challenge
1065
+ }), checkStatus) {
1066
+ if (typeof presentation === "string") {
1067
+ return {
1068
+ verified: false,
1069
+ error: {
1070
+ message: "Cannot verify a jwt/string presentation with the jsonld verifier"
1071
+ }
1072
+ };
1073
+ }
1074
+ const result = await vc2.verify({
1075
+ presentation,
1076
+ suite: this.getAllVerificationSuites(context),
1077
+ documentLoader: this.ldDocumentLoader.getLoader(context, {
1078
+ attemptToFetchContexts: fetchRemoteContexts,
1079
+ verifiableData: presentation
1080
+ }),
1081
+ challenge,
1082
+ domain,
1083
+ presentationPurpose,
1084
+ compactProof: false,
1085
+ checkStatus
1086
+ });
1087
+ if (result.verified && (!result.presentationResult || result.presentationResult.verified)) {
1088
+ context.agent.emit(events.PRESENTATION_VERIFIED, {
1089
+ presentation,
1090
+ ...result
1091
+ });
1092
+ } else {
1093
+ debug2(`Error verifying LD Verifiable Presentation: ${JSON.stringify(result, null, 2)}`);
1094
+ context.agent.emit(events.PRESENTATION_VERIFY_FAILED, {
1095
+ presentation,
1096
+ ...result
1097
+ });
1098
+ }
1099
+ return result;
1100
+ }
1101
+ };
1102
+
1103
+ // src/ld-context-loader.ts
1104
+ import { isIterable } from "@veramo/utils";
1105
+ var LdContextLoader = class {
1106
+ static {
1107
+ __name(this, "LdContextLoader");
1108
+ }
1109
+ contexts;
1110
+ constructor(options) {
1111
+ this.contexts = {};
1112
+ Array.from(options.contextsPaths, (mapItem) => {
1113
+ const map = isIterable(mapItem) ? mapItem : Object.entries(mapItem);
1114
+ for (const [key, value] of map) {
1115
+ this.contexts[key] = value;
1116
+ }
1117
+ });
1118
+ }
1119
+ has(url) {
1120
+ return this.contexts[url] !== null && typeof this.contexts[url] !== "undefined";
1121
+ }
1122
+ async get(url) {
1123
+ return this.contexts[url];
1124
+ }
1125
+ };
1126
+
1127
+ // src/ld-suite-loader.ts
1128
+ import { asArray as asArray3 } from "@sphereon/ssi-sdk.core";
1129
+ var LdSuiteLoader = class {
1130
+ static {
1131
+ __name(this, "LdSuiteLoader");
1132
+ }
1133
+ constructor(options) {
1134
+ options.ldSignatureSuites.forEach((suite) => {
1135
+ const keyType = suite.getSupportedKeyType();
1136
+ let verifierMapping = this.signatureMap[keyType] ?? {};
1137
+ asArray3(suite.getSupportedVerificationType()).forEach((verificationType) => {
1138
+ verifierMapping[verificationType] = [
1139
+ ...verifierMapping[verificationType] ?? [],
1140
+ suite
1141
+ ];
1142
+ });
1143
+ return this.signatureMap[keyType] = {
1144
+ ...this.signatureMap[keyType],
1145
+ ...verifierMapping
1146
+ };
1147
+ });
1148
+ }
1149
+ signatureMap = {};
1150
+ getSignatureSuiteForKeyType(keyType, verificationType) {
1151
+ const verificationToSuites = this.signatureMap[keyType];
1152
+ const suites = verificationType && verificationType !== "" ? verificationToSuites?.[verificationType] : Object.values(verificationToSuites)?.[0];
1153
+ if (Array.isArray(suites) && suites.length > 0) {
1154
+ return suites;
1155
+ }
1156
+ throw new Error(`No Sphereon or Veramo LD Signature Suite for ${keyType} and verification type ${verificationType ?? "<none>"}. Available suites:
1157
+ ${Object.entries(this.signatureMap).map(([kt, record]) => `
1158
+ KeyType:${kt}
1159
+ => ${Object.entries(record).map(([verificationType2, suites2]) => `
1160
+ verification-type: ${verificationType2}
1161
+ => proof-types: ${suites2.map((suite) => suite.getSupportedProofType()).join(", ")}`).join(", ")}`).join(", ")}`);
1162
+ }
1163
+ getAllSignatureSuites() {
1164
+ return [
1165
+ ...new Set(Object.values(this.signatureMap).map((x) => Object.values(x)).flat(2))
1166
+ ];
1167
+ }
1168
+ getAllSignatureSuiteTypes() {
1169
+ return [
1170
+ ...new Set(Object.values(this.signatureMap).map((x) => Object.keys(x)).flat())
1171
+ ];
1172
+ }
1173
+ };
1174
+
1175
+ // src/contexts/bbs-bls-signature-2020-v1.json
1176
+ var bbs_bls_signature_2020_v1_default = {
1177
+ "@context": {
1178
+ "@version": 1.1,
1179
+ id: "@id",
1180
+ type: "@type",
1181
+ BbsBlsSignature2020: {
1182
+ "@id": "https://w3id.org/security#BbsBlsSignature2020",
1183
+ "@context": {
1184
+ "@version": 1.1,
1185
+ "@protected": true,
1186
+ id: "@id",
1187
+ type: "@type",
1188
+ challenge: "https://w3id.org/security#challenge",
1189
+ created: {
1190
+ "@id": "http://purl.org/dc/terms/created",
1191
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1192
+ },
1193
+ domain: "https://w3id.org/security#domain",
1194
+ proofValue: "https://w3id.org/security#proofValue",
1195
+ nonce: "https://w3id.org/security#nonce",
1196
+ proofPurpose: {
1197
+ "@id": "https://w3id.org/security#proofPurpose",
1198
+ "@type": "@vocab",
1199
+ "@context": {
1200
+ "@version": 1.1,
1201
+ "@protected": true,
1202
+ id: "@id",
1203
+ type: "@type",
1204
+ assertionMethod: {
1205
+ "@id": "https://w3id.org/security#assertionMethod",
1206
+ "@type": "@id",
1207
+ "@container": "@set"
1208
+ },
1209
+ authentication: {
1210
+ "@id": "https://w3id.org/security#authenticationMethod",
1211
+ "@type": "@id",
1212
+ "@container": "@set"
1213
+ }
1214
+ }
1215
+ },
1216
+ verificationMethod: {
1217
+ "@id": "https://w3id.org/security#verificationMethod",
1218
+ "@type": "@id"
1219
+ }
1220
+ }
1221
+ },
1222
+ BbsBlsSignatureProof2020: {
1223
+ "@id": "https://w3id.org/security#BbsBlsSignatureProof2020",
1224
+ "@context": {
1225
+ "@version": 1.1,
1226
+ "@protected": true,
1227
+ id: "@id",
1228
+ type: "@type",
1229
+ challenge: "https://w3id.org/security#challenge",
1230
+ created: {
1231
+ "@id": "http://purl.org/dc/terms/created",
1232
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1233
+ },
1234
+ domain: "https://w3id.org/security#domain",
1235
+ nonce: "https://w3id.org/security#nonce",
1236
+ proofPurpose: {
1237
+ "@id": "https://w3id.org/security#proofPurpose",
1238
+ "@type": "@vocab",
1239
+ "@context": {
1240
+ "@version": 1.1,
1241
+ "@protected": true,
1242
+ id: "@id",
1243
+ type: "@type",
1244
+ sec: "https://w3id.org/security#",
1245
+ assertionMethod: {
1246
+ "@id": "https://w3id.org/security#assertionMethod",
1247
+ "@type": "@id",
1248
+ "@container": "@set"
1249
+ },
1250
+ authentication: {
1251
+ "@id": "https://w3id.org/security#authenticationMethod",
1252
+ "@type": "@id",
1253
+ "@container": "@set"
1254
+ }
1255
+ }
1256
+ },
1257
+ proofValue: "https://w3id.org/security#proofValue",
1258
+ verificationMethod: {
1259
+ "@id": "https://w3id.org/security#verificationMethod",
1260
+ "@type": "@id"
1261
+ }
1262
+ }
1263
+ },
1264
+ Bls12381G1Key2020: {
1265
+ "@id": "https://w3id.org/security#Bls12381G1Key2020",
1266
+ "@context": {
1267
+ "@protected": true,
1268
+ id: "@id",
1269
+ type: "@type",
1270
+ controller: {
1271
+ "@id": "https://w3id.org/security#controller",
1272
+ "@type": "@id"
1273
+ },
1274
+ revoked: {
1275
+ "@id": "https://w3id.org/security#revoked",
1276
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1277
+ },
1278
+ publicKeyBase58: {
1279
+ "@id": "https://w3id.org/security#publicKeyBase58"
1280
+ }
1281
+ }
1282
+ },
1283
+ Bls12381G2Key2020: {
1284
+ "@id": "https://w3id.org/security#Bls12381G2Key2020",
1285
+ "@context": {
1286
+ "@protected": true,
1287
+ id: "@id",
1288
+ type: "@type",
1289
+ controller: {
1290
+ "@id": "https://w3id.org/security#controller",
1291
+ "@type": "@id"
1292
+ },
1293
+ revoked: {
1294
+ "@id": "https://w3id.org/security#revoked",
1295
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1296
+ },
1297
+ publicKeyBase58: {
1298
+ "@id": "https://w3id.org/security#publicKeyBase58"
1299
+ }
1300
+ }
1301
+ }
1302
+ }
1303
+ };
1304
+
1305
+ // src/contexts/www.w3.org_ns_did_v1.json
1306
+ var www_w3_org_ns_did_v1_default = {
1307
+ "@context": {
1308
+ "@protected": true,
1309
+ id: "@id",
1310
+ type: "@type",
1311
+ alsoKnownAs: {
1312
+ "@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs",
1313
+ "@type": "@id"
1314
+ },
1315
+ assertionMethod: {
1316
+ "@id": "https://w3id.org/security#assertionMethod",
1317
+ "@type": "@id",
1318
+ "@container": "@set"
1319
+ },
1320
+ authentication: {
1321
+ "@id": "https://w3id.org/security#authenticationMethod",
1322
+ "@type": "@id",
1323
+ "@container": "@set"
1324
+ },
1325
+ capabilityDelegation: {
1326
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
1327
+ "@type": "@id",
1328
+ "@container": "@set"
1329
+ },
1330
+ capabilityInvocation: {
1331
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
1332
+ "@type": "@id",
1333
+ "@container": "@set"
1334
+ },
1335
+ controller: {
1336
+ "@id": "https://w3id.org/security#controller",
1337
+ "@type": "@id"
1338
+ },
1339
+ keyAgreement: {
1340
+ "@id": "https://w3id.org/security#keyAgreementMethod",
1341
+ "@type": "@id",
1342
+ "@container": "@set"
1343
+ },
1344
+ service: {
1345
+ "@id": "https://www.w3.org/ns/did#service",
1346
+ "@type": "@id",
1347
+ "@context": {
1348
+ "@protected": true,
1349
+ id: "@id",
1350
+ type: "@type",
1351
+ serviceEndpoint: {
1352
+ "@id": "https://www.w3.org/ns/did#serviceEndpoint",
1353
+ "@type": "@id"
1354
+ }
1355
+ }
1356
+ },
1357
+ verificationMethod: {
1358
+ "@id": "https://w3id.org/security#verificationMethod",
1359
+ "@type": "@id"
1360
+ }
1361
+ }
1362
+ };
1363
+
1364
+ // src/contexts/w3id.org_security_v1.json
1365
+ var w3id_org_security_v1_default = {
1366
+ "@context": {
1367
+ id: "@id",
1368
+ type: "@type",
1369
+ dc: "http://purl.org/dc/terms/",
1370
+ sec: "https://w3id.org/security#",
1371
+ xsd: "http://www.w3.org/2001/XMLSchema#",
1372
+ EcdsaKoblitzSignature2016: "sec:EcdsaKoblitzSignature2016",
1373
+ Ed25519Signature2018: "sec:Ed25519Signature2018",
1374
+ EncryptedMessage: "sec:EncryptedMessage",
1375
+ GraphSignature2012: "sec:GraphSignature2012",
1376
+ LinkedDataSignature2015: "sec:LinkedDataSignature2015",
1377
+ LinkedDataSignature2016: "sec:LinkedDataSignature2016",
1378
+ CryptographicKey: "sec:Key",
1379
+ authenticationTag: "sec:authenticationTag",
1380
+ canonicalizationAlgorithm: "sec:canonicalizationAlgorithm",
1381
+ cipherAlgorithm: "sec:cipherAlgorithm",
1382
+ cipherData: "sec:cipherData",
1383
+ cipherKey: "sec:cipherKey",
1384
+ created: { "@id": "dc:created", "@type": "xsd:dateTime" },
1385
+ creator: { "@id": "dc:creator", "@type": "@id" },
1386
+ digestAlgorithm: "sec:digestAlgorithm",
1387
+ digestValue: "sec:digestValue",
1388
+ domain: "sec:domain",
1389
+ encryptionKey: "sec:encryptionKey",
1390
+ expiration: { "@id": "sec:expiration", "@type": "xsd:dateTime" },
1391
+ expires: { "@id": "sec:expiration", "@type": "xsd:dateTime" },
1392
+ initializationVector: "sec:initializationVector",
1393
+ iterationCount: "sec:iterationCount",
1394
+ nonce: "sec:nonce",
1395
+ normalizationAlgorithm: "sec:normalizationAlgorithm",
1396
+ owner: { "@id": "sec:owner", "@type": "@id" },
1397
+ password: "sec:password",
1398
+ privateKey: { "@id": "sec:privateKey", "@type": "@id" },
1399
+ privateKeyPem: "sec:privateKeyPem",
1400
+ publicKey: { "@id": "sec:publicKey", "@type": "@id" },
1401
+ publicKeyBase58: "sec:publicKeyBase58",
1402
+ publicKeyPem: "sec:publicKeyPem",
1403
+ publicKeyWif: "sec:publicKeyWif",
1404
+ publicKeyService: { "@id": "sec:publicKeyService", "@type": "@id" },
1405
+ revoked: { "@id": "sec:revoked", "@type": "xsd:dateTime" },
1406
+ salt: "sec:salt",
1407
+ signature: "sec:signature",
1408
+ signatureAlgorithm: "sec:signingAlgorithm",
1409
+ signatureValue: "sec:signatureValue"
1410
+ }
1411
+ };
1412
+
1413
+ // src/contexts/w3id.org_security_v2.json
1414
+ var w3id_org_security_v2_default = {
1415
+ "@context": [
1416
+ {
1417
+ "@version": 1.1
1418
+ },
1419
+ "https://w3id.org/security/v1",
1420
+ {
1421
+ AesKeyWrappingKey2019: "sec:AesKeyWrappingKey2019",
1422
+ DeleteKeyOperation: "sec:DeleteKeyOperation",
1423
+ DeriveSecretOperation: "sec:DeriveSecretOperation",
1424
+ EcdsaSecp256k1Signature2019: "sec:EcdsaSecp256k1Signature2019",
1425
+ EcdsaSecp256r1Signature2019: "sec:EcdsaSecp256r1Signature2019",
1426
+ EcdsaSecp256k1VerificationKey2019: "sec:EcdsaSecp256k1VerificationKey2019",
1427
+ EcdsaSecp256r1VerificationKey2019: "sec:EcdsaSecp256r1VerificationKey2019",
1428
+ Ed25519Signature2018: "sec:Ed25519Signature2018",
1429
+ Ed25519VerificationKey2018: "sec:Ed25519VerificationKey2018",
1430
+ EquihashProof2018: "sec:EquihashProof2018",
1431
+ ExportKeyOperation: "sec:ExportKeyOperation",
1432
+ GenerateKeyOperation: "sec:GenerateKeyOperation",
1433
+ KmsOperation: "sec:KmsOperation",
1434
+ RevokeKeyOperation: "sec:RevokeKeyOperation",
1435
+ RsaSignature2018: "sec:RsaSignature2018",
1436
+ RsaVerificationKey2018: "sec:RsaVerificationKey2018",
1437
+ Sha256HmacKey2019: "sec:Sha256HmacKey2019",
1438
+ SignOperation: "sec:SignOperation",
1439
+ UnwrapKeyOperation: "sec:UnwrapKeyOperation",
1440
+ VerifyOperation: "sec:VerifyOperation",
1441
+ WrapKeyOperation: "sec:WrapKeyOperation",
1442
+ X25519KeyAgreementKey2019: "sec:X25519KeyAgreementKey2019",
1443
+ allowedAction: "sec:allowedAction",
1444
+ assertionMethod: { "@id": "sec:assertionMethod", "@type": "@id", "@container": "@set" },
1445
+ authentication: { "@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set" },
1446
+ capability: { "@id": "sec:capability", "@type": "@id" },
1447
+ capabilityAction: "sec:capabilityAction",
1448
+ capabilityChain: { "@id": "sec:capabilityChain", "@type": "@id", "@container": "@list" },
1449
+ capabilityDelegation: { "@id": "sec:capabilityDelegationMethod", "@type": "@id", "@container": "@set" },
1450
+ capabilityInvocation: { "@id": "sec:capabilityInvocationMethod", "@type": "@id", "@container": "@set" },
1451
+ caveat: { "@id": "sec:caveat", "@type": "@id", "@container": "@set" },
1452
+ challenge: "sec:challenge",
1453
+ ciphertext: "sec:ciphertext",
1454
+ controller: { "@id": "sec:controller", "@type": "@id" },
1455
+ delegator: { "@id": "sec:delegator", "@type": "@id" },
1456
+ equihashParameterK: { "@id": "sec:equihashParameterK", "@type": "xsd:integer" },
1457
+ equihashParameterN: { "@id": "sec:equihashParameterN", "@type": "xsd:integer" },
1458
+ invocationTarget: { "@id": "sec:invocationTarget", "@type": "@id" },
1459
+ invoker: { "@id": "sec:invoker", "@type": "@id" },
1460
+ jws: "sec:jws",
1461
+ keyAgreement: { "@id": "sec:keyAgreementMethod", "@type": "@id", "@container": "@set" },
1462
+ kmsModule: { "@id": "sec:kmsModule" },
1463
+ parentCapability: { "@id": "sec:parentCapability", "@type": "@id" },
1464
+ plaintext: "sec:plaintext",
1465
+ proof: { "@id": "sec:proof", "@type": "@id", "@container": "@graph" },
1466
+ proofPurpose: { "@id": "sec:proofPurpose", "@type": "@vocab" },
1467
+ proofValue: "sec:proofValue",
1468
+ referenceId: "sec:referenceId",
1469
+ unwrappedKey: "sec:unwrappedKey",
1470
+ verificationMethod: { "@id": "sec:verificationMethod", "@type": "@id" },
1471
+ verifyData: "sec:verifyData",
1472
+ wrappedKey: "sec:wrappedKey"
1473
+ }
1474
+ ]
1475
+ };
1476
+
1477
+ // src/contexts/w3id.org_security_v3-unstable.json
1478
+ var w3id_org_security_v3_unstable_default = {
1479
+ "@context": [
1480
+ {
1481
+ "@version": 1.1,
1482
+ id: "@id",
1483
+ type: "@type",
1484
+ "@protected": true,
1485
+ JsonWebKey2020: {
1486
+ "@id": "https://w3id.org/security#JsonWebKey2020"
1487
+ },
1488
+ JsonWebSignature2020: {
1489
+ "@id": "https://w3id.org/security#JsonWebSignature2020",
1490
+ "@context": {
1491
+ "@version": 1.1,
1492
+ id: "@id",
1493
+ type: "@type",
1494
+ "@protected": true,
1495
+ challenge: "https://w3id.org/security#challenge",
1496
+ created: {
1497
+ "@id": "http://purl.org/dc/terms/created",
1498
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1499
+ },
1500
+ domain: "https://w3id.org/security#domain",
1501
+ expires: {
1502
+ "@id": "https://w3id.org/security#expiration",
1503
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1504
+ },
1505
+ jws: "https://w3id.org/security#jws",
1506
+ nonce: "https://w3id.org/security#nonce",
1507
+ proofPurpose: {
1508
+ "@id": "https://w3id.org/security#proofPurpose",
1509
+ "@type": "@vocab",
1510
+ "@context": {
1511
+ "@version": 1.1,
1512
+ "@protected": true,
1513
+ id: "@id",
1514
+ type: "@type",
1515
+ assertionMethod: {
1516
+ "@id": "https://w3id.org/security#assertionMethod",
1517
+ "@type": "@id",
1518
+ "@container": "@set"
1519
+ },
1520
+ authentication: {
1521
+ "@id": "https://w3id.org/security#authenticationMethod",
1522
+ "@type": "@id",
1523
+ "@container": "@set"
1524
+ },
1525
+ capabilityInvocation: {
1526
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
1527
+ "@type": "@id",
1528
+ "@container": "@set"
1529
+ },
1530
+ capabilityDelegation: {
1531
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
1532
+ "@type": "@id",
1533
+ "@container": "@set"
1534
+ },
1535
+ keyAgreement: {
1536
+ "@id": "https://w3id.org/security#keyAgreementMethod",
1537
+ "@type": "@id",
1538
+ "@container": "@set"
1539
+ }
1540
+ }
1541
+ },
1542
+ verificationMethod: {
1543
+ "@id": "https://w3id.org/security#verificationMethod",
1544
+ "@type": "@id"
1545
+ }
1546
+ }
1547
+ },
1548
+ Ed25519VerificationKey2020: {
1549
+ "@id": "https://w3id.org/security#Ed25519VerificationKey2020"
1550
+ },
1551
+ Ed25519Signature2020: {
1552
+ "@id": "https://w3id.org/security#Ed25519Signature2020",
1553
+ "@context": {
1554
+ "@protected": true,
1555
+ id: "@id",
1556
+ type: "@type",
1557
+ challenge: "https://w3id.org/security#challenge",
1558
+ created: {
1559
+ "@id": "http://purl.org/dc/terms/created",
1560
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1561
+ },
1562
+ domain: "https://w3id.org/security#domain",
1563
+ expires: {
1564
+ "@id": "https://w3id.org/security#expiration",
1565
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1566
+ },
1567
+ nonce: "https://w3id.org/security#nonce",
1568
+ proofPurpose: {
1569
+ "@id": "https://w3id.org/security#proofPurpose",
1570
+ "@type": "@vocab",
1571
+ "@context": {
1572
+ "@version": 1.1,
1573
+ "@protected": true,
1574
+ id: "@id",
1575
+ type: "@type",
1576
+ assertionMethod: {
1577
+ "@id": "https://w3id.org/security#assertionMethod",
1578
+ "@type": "@id",
1579
+ "@container": "@set"
1580
+ },
1581
+ authentication: {
1582
+ "@id": "https://w3id.org/security#authenticationMethod",
1583
+ "@type": "@id",
1584
+ "@container": "@set"
1585
+ },
1586
+ capabilityInvocation: {
1587
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
1588
+ "@type": "@id",
1589
+ "@container": "@set"
1590
+ },
1591
+ capabilityDelegation: {
1592
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
1593
+ "@type": "@id",
1594
+ "@container": "@set"
1595
+ },
1596
+ keyAgreement: {
1597
+ "@id": "https://w3id.org/security#keyAgreementMethod",
1598
+ "@type": "@id",
1599
+ "@container": "@set"
1600
+ }
1601
+ }
1602
+ },
1603
+ proofValue: {
1604
+ "@id": "https://w3id.org/security#proofValue",
1605
+ "@type": "https://w3id.org/security#multibase"
1606
+ },
1607
+ verificationMethod: {
1608
+ "@id": "https://w3id.org/security#verificationMethod",
1609
+ "@type": "@id"
1610
+ }
1611
+ }
1612
+ },
1613
+ publicKeyJwk: {
1614
+ "@id": "https://w3id.org/security#publicKeyJwk",
1615
+ "@type": "@json"
1616
+ },
1617
+ ethereumAddress: {
1618
+ "@id": "https://w3id.org/security#ethereumAddress"
1619
+ },
1620
+ publicKeyHex: {
1621
+ "@id": "https://w3id.org/security#publicKeyHex"
1622
+ },
1623
+ blockchainAccountId: {
1624
+ "@id": "https://w3id.org/security#blockchainAccountId"
1625
+ },
1626
+ MerkleProof2019: {
1627
+ "@id": "https://w3id.org/security#MerkleProof2019"
1628
+ },
1629
+ Bls12381G1Key2020: {
1630
+ "@id": "https://w3id.org/security#Bls12381G1Key2020"
1631
+ },
1632
+ Bls12381G2Key2020: {
1633
+ "@id": "https://w3id.org/security#Bls12381G2Key2020"
1634
+ },
1635
+ BbsBlsSignature2020: {
1636
+ "@id": "https://w3id.org/security#BbsBlsSignature2020",
1637
+ "@context": {
1638
+ "@protected": true,
1639
+ id: "@id",
1640
+ type: "@type",
1641
+ challenge: "https://w3id.org/security#challenge",
1642
+ created: {
1643
+ "@id": "http://purl.org/dc/terms/created",
1644
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1645
+ },
1646
+ domain: "https://w3id.org/security#domain",
1647
+ nonce: "https://w3id.org/security#nonce",
1648
+ proofPurpose: {
1649
+ "@id": "https://w3id.org/security#proofPurpose",
1650
+ "@type": "@vocab",
1651
+ "@context": {
1652
+ "@version": 1.1,
1653
+ "@protected": true,
1654
+ id: "@id",
1655
+ type: "@type",
1656
+ assertionMethod: {
1657
+ "@id": "https://w3id.org/security#assertionMethod",
1658
+ "@type": "@id",
1659
+ "@container": "@set"
1660
+ },
1661
+ authentication: {
1662
+ "@id": "https://w3id.org/security#authenticationMethod",
1663
+ "@type": "@id",
1664
+ "@container": "@set"
1665
+ },
1666
+ capabilityInvocation: {
1667
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
1668
+ "@type": "@id",
1669
+ "@container": "@set"
1670
+ },
1671
+ capabilityDelegation: {
1672
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
1673
+ "@type": "@id",
1674
+ "@container": "@set"
1675
+ },
1676
+ keyAgreement: {
1677
+ "@id": "https://w3id.org/security#keyAgreementMethod",
1678
+ "@type": "@id",
1679
+ "@container": "@set"
1680
+ }
1681
+ }
1682
+ },
1683
+ proofValue: "https://w3id.org/security#proofValue",
1684
+ verificationMethod: {
1685
+ "@id": "https://w3id.org/security#verificationMethod",
1686
+ "@type": "@id"
1687
+ }
1688
+ }
1689
+ },
1690
+ BbsBlsSignatureProof2020: {
1691
+ "@id": "https://w3id.org/security#BbsBlsSignatureProof2020",
1692
+ "@context": {
1693
+ "@protected": true,
1694
+ id: "@id",
1695
+ type: "@type",
1696
+ challenge: "https://w3id.org/security#challenge",
1697
+ created: {
1698
+ "@id": "http://purl.org/dc/terms/created",
1699
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1700
+ },
1701
+ domain: "https://w3id.org/security#domain",
1702
+ nonce: "https://w3id.org/security#nonce",
1703
+ proofPurpose: {
1704
+ "@id": "https://w3id.org/security#proofPurpose",
1705
+ "@type": "@vocab",
1706
+ "@context": {
1707
+ "@version": 1.1,
1708
+ "@protected": true,
1709
+ id: "@id",
1710
+ type: "@type",
1711
+ assertionMethod: {
1712
+ "@id": "https://w3id.org/security#assertionMethod",
1713
+ "@type": "@id",
1714
+ "@container": "@set"
1715
+ },
1716
+ authentication: {
1717
+ "@id": "https://w3id.org/security#authenticationMethod",
1718
+ "@type": "@id",
1719
+ "@container": "@set"
1720
+ },
1721
+ capabilityInvocation: {
1722
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
1723
+ "@type": "@id",
1724
+ "@container": "@set"
1725
+ },
1726
+ capabilityDelegation: {
1727
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
1728
+ "@type": "@id",
1729
+ "@container": "@set"
1730
+ },
1731
+ keyAgreement: {
1732
+ "@id": "https://w3id.org/security#keyAgreementMethod",
1733
+ "@type": "@id",
1734
+ "@container": "@set"
1735
+ }
1736
+ }
1737
+ },
1738
+ proofValue: "https://w3id.org/security#proofValue",
1739
+ verificationMethod: {
1740
+ "@id": "https://w3id.org/security#verificationMethod",
1741
+ "@type": "@id"
1742
+ }
1743
+ }
1744
+ },
1745
+ EcdsaKoblitzSignature2016: "https://w3id.org/security#EcdsaKoblitzSignature2016",
1746
+ Ed25519Signature2018: {
1747
+ "@id": "https://w3id.org/security#Ed25519Signature2018",
1748
+ "@context": {
1749
+ "@protected": true,
1750
+ id: "@id",
1751
+ type: "@type",
1752
+ challenge: "https://w3id.org/security#challenge",
1753
+ created: {
1754
+ "@id": "http://purl.org/dc/terms/created",
1755
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1756
+ },
1757
+ domain: "https://w3id.org/security#domain",
1758
+ expires: {
1759
+ "@id": "https://w3id.org/security#expiration",
1760
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1761
+ },
1762
+ jws: "https://w3id.org/security#jws",
1763
+ nonce: "https://w3id.org/security#nonce",
1764
+ proofPurpose: {
1765
+ "@id": "https://w3id.org/security#proofPurpose",
1766
+ "@type": "@vocab",
1767
+ "@context": {
1768
+ "@version": 1.1,
1769
+ "@protected": true,
1770
+ id: "@id",
1771
+ type: "@type",
1772
+ assertionMethod: {
1773
+ "@id": "https://w3id.org/security#assertionMethod",
1774
+ "@type": "@id",
1775
+ "@container": "@set"
1776
+ },
1777
+ authentication: {
1778
+ "@id": "https://w3id.org/security#authenticationMethod",
1779
+ "@type": "@id",
1780
+ "@container": "@set"
1781
+ },
1782
+ capabilityInvocation: {
1783
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
1784
+ "@type": "@id",
1785
+ "@container": "@set"
1786
+ },
1787
+ capabilityDelegation: {
1788
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
1789
+ "@type": "@id",
1790
+ "@container": "@set"
1791
+ },
1792
+ keyAgreement: {
1793
+ "@id": "https://w3id.org/security#keyAgreementMethod",
1794
+ "@type": "@id",
1795
+ "@container": "@set"
1796
+ }
1797
+ }
1798
+ },
1799
+ proofValue: "https://w3id.org/security#proofValue",
1800
+ verificationMethod: {
1801
+ "@id": "https://w3id.org/security#verificationMethod",
1802
+ "@type": "@id"
1803
+ }
1804
+ }
1805
+ },
1806
+ EncryptedMessage: "https://w3id.org/security#EncryptedMessage",
1807
+ GraphSignature2012: "https://w3id.org/security#GraphSignature2012",
1808
+ LinkedDataSignature2015: "https://w3id.org/security#LinkedDataSignature2015",
1809
+ LinkedDataSignature2016: "https://w3id.org/security#LinkedDataSignature2016",
1810
+ CryptographicKey: "https://w3id.org/security#Key",
1811
+ authenticationTag: "https://w3id.org/security#authenticationTag",
1812
+ canonicalizationAlgorithm: "https://w3id.org/security#canonicalizationAlgorithm",
1813
+ cipherAlgorithm: "https://w3id.org/security#cipherAlgorithm",
1814
+ cipherData: "https://w3id.org/security#cipherData",
1815
+ cipherKey: "https://w3id.org/security#cipherKey",
1816
+ created: {
1817
+ "@id": "http://purl.org/dc/terms/created",
1818
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1819
+ },
1820
+ creator: {
1821
+ "@id": "http://purl.org/dc/terms/creator",
1822
+ "@type": "@id"
1823
+ },
1824
+ digestAlgorithm: "https://w3id.org/security#digestAlgorithm",
1825
+ digestValue: "https://w3id.org/security#digestValue",
1826
+ domain: "https://w3id.org/security#domain",
1827
+ encryptionKey: "https://w3id.org/security#encryptionKey",
1828
+ expiration: {
1829
+ "@id": "https://w3id.org/security#expiration",
1830
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1831
+ },
1832
+ expires: {
1833
+ "@id": "https://w3id.org/security#expiration",
1834
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1835
+ },
1836
+ initializationVector: "https://w3id.org/security#initializationVector",
1837
+ iterationCount: "https://w3id.org/security#iterationCount",
1838
+ nonce: "https://w3id.org/security#nonce",
1839
+ normalizationAlgorithm: "https://w3id.org/security#normalizationAlgorithm",
1840
+ owner: "https://w3id.org/security#owner",
1841
+ password: "https://w3id.org/security#password",
1842
+ privateKey: "https://w3id.org/security#privateKey",
1843
+ privateKeyPem: "https://w3id.org/security#privateKeyPem",
1844
+ publicKey: "https://w3id.org/security#publicKey",
1845
+ publicKeyBase58: "https://w3id.org/security#publicKeyBase58",
1846
+ publicKeyPem: "https://w3id.org/security#publicKeyPem",
1847
+ publicKeyWif: "https://w3id.org/security#publicKeyWif",
1848
+ publicKeyService: "https://w3id.org/security#publicKeyService",
1849
+ revoked: {
1850
+ "@id": "https://w3id.org/security#revoked",
1851
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1852
+ },
1853
+ salt: "https://w3id.org/security#salt",
1854
+ signature: "https://w3id.org/security#signature",
1855
+ signatureAlgorithm: "https://w3id.org/security#signingAlgorithm",
1856
+ signatureValue: "https://w3id.org/security#signatureValue",
1857
+ proofValue: "https://w3id.org/security#proofValue",
1858
+ AesKeyWrappingKey2019: "https://w3id.org/security#AesKeyWrappingKey2019",
1859
+ DeleteKeyOperation: "https://w3id.org/security#DeleteKeyOperation",
1860
+ DeriveSecretOperation: "https://w3id.org/security#DeriveSecretOperation",
1861
+ EcdsaSecp256k1Signature2019: {
1862
+ "@id": "https://w3id.org/security#EcdsaSecp256k1Signature2019",
1863
+ "@context": {
1864
+ "@protected": true,
1865
+ id: "@id",
1866
+ type: "@type",
1867
+ challenge: "https://w3id.org/security#challenge",
1868
+ created: {
1869
+ "@id": "http://purl.org/dc/terms/created",
1870
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1871
+ },
1872
+ domain: "https://w3id.org/security#domain",
1873
+ expires: {
1874
+ "@id": "https://w3id.org/security#expiration",
1875
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1876
+ },
1877
+ jws: "https://w3id.org/security#jws",
1878
+ nonce: "https://w3id.org/security#nonce",
1879
+ proofPurpose: {
1880
+ "@id": "https://w3id.org/security#proofPurpose",
1881
+ "@type": "@vocab",
1882
+ "@context": {
1883
+ "@version": 1.1,
1884
+ "@protected": true,
1885
+ id: "@id",
1886
+ type: "@type",
1887
+ assertionMethod: {
1888
+ "@id": "https://w3id.org/security#assertionMethod",
1889
+ "@type": "@id",
1890
+ "@container": "@set"
1891
+ },
1892
+ authentication: {
1893
+ "@id": "https://w3id.org/security#authenticationMethod",
1894
+ "@type": "@id",
1895
+ "@container": "@set"
1896
+ },
1897
+ capabilityInvocation: {
1898
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
1899
+ "@type": "@id",
1900
+ "@container": "@set"
1901
+ },
1902
+ capabilityDelegation: {
1903
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
1904
+ "@type": "@id",
1905
+ "@container": "@set"
1906
+ },
1907
+ keyAgreement: {
1908
+ "@id": "https://w3id.org/security#keyAgreementMethod",
1909
+ "@type": "@id",
1910
+ "@container": "@set"
1911
+ }
1912
+ }
1913
+ },
1914
+ proofValue: "https://w3id.org/security#proofValue",
1915
+ verificationMethod: {
1916
+ "@id": "https://w3id.org/security#verificationMethod",
1917
+ "@type": "@id"
1918
+ }
1919
+ }
1920
+ },
1921
+ EcdsaSecp256r1Signature2019: {
1922
+ "@id": "https://w3id.org/security#EcdsaSecp256r1Signature2019",
1923
+ "@context": {
1924
+ "@protected": true,
1925
+ id: "@id",
1926
+ type: "@type",
1927
+ challenge: "https://w3id.org/security#challenge",
1928
+ created: {
1929
+ "@id": "http://purl.org/dc/terms/created",
1930
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1931
+ },
1932
+ domain: "https://w3id.org/security#domain",
1933
+ expires: {
1934
+ "@id": "https://w3id.org/security#expiration",
1935
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1936
+ },
1937
+ jws: "https://w3id.org/security#jws",
1938
+ nonce: "https://w3id.org/security#nonce",
1939
+ proofPurpose: {
1940
+ "@id": "https://w3id.org/security#proofPurpose",
1941
+ "@type": "@vocab",
1942
+ "@context": {
1943
+ "@version": 1.1,
1944
+ "@protected": true,
1945
+ id: "@id",
1946
+ type: "@type",
1947
+ assertionMethod: {
1948
+ "@id": "https://w3id.org/security#assertionMethod",
1949
+ "@type": "@id",
1950
+ "@container": "@set"
1951
+ },
1952
+ authentication: {
1953
+ "@id": "https://w3id.org/security#authenticationMethod",
1954
+ "@type": "@id",
1955
+ "@container": "@set"
1956
+ },
1957
+ capabilityInvocation: {
1958
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
1959
+ "@type": "@id",
1960
+ "@container": "@set"
1961
+ },
1962
+ capabilityDelegation: {
1963
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
1964
+ "@type": "@id",
1965
+ "@container": "@set"
1966
+ },
1967
+ keyAgreement: {
1968
+ "@id": "https://w3id.org/security#keyAgreementMethod",
1969
+ "@type": "@id",
1970
+ "@container": "@set"
1971
+ }
1972
+ }
1973
+ },
1974
+ proofValue: "https://w3id.org/security#proofValue",
1975
+ verificationMethod: {
1976
+ "@id": "https://w3id.org/security#verificationMethod",
1977
+ "@type": "@id"
1978
+ }
1979
+ }
1980
+ },
1981
+ EcdsaSecp256k1VerificationKey2019: "https://w3id.org/security#EcdsaSecp256k1VerificationKey2019",
1982
+ EcdsaSecp256r1VerificationKey2019: "https://w3id.org/security#EcdsaSecp256r1VerificationKey2019",
1983
+ Ed25519VerificationKey2018: "https://w3id.org/security#Ed25519VerificationKey2018",
1984
+ EquihashProof2018: "https://w3id.org/security#EquihashProof2018",
1985
+ ExportKeyOperation: "https://w3id.org/security#ExportKeyOperation",
1986
+ GenerateKeyOperation: "https://w3id.org/security#GenerateKeyOperation",
1987
+ KmsOperation: "https://w3id.org/security#KmsOperation",
1988
+ RevokeKeyOperation: "https://w3id.org/security#RevokeKeyOperation",
1989
+ RsaSignature2018: {
1990
+ "@id": "https://w3id.org/security#RsaSignature2018",
1991
+ "@context": {
1992
+ "@protected": true,
1993
+ challenge: "https://w3id.org/security#challenge",
1994
+ created: {
1995
+ "@id": "http://purl.org/dc/terms/created",
1996
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
1997
+ },
1998
+ domain: "https://w3id.org/security#domain",
1999
+ expires: {
2000
+ "@id": "https://w3id.org/security#expiration",
2001
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
2002
+ },
2003
+ jws: "https://w3id.org/security#jws",
2004
+ nonce: "https://w3id.org/security#nonce",
2005
+ proofPurpose: {
2006
+ "@id": "https://w3id.org/security#proofPurpose",
2007
+ "@type": "@vocab",
2008
+ "@context": {
2009
+ "@version": 1.1,
2010
+ "@protected": true,
2011
+ id: "@id",
2012
+ type: "@type",
2013
+ assertionMethod: {
2014
+ "@id": "https://w3id.org/security#assertionMethod",
2015
+ "@type": "@id",
2016
+ "@container": "@set"
2017
+ },
2018
+ authentication: {
2019
+ "@id": "https://w3id.org/security#authenticationMethod",
2020
+ "@type": "@id",
2021
+ "@container": "@set"
2022
+ },
2023
+ capabilityInvocation: {
2024
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
2025
+ "@type": "@id",
2026
+ "@container": "@set"
2027
+ },
2028
+ capabilityDelegation: {
2029
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
2030
+ "@type": "@id",
2031
+ "@container": "@set"
2032
+ },
2033
+ keyAgreement: {
2034
+ "@id": "https://w3id.org/security#keyAgreementMethod",
2035
+ "@type": "@id",
2036
+ "@container": "@set"
2037
+ }
2038
+ }
2039
+ },
2040
+ proofValue: "https://w3id.org/security#proofValue",
2041
+ verificationMethod: {
2042
+ "@id": "https://w3id.org/security#verificationMethod",
2043
+ "@type": "@id"
2044
+ }
2045
+ }
2046
+ },
2047
+ RsaVerificationKey2018: "https://w3id.org/security#RsaVerificationKey2018",
2048
+ Sha256HmacKey2019: "https://w3id.org/security#Sha256HmacKey2019",
2049
+ SignOperation: "https://w3id.org/security#SignOperation",
2050
+ UnwrapKeyOperation: "https://w3id.org/security#UnwrapKeyOperation",
2051
+ VerifyOperation: "https://w3id.org/security#VerifyOperation",
2052
+ WrapKeyOperation: "https://w3id.org/security#WrapKeyOperation",
2053
+ X25519KeyAgreementKey2019: "https://w3id.org/security#X25519KeyAgreementKey2019",
2054
+ allowedAction: "https://w3id.org/security#allowedAction",
2055
+ assertionMethod: {
2056
+ "@id": "https://w3id.org/security#assertionMethod",
2057
+ "@type": "@id",
2058
+ "@container": "@set"
2059
+ },
2060
+ authentication: {
2061
+ "@id": "https://w3id.org/security#authenticationMethod",
2062
+ "@type": "@id",
2063
+ "@container": "@set"
2064
+ },
2065
+ capability: {
2066
+ "@id": "https://w3id.org/security#capability",
2067
+ "@type": "@id"
2068
+ },
2069
+ capabilityAction: "https://w3id.org/security#capabilityAction",
2070
+ capabilityChain: {
2071
+ "@id": "https://w3id.org/security#capabilityChain",
2072
+ "@type": "@id",
2073
+ "@container": "@list"
2074
+ },
2075
+ capabilityDelegation: {
2076
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
2077
+ "@type": "@id",
2078
+ "@container": "@set"
2079
+ },
2080
+ capabilityInvocation: {
2081
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
2082
+ "@type": "@id",
2083
+ "@container": "@set"
2084
+ },
2085
+ caveat: {
2086
+ "@id": "https://w3id.org/security#caveat",
2087
+ "@type": "@id",
2088
+ "@container": "@set"
2089
+ },
2090
+ challenge: "https://w3id.org/security#challenge",
2091
+ ciphertext: "https://w3id.org/security#ciphertext",
2092
+ controller: {
2093
+ "@id": "https://w3id.org/security#controller",
2094
+ "@type": "@id"
2095
+ },
2096
+ delegator: {
2097
+ "@id": "https://w3id.org/security#delegator",
2098
+ "@type": "@id"
2099
+ },
2100
+ equihashParameterK: {
2101
+ "@id": "https://w3id.org/security#equihashParameterK",
2102
+ "@type": "http://www.w3.org/2001/XMLSchema#:integer"
2103
+ },
2104
+ equihashParameterN: {
2105
+ "@id": "https://w3id.org/security#equihashParameterN",
2106
+ "@type": "http://www.w3.org/2001/XMLSchema#:integer"
2107
+ },
2108
+ invocationTarget: {
2109
+ "@id": "https://w3id.org/security#invocationTarget",
2110
+ "@type": "@id"
2111
+ },
2112
+ invoker: {
2113
+ "@id": "https://w3id.org/security#invoker",
2114
+ "@type": "@id"
2115
+ },
2116
+ jws: "https://w3id.org/security#jws",
2117
+ keyAgreement: {
2118
+ "@id": "https://w3id.org/security#keyAgreementMethod",
2119
+ "@type": "@id",
2120
+ "@container": "@set"
2121
+ },
2122
+ kmsModule: {
2123
+ "@id": "https://w3id.org/security#kmsModule"
2124
+ },
2125
+ parentCapability: {
2126
+ "@id": "https://w3id.org/security#parentCapability",
2127
+ "@type": "@id"
2128
+ },
2129
+ plaintext: "https://w3id.org/security#plaintext",
2130
+ proof: {
2131
+ "@id": "https://w3id.org/security#proof",
2132
+ "@type": "@id",
2133
+ "@container": "@graph"
2134
+ },
2135
+ proofPurpose: {
2136
+ "@id": "https://w3id.org/security#proofPurpose",
2137
+ "@type": "@vocab",
2138
+ "@context": {
2139
+ "@version": 1.1,
2140
+ "@protected": true,
2141
+ id: "@id",
2142
+ type: "@type",
2143
+ assertionMethod: {
2144
+ "@id": "https://w3id.org/security#assertionMethod",
2145
+ "@type": "@id",
2146
+ "@container": "@set"
2147
+ },
2148
+ authentication: {
2149
+ "@id": "https://w3id.org/security#authenticationMethod",
2150
+ "@type": "@id",
2151
+ "@container": "@set"
2152
+ },
2153
+ capabilityInvocation: {
2154
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
2155
+ "@type": "@id",
2156
+ "@container": "@set"
2157
+ },
2158
+ capabilityDelegation: {
2159
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
2160
+ "@type": "@id",
2161
+ "@container": "@set"
2162
+ },
2163
+ keyAgreement: {
2164
+ "@id": "https://w3id.org/security#keyAgreementMethod",
2165
+ "@type": "@id",
2166
+ "@container": "@set"
2167
+ }
2168
+ }
2169
+ },
2170
+ referenceId: "https://w3id.org/security#referenceId",
2171
+ unwrappedKey: "https://w3id.org/security#unwrappedKey",
2172
+ verificationMethod: {
2173
+ "@id": "https://w3id.org/security#verificationMethod",
2174
+ "@type": "@id"
2175
+ },
2176
+ verifyData: "https://w3id.org/security#verifyData",
2177
+ wrappedKey: "https://w3id.org/security#wrappedKey",
2178
+ x509CertificateChain: {
2179
+ "@id": "https://w3id.org/security#x509CertificateChain",
2180
+ "@type": "https://w3id.org/security#multibase",
2181
+ "@container": "@list"
2182
+ },
2183
+ x509CertificateFingerprint: {
2184
+ "@id": "https://w3id.org/security#x509CertificateFingerprint",
2185
+ "@type": "https://w3id.org/security#multibase"
2186
+ }
2187
+ }
2188
+ ]
2189
+ };
2190
+
2191
+ // src/contexts/w3id.org_security_suites_ed25519-2018_v1.json
2192
+ var w3id_org_security_suites_ed25519_2018_v1_default = {
2193
+ "@context": [
2194
+ {
2195
+ "@version": 1.1
2196
+ },
2197
+ "https://w3id.org/security/v1",
2198
+ {
2199
+ AesKeyWrappingKey2019: "sec:AesKeyWrappingKey2019",
2200
+ DeleteKeyOperation: "sec:DeleteKeyOperation",
2201
+ DeriveSecretOperation: "sec:DeriveSecretOperation",
2202
+ EcdsaSecp256k1Signature2019: "sec:EcdsaSecp256k1Signature2019",
2203
+ EcdsaSecp256r1Signature2019: "sec:EcdsaSecp256r1Signature2019",
2204
+ EcdsaSecp256k1VerificationKey2019: "sec:EcdsaSecp256k1VerificationKey2019",
2205
+ EcdsaSecp256r1VerificationKey2019: "sec:EcdsaSecp256r1VerificationKey2019",
2206
+ Ed25519Signature2018: "sec:Ed25519Signature2018",
2207
+ Ed25519VerificationKey2018: "sec:Ed25519VerificationKey2018",
2208
+ EquihashProof2018: "sec:EquihashProof2018",
2209
+ ExportKeyOperation: "sec:ExportKeyOperation",
2210
+ GenerateKeyOperation: "sec:GenerateKeyOperation",
2211
+ KmsOperation: "sec:KmsOperation",
2212
+ RevokeKeyOperation: "sec:RevokeKeyOperation",
2213
+ RsaSignature2018: "sec:RsaSignature2018",
2214
+ RsaVerificationKey2018: "sec:RsaVerificationKey2018",
2215
+ Sha256HmacKey2019: "sec:Sha256HmacKey2019",
2216
+ SignOperation: "sec:SignOperation",
2217
+ UnwrapKeyOperation: "sec:UnwrapKeyOperation",
2218
+ VerifyOperation: "sec:VerifyOperation",
2219
+ WrapKeyOperation: "sec:WrapKeyOperation",
2220
+ X25519KeyAgreementKey2019: "sec:X25519KeyAgreementKey2019",
2221
+ allowedAction: "sec:allowedAction",
2222
+ assertionMethod: { "@id": "sec:assertionMethod", "@type": "@id", "@container": "@set" },
2223
+ authentication: { "@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set" },
2224
+ capability: { "@id": "sec:capability", "@type": "@id" },
2225
+ capabilityAction: "sec:capabilityAction",
2226
+ capabilityChain: { "@id": "sec:capabilityChain", "@type": "@id", "@container": "@list" },
2227
+ capabilityDelegation: { "@id": "sec:capabilityDelegationMethod", "@type": "@id", "@container": "@set" },
2228
+ capabilityInvocation: { "@id": "sec:capabilityInvocationMethod", "@type": "@id", "@container": "@set" },
2229
+ caveat: { "@id": "sec:caveat", "@type": "@id", "@container": "@set" },
2230
+ challenge: "sec:challenge",
2231
+ ciphertext: "sec:ciphertext",
2232
+ controller: { "@id": "sec:controller", "@type": "@id" },
2233
+ delegator: { "@id": "sec:delegator", "@type": "@id" },
2234
+ equihashParameterK: { "@id": "sec:equihashParameterK", "@type": "xsd:integer" },
2235
+ equihashParameterN: { "@id": "sec:equihashParameterN", "@type": "xsd:integer" },
2236
+ invocationTarget: { "@id": "sec:invocationTarget", "@type": "@id" },
2237
+ invoker: { "@id": "sec:invoker", "@type": "@id" },
2238
+ jws: "sec:jws",
2239
+ keyAgreement: { "@id": "sec:keyAgreementMethod", "@type": "@id", "@container": "@set" },
2240
+ kmsModule: { "@id": "sec:kmsModule" },
2241
+ parentCapability: { "@id": "sec:parentCapability", "@type": "@id" },
2242
+ plaintext: "sec:plaintext",
2243
+ proof: { "@id": "sec:proof", "@type": "@id", "@container": "@graph" },
2244
+ proofPurpose: { "@id": "sec:proofPurpose", "@type": "@vocab" },
2245
+ proofValue: "sec:proofValue",
2246
+ referenceId: "sec:referenceId",
2247
+ unwrappedKey: "sec:unwrappedKey",
2248
+ verificationMethod: { "@id": "sec:verificationMethod", "@type": "@id" },
2249
+ verifyData: "sec:verifyData",
2250
+ wrappedKey: "sec:wrappedKey"
2251
+ }
2252
+ ]
2253
+ };
2254
+
2255
+ // src/contexts/w3id.org_security_suites_x25519-2019_v1.json
2256
+ var w3id_org_security_suites_x25519_2019_v1_default = {
2257
+ "@context": {
2258
+ id: "@id",
2259
+ type: "@type",
2260
+ "@protected": true,
2261
+ X25519KeyAgreementKey2019: {
2262
+ "@id": "https://w3id.org/security#X25519KeyAgreementKey2019",
2263
+ "@context": {
2264
+ "@protected": true,
2265
+ id: "@id",
2266
+ type: "@type",
2267
+ controller: {
2268
+ "@id": "https://w3id.org/security#controller",
2269
+ "@type": "@id"
2270
+ },
2271
+ revoked: {
2272
+ "@id": "https://w3id.org/security#revoked",
2273
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
2274
+ },
2275
+ publicKeyBase58: {
2276
+ "@id": "https://w3id.org/security#publicKeyBase58"
2277
+ }
2278
+ }
2279
+ }
2280
+ }
2281
+ };
2282
+
2283
+ // src/contexts/veramo.io_contexts_profile_v1.json
2284
+ var veramo_io_contexts_profile_v1_default = {
2285
+ "@context": {
2286
+ "@version": 1.1,
2287
+ "@protected": true,
2288
+ Profile: "https://veramo.io/contexts/profile#Profile",
2289
+ name: "https://schema.org/name"
2290
+ }
2291
+ };
2292
+
2293
+ // src/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.json
2294
+ var lds_ecdsa_secp256k1_recovery2020_0_0_default = {
2295
+ "@context": {
2296
+ "@version": 1.1,
2297
+ id: "@id",
2298
+ type: "@type",
2299
+ esrs2020: "https://identity.foundation/EcdsaSecp256k1RecoverySignature2020#",
2300
+ EcdsaSecp256k1RecoverySignature2020: "esrs2020:EcdsaSecp256k1RecoverySignature2020",
2301
+ EcdsaSecp256k1RecoveryMethod2020: "esrs2020:EcdsaSecp256k1RecoveryMethod2020",
2302
+ publicKeyJwk: {
2303
+ "@id": "esrs2020:publicKeyJwk",
2304
+ "@type": "@json"
2305
+ },
2306
+ privateKeyJwk: {
2307
+ "@id": "esrs2020:privateKeyJwk",
2308
+ "@type": "@json"
2309
+ },
2310
+ publicKeyHex: "esrs2020:publicKeyHex",
2311
+ privateKeyHex: "esrs2020:privateKeyHex",
2312
+ ethereumAddress: "esrs2020:ethereumAddress"
2313
+ }
2314
+ };
2315
+
2316
+ // src/contexts/w3id.org_security_suites_secp256k1recovery-2020_v2.json
2317
+ var w3id_org_security_suites_secp256k1recovery_2020_v2_default = {
2318
+ "@context": {
2319
+ id: "@id",
2320
+ type: "@type",
2321
+ "@protected": true,
2322
+ proof: {
2323
+ "@id": "https://w3id.org/security#proof",
2324
+ "@type": "@id",
2325
+ "@container": "@graph"
2326
+ },
2327
+ EcdsaSecp256k1RecoveryMethod2020: {
2328
+ "@id": "https://identity.foundation/EcdsaSecp256k1RecoverySignature2020#EcdsaSecp256k1RecoveryMethod2020",
2329
+ "@context": {
2330
+ "@protected": true,
2331
+ id: "@id",
2332
+ type: "@type",
2333
+ controller: {
2334
+ "@id": "https://w3id.org/security#controller",
2335
+ "@type": "@id"
2336
+ },
2337
+ blockchainAccountId: "https://w3id.org/security#blockchainAccountId",
2338
+ publicKeyJwk: {
2339
+ "@id": "https://w3id.org/security#publicKeyJwk",
2340
+ "@type": "@json"
2341
+ }
2342
+ }
2343
+ },
2344
+ EcdsaSecp256k1RecoverySignature2020: {
2345
+ "@id": "https://identity.foundation/EcdsaSecp256k1RecoverySignature2020#EcdsaSecp256k1RecoverySignature2020",
2346
+ "@context": {
2347
+ "@protected": true,
2348
+ id: "@id",
2349
+ type: "@type",
2350
+ challenge: "https://w3id.org/security#challenge",
2351
+ created: {
2352
+ "@id": "http://purl.org/dc/terms/created",
2353
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
2354
+ },
2355
+ domain: "https://w3id.org/security#domain",
2356
+ expires: {
2357
+ "@id": "https://w3id.org/security#expiration",
2358
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
2359
+ },
2360
+ jws: "https://w3id.org/security#jws",
2361
+ nonce: "https://w3id.org/security#nonce",
2362
+ proofPurpose: {
2363
+ "@id": "https://w3id.org/security#proofPurpose",
2364
+ "@type": "@vocab",
2365
+ "@context": {
2366
+ "@protected": true,
2367
+ id: "@id",
2368
+ type: "@type",
2369
+ assertionMethod: {
2370
+ "@id": "https://w3id.org/security#assertionMethod",
2371
+ "@type": "@id",
2372
+ "@container": "@set"
2373
+ },
2374
+ authentication: {
2375
+ "@id": "https://w3id.org/security#authenticationMethod",
2376
+ "@type": "@id",
2377
+ "@container": "@set"
2378
+ },
2379
+ capabilityInvocation: {
2380
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
2381
+ "@type": "@id",
2382
+ "@container": "@set"
2383
+ },
2384
+ capabilityDelegation: {
2385
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
2386
+ "@type": "@id",
2387
+ "@container": "@set"
2388
+ },
2389
+ keyAgreement: {
2390
+ "@id": "https://w3id.org/security#keyAgreementMethod",
2391
+ "@type": "@id",
2392
+ "@container": "@set"
2393
+ }
2394
+ }
2395
+ },
2396
+ verificationMethod: {
2397
+ "@id": "https://w3id.org/security#verificationMethod",
2398
+ "@type": "@id"
2399
+ }
2400
+ }
2401
+ }
2402
+ }
2403
+ };
2404
+
2405
+ // src/contexts/ed25519-signature-2020-v1.json
2406
+ var ed25519_signature_2020_v1_default = {
2407
+ "@context": {
2408
+ id: "@id",
2409
+ type: "@type",
2410
+ "@protected": true,
2411
+ proof: {
2412
+ "@id": "https://w3id.org/security#proof",
2413
+ "@type": "@id",
2414
+ "@container": "@graph"
2415
+ },
2416
+ Ed25519VerificationKey2020: {
2417
+ "@id": "https://w3id.org/security#Ed25519VerificationKey2020"
2418
+ },
2419
+ Ed25519Signature2020: {
2420
+ "@id": "https://w3id.org/security#Ed25519Signature2020",
2421
+ "@context": {
2422
+ "@protected": true,
2423
+ id: "@id",
2424
+ type: "@type",
2425
+ challenge: "https://w3id.org/security#challenge",
2426
+ created: {
2427
+ "@id": "http://purl.org/dc/terms/created",
2428
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
2429
+ },
2430
+ domain: "https://w3id.org/security#domain",
2431
+ expires: {
2432
+ "@id": "https://w3id.org/security#expiration",
2433
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
2434
+ },
2435
+ nonce: "https://w3id.org/security#nonce",
2436
+ proofPurpose: {
2437
+ "@id": "https://w3id.org/security#proofPurpose",
2438
+ "@type": "@vocab",
2439
+ "@context": {
2440
+ "@version": 1.1,
2441
+ "@protected": true,
2442
+ id: "@id",
2443
+ type: "@type",
2444
+ assertionMethod: {
2445
+ "@id": "https://w3id.org/security#assertionMethod",
2446
+ "@type": "@id",
2447
+ "@container": "@set"
2448
+ },
2449
+ authentication: {
2450
+ "@id": "https://w3id.org/security#authenticationMethod",
2451
+ "@type": "@id",
2452
+ "@container": "@set"
2453
+ },
2454
+ capabilityInvocation: {
2455
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
2456
+ "@type": "@id",
2457
+ "@container": "@set"
2458
+ },
2459
+ capabilityDelegation: {
2460
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
2461
+ "@type": "@id",
2462
+ "@container": "@set"
2463
+ },
2464
+ keyAgreement: {
2465
+ "@id": "https://w3id.org/security#keyAgreementMethod",
2466
+ "@type": "@id",
2467
+ "@container": "@set"
2468
+ }
2469
+ }
2470
+ },
2471
+ proofValue: {
2472
+ "@id": "https://w3id.org/security#proofValue",
2473
+ "@type": "https://w3id.org/security#multibase"
2474
+ },
2475
+ verificationMethod: {
2476
+ "@id": "https://w3id.org/security#verificationMethod",
2477
+ "@type": "@id"
2478
+ }
2479
+ }
2480
+ }
2481
+ }
2482
+ };
2483
+
2484
+ // src/contexts/json-web-signature-2020-v1.json
2485
+ var json_web_signature_2020_v1_default = {
2486
+ "@context": {
2487
+ "@version": 1.1,
2488
+ id: "@id",
2489
+ type: "@type",
2490
+ "@protected": true,
2491
+ JsonWebKey2020: {
2492
+ "@id": "https://w3id.org/security#JsonWebKey2020"
2493
+ },
2494
+ JsonWebSignature2020: {
2495
+ "@id": "https://w3id.org/security#JsonWebSignature2020",
2496
+ "@context": {
2497
+ "@version": 1.1,
2498
+ id: "@id",
2499
+ type: "@type",
2500
+ "@protected": true,
2501
+ challenge: "https://w3id.org/security#challenge",
2502
+ created: {
2503
+ "@id": "http://purl.org/dc/terms/created",
2504
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
2505
+ },
2506
+ domain: "https://w3id.org/security#domain",
2507
+ expires: {
2508
+ "@id": "https://w3id.org/security#expiration",
2509
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
2510
+ },
2511
+ jws: "https://w3id.org/security#jws",
2512
+ nonce: "https://w3id.org/security#nonce",
2513
+ proofPurpose: {
2514
+ "@id": "https://w3id.org/security#proofPurpose",
2515
+ "@type": "@vocab",
2516
+ "@context": {
2517
+ "@version": 1.1,
2518
+ "@protected": true,
2519
+ id: "@id",
2520
+ type: "@type",
2521
+ assertionMethod: {
2522
+ "@id": "https://w3id.org/security#assertionMethod",
2523
+ "@type": "@id",
2524
+ "@container": "@set"
2525
+ },
2526
+ authentication: {
2527
+ "@id": "https://w3id.org/security#authenticationMethod",
2528
+ "@type": "@id",
2529
+ "@container": "@set"
2530
+ },
2531
+ capabilityInvocation: {
2532
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
2533
+ "@type": "@id",
2534
+ "@container": "@set"
2535
+ },
2536
+ capabilityDelegation: {
2537
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
2538
+ "@type": "@id",
2539
+ "@container": "@set"
2540
+ },
2541
+ keyAgreement: {
2542
+ "@id": "https://w3id.org/security#keyAgreementMethod",
2543
+ "@type": "@id",
2544
+ "@container": "@set"
2545
+ }
2546
+ }
2547
+ },
2548
+ verificationMethod: {
2549
+ "@id": "https://w3id.org/security#verificationMethod",
2550
+ "@type": "@id"
2551
+ }
2552
+ }
2553
+ }
2554
+ }
2555
+ };
2556
+
2557
+ // src/contexts/eip712.json
2558
+ var eip712_default = {
2559
+ "@context": {
2560
+ "@version": 1.1,
2561
+ "@protected": true,
2562
+ Eip712SchemaValidator2021: "https://w3id.org/security#Eip712SchemaValidator2021",
2563
+ EthereumEip712Signature2021: {
2564
+ "@id": "https://w3id.org/security#EthereumEip712Signature2021",
2565
+ "@context": {
2566
+ "@version": 1.1,
2567
+ "@protected": true,
2568
+ id: "@id",
2569
+ type: "@type",
2570
+ created: {
2571
+ "@id": "http://purl.org/dc/terms/created",
2572
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
2573
+ },
2574
+ domain: "https://w3id.org/security#domain",
2575
+ proofPurpose: {
2576
+ "@id": "https://w3id.org/security#proofPurpose",
2577
+ "@type": "@vocab",
2578
+ "@context": {
2579
+ "@version": 1.1,
2580
+ "@protected": true,
2581
+ id: "@id",
2582
+ type: "@type",
2583
+ assertionMethod: {
2584
+ "@id": "https://w3id.org/security#assertionMethod",
2585
+ "@type": "@id",
2586
+ "@container": "@set"
2587
+ },
2588
+ authentication: {
2589
+ "@id": "https://w3id.org/security#authenticationMethod",
2590
+ "@type": "@id",
2591
+ "@container": "@set"
2592
+ },
2593
+ capabilityInvocation: {
2594
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
2595
+ "@type": "@id",
2596
+ "@container": "@set"
2597
+ },
2598
+ capabilityDelegation: {
2599
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
2600
+ "@type": "@id",
2601
+ "@container": "@set"
2602
+ }
2603
+ }
2604
+ },
2605
+ eip712Domain: {
2606
+ "@id": "https://w3c-ccg.github.io/ethereum-eip712-signature-2021-spec/#eip712-domain",
2607
+ "@context": {
2608
+ "@version": 1.1,
2609
+ "@protected": true,
2610
+ id: "@id",
2611
+ type: "@type",
2612
+ messageSchema: {
2613
+ "@id": "https://w3c-ccg.github.io/ethereum-eip712-signature-2021-spec/#message-schema",
2614
+ "@type": "@json"
2615
+ },
2616
+ primaryType: "https://w3c-ccg.github.io/ethereum-eip712-signature-2021-spec/#primary-type",
2617
+ domain: {
2618
+ "@id": "https://w3c-ccg.github.io/ethereum-eip712-signature-2021-spec/#domain",
2619
+ "@type": "@json"
2620
+ }
2621
+ }
2622
+ },
2623
+ eip712: {
2624
+ "@id": "https://w3c-ccg.github.io/ethereum-eip712-signature-2021-spec/#eip712-domain",
2625
+ "@context": {
2626
+ "@version": 1.1,
2627
+ "@protected": true,
2628
+ id: "@id",
2629
+ type: "@type",
2630
+ types: {
2631
+ "@id": "https://w3c-ccg.github.io/ethereum-eip712-signature-2021-spec/#message-schema",
2632
+ "@type": "@json"
2633
+ },
2634
+ primaryType: "https://w3c-ccg.github.io/ethereum-eip712-signature-2021-spec/#primary-type",
2635
+ domain: {
2636
+ "@id": "https://w3c-ccg.github.io/ethereum-eip712-signature-2021-spec/#domain",
2637
+ "@type": "@json"
2638
+ }
2639
+ }
2640
+ },
2641
+ proofValue: "https://w3id.org/security#proofValue",
2642
+ verificationMethod: {
2643
+ "@id": "https://w3id.org/security#verificationMethod",
2644
+ "@type": "@id"
2645
+ },
2646
+ canonicalizationHash: "https://w3id.org/security/suites/eip712sig-2021#canonicalizationHash"
2647
+ }
2648
+ }
2649
+ }
2650
+ };
2651
+
2652
+ // src/contexts/citizenship-v1.json
2653
+ var citizenship_v1_default = {
2654
+ "@context": {
2655
+ "@version": 1.1,
2656
+ "@protected": true,
2657
+ name: "http://schema.org/name",
2658
+ description: "http://schema.org/description",
2659
+ identifier: "http://schema.org/identifier",
2660
+ image: { "@id": "http://schema.org/image", "@type": "@id" },
2661
+ PermanentResidentCard: {
2662
+ "@id": "https://w3id.org/citizenship#PermanentResidentCard",
2663
+ "@context": {
2664
+ "@version": 1.1,
2665
+ "@protected": true,
2666
+ id: "@id",
2667
+ type: "@type",
2668
+ description: "http://schema.org/description",
2669
+ name: "http://schema.org/name",
2670
+ identifier: "http://schema.org/identifier",
2671
+ image: { "@id": "http://schema.org/image", "@type": "@id" }
2672
+ }
2673
+ },
2674
+ PermanentResident: {
2675
+ "@id": "https://w3id.org/citizenship#PermanentResident",
2676
+ "@context": {
2677
+ "@version": 1.1,
2678
+ "@protected": true,
2679
+ id: "@id",
2680
+ type: "@type",
2681
+ ctzn: "https://w3id.org/citizenship#",
2682
+ schema: "http://schema.org/",
2683
+ xsd: "http://www.w3.org/2001/XMLSchema#",
2684
+ birthCountry: "ctzn:birthCountry",
2685
+ birthDate: { "@id": "schema:birthDate", "@type": "xsd:dateTime" },
2686
+ commuterClassification: "ctzn:commuterClassification",
2687
+ familyName: "schema:familyName",
2688
+ gender: "schema:gender",
2689
+ givenName: "schema:givenName",
2690
+ lprCategory: "ctzn:lprCategory",
2691
+ lprNumber: "ctzn:lprNumber",
2692
+ residentSince: { "@id": "ctzn:residentSince", "@type": "xsd:dateTime" }
2693
+ }
2694
+ },
2695
+ Person: "http://schema.org/Person"
2696
+ }
2697
+ };
2698
+
2699
+ // src/contexts/vc-revocation-list-2020-v1.json
2700
+ var vc_revocation_list_2020_v1_default = {
2701
+ "@context": {
2702
+ "@protected": true,
2703
+ RevocationList2020Credential: {
2704
+ "@id": "https://w3id.org/vc-revocation-list-2020#RevocationList2020Credential",
2705
+ "@context": {
2706
+ "@protected": true,
2707
+ id: "@id",
2708
+ type: "@type",
2709
+ description: "http://schema.org/description",
2710
+ name: "http://schema.org/name"
2711
+ }
2712
+ },
2713
+ RevocationList2020: {
2714
+ "@id": "https://w3id.org/vc-revocation-list-2020#RevocationList2020",
2715
+ "@context": {
2716
+ "@protected": true,
2717
+ id: "@id",
2718
+ type: "@type",
2719
+ encodedList: "https://w3id.org/vc-revocation-list-2020#encodedList"
2720
+ }
2721
+ },
2722
+ RevocationList2020Status: {
2723
+ "@id": "https://w3id.org/vc-revocation-list-2020#RevocationList2020Status",
2724
+ "@context": {
2725
+ "@protected": true,
2726
+ id: "@id",
2727
+ type: "@type",
2728
+ revocationListCredential: {
2729
+ "@id": "https://w3id.org/vc-revocation-list-2020#revocationListCredential",
2730
+ "@type": "@id"
2731
+ },
2732
+ revocationListIndex: "https://w3id.org/vc-revocation-list-2020#revocationListIndex"
2733
+ }
2734
+ }
2735
+ }
2736
+ };
2737
+
2738
+ // src/contexts/vc-status-list-2021-v1.json
2739
+ var vc_status_list_2021_v1_default = {
2740
+ "@context": {
2741
+ "@protected": true,
2742
+ StatusList2021Credential: {
2743
+ "@id": "https://w3id.org/vc/status-list#StatusList2021Credential",
2744
+ "@context": {
2745
+ "@protected": true,
2746
+ id: "@id",
2747
+ type: "@type",
2748
+ description: "http://schema.org/description",
2749
+ name: "http://schema.org/name"
2750
+ }
2751
+ },
2752
+ StatusList2021: {
2753
+ "@id": "https://w3id.org/vc/status-list#StatusList2021",
2754
+ "@context": {
2755
+ "@protected": true,
2756
+ id: "@id",
2757
+ type: "@type",
2758
+ statusPurpose: "https://w3id.org/vc/status-list#statusPurpose",
2759
+ encodedList: "https://w3id.org/vc/status-list#encodedList"
2760
+ }
2761
+ },
2762
+ StatusList2021Entry: {
2763
+ "@id": "https://w3id.org/vc/status-list#StatusList2021Entry",
2764
+ "@context": {
2765
+ "@protected": true,
2766
+ id: "@id",
2767
+ type: "@type",
2768
+ statusPurpose: "https://w3id.org/vc/status-list#statusPurpose",
2769
+ statusListIndex: "https://w3id.org/vc/status-list#statusListIndex",
2770
+ statusListCredential: {
2771
+ "@id": "https://w3id.org/vc/status-list#statusListCredential",
2772
+ "@type": "@id"
2773
+ }
2774
+ }
2775
+ }
2776
+ }
2777
+ };
2778
+
2779
+ // src/ld-default-contexts.ts
2780
+ var contextCredentialV1 = require_www_w3_org_2018_credentials_v1();
2781
+ var contextCredentialV2 = require_www_w3_org_ns_credentials_v2();
2782
+ var LdDefaultContexts = /* @__PURE__ */ new Map([
2783
+ [
2784
+ "https://www.w3.org/2018/credentials/v1",
2785
+ contextCredentialV1
2786
+ ],
2787
+ [
2788
+ "https://www.w3.org/ns/credentials/v2",
2789
+ contextCredentialV2
2790
+ ],
2791
+ [
2792
+ "https://w3.org/ns/credentials/v2",
2793
+ contextCredentialV2
2794
+ ],
2795
+ [
2796
+ "https://w3id.org/security/bbs/v1",
2797
+ bbs_bls_signature_2020_v1_default
2798
+ ],
2799
+ [
2800
+ "https://w3id.org/did/v1",
2801
+ www_w3_org_ns_did_v1_default
2802
+ ],
2803
+ [
2804
+ "https://w3.org/ns/did/v1",
2805
+ www_w3_org_ns_did_v1_default
2806
+ ],
2807
+ [
2808
+ "https://www.w3.org/ns/did/v1",
2809
+ www_w3_org_ns_did_v1_default
2810
+ ],
2811
+ [
2812
+ "https://w3id.org/security/v1",
2813
+ w3id_org_security_v1_default
2814
+ ],
2815
+ [
2816
+ "https://w3id.org/security/v2",
2817
+ w3id_org_security_v2_default
2818
+ ],
2819
+ [
2820
+ "https://w3id.org/security/v3-unstable",
2821
+ w3id_org_security_v3_unstable_default
2822
+ ],
2823
+ [
2824
+ "https://w3id.org/security/suites/ed25519-2018/v1",
2825
+ w3id_org_security_suites_ed25519_2018_v1_default
2826
+ ],
2827
+ [
2828
+ "https://w3id.org/security/suites/x25519-2019/v1",
2829
+ w3id_org_security_suites_x25519_2019_v1_default
2830
+ ],
2831
+ [
2832
+ "https://w3id.org/security/suites/ed25519-2020/v1",
2833
+ ed25519_signature_2020_v1_default
2834
+ ],
2835
+ [
2836
+ "https://w3id.org/security/suites/jws-2020/v1",
2837
+ json_web_signature_2020_v1_default
2838
+ ],
2839
+ [
2840
+ "https://veramo.io/contexts/profile/v1",
2841
+ veramo_io_contexts_profile_v1_default
2842
+ ],
2843
+ [
2844
+ "https://w3id.org/citizenship/v1",
2845
+ citizenship_v1_default
2846
+ ],
2847
+ [
2848
+ "https://w3id.org/vc-revocation-list-2020",
2849
+ vc_revocation_list_2020_v1_default
2850
+ ],
2851
+ [
2852
+ "https://w3id.org/vc/status-list/v1",
2853
+ vc_status_list_2021_v1_default
2854
+ ],
2855
+ [
2856
+ "https://w3id.org/vc/status-list/2021/v1",
2857
+ vc_status_list_2021_v1_default
2858
+ ],
2859
+ [
2860
+ "https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld",
2861
+ lds_ecdsa_secp256k1_recovery2020_0_0_default
2862
+ ],
2863
+ [
2864
+ "https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-2.0.jsonld",
2865
+ w3id_org_security_suites_secp256k1recovery_2020_v2_default
2866
+ ],
2867
+ [
2868
+ "https://w3id.org/security/suites/secp256k1recovery-2020/v2",
2869
+ w3id_org_security_suites_secp256k1recovery_2020_v2_default
2870
+ ],
2871
+ [
2872
+ "https://w3id.org/security/suites/eip712sig-2021",
2873
+ eip712_default
2874
+ ],
2875
+ [
2876
+ "https://w3c-ccg.github.io/ethereum-eip712-signature-2021-spec/",
2877
+ eip712_default
2878
+ ]
2879
+ ]);
2880
+
2881
+ // src/agent/CredentialProviderJsonld.ts
2882
+ import { getAgentResolver as getAgentResolver2, mapIdentifierKeysToDocWithJwkSupport } from "@sphereon/ssi-sdk-ext.did-utils";
2883
+ import { asArray as asArray4, intersect } from "@sphereon/ssi-sdk.core";
2884
+ import { vcLibCheckStatusFunction } from "@sphereon/ssi-sdk.vc-status-list";
2885
+ import Debug3 from "debug";
2886
+ import { preProcessCredentialPayload, preProcessPresentation } from "@sphereon/ssi-sdk.credential-vcdm";
2887
+ var debug3 = Debug3("sphereon:ssi-sdk:ld-credential-module-local");
2888
+ var CredentialProviderJsonld = class {
2889
+ static {
2890
+ __name(this, "CredentialProviderJsonld");
2891
+ }
2892
+ ldCredentialModule;
2893
+ keyStore;
2894
+ constructor(options) {
2895
+ this.keyStore = options.keyStore;
2896
+ this.ldCredentialModule = new LdCredentialModule({
2897
+ ldContextLoader: new LdContextLoader({
2898
+ contextsPaths: options.contextMaps ?? [
2899
+ LdDefaultContexts
2900
+ ]
2901
+ }),
2902
+ ldSuiteLoader: new LdSuiteLoader({
2903
+ ldSignatureSuites: options.suites ?? [
2904
+ new SphereonEd25519Signature2020(),
2905
+ new SphereonEcdsaSecp256k1RecoverySignature2020()
2906
+ ]
2907
+ }),
2908
+ documentLoader: options?.documentLoader
2909
+ });
2910
+ }
2911
+ /** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.matchKeyForType} */
2912
+ matchKeyForType(key) {
2913
+ return this.matchKeyForLDSuite(key);
2914
+ }
2915
+ /** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.getTypeProofFormat} */
2916
+ getTypeProofFormat() {
2917
+ return "lds";
2918
+ }
2919
+ /** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.canIssueCredentialType} */
2920
+ canIssueCredentialType(args) {
2921
+ return args.proofFormat === "lds";
2922
+ }
2923
+ /** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.canVerifyDocumentType */
2924
+ canVerifyDocumentType(args) {
2925
+ const { document } = args;
2926
+ const proofType = document?.proof?.type ?? "_never_";
2927
+ for (const suite of this.ldCredentialModule.ldSuiteLoader.getAllSignatureSuites()) {
2928
+ if (suite.getSupportedProofType() === proofType) {
2929
+ return true;
2930
+ } else if (asArray4(suite.getSupportedVerificationType()).includes(proofType)) {
2931
+ return true;
2932
+ }
2933
+ }
2934
+ return false;
2935
+ }
2936
+ /** {@inheritDoc ICredentialIssuerLDLocal.createVerifiableCredential} */
2937
+ async createVerifiableCredential(args, context) {
2938
+ debug3("Entry of createVerifiableCredential");
2939
+ const { credential, issuer } = preProcessCredentialPayload(args);
2940
+ let identifier;
2941
+ try {
2942
+ debug3(`Retrieving identifier for issuer ${issuer} from DID manager...`);
2943
+ identifier = await context.agent.didManagerGet({
2944
+ did: issuer
2945
+ });
2946
+ debug3(`Identifier for issuer ${issuer} retrieved from DID manager`);
2947
+ } catch (e) {
2948
+ throw new Error(`invalid_argument: args.credential.issuer must be a DID managed by this agent. ${e}`);
2949
+ }
2950
+ try {
2951
+ const { managedKey, verificationMethod } = await this.getSigningKey(identifier, args.keyRef);
2952
+ const { signingKey, verificationMethodId } = await this.findSigningKeyWithId(context, identifier, {
2953
+ keyRef: args.keyRef
2954
+ });
2955
+ return await this.ldCredentialModule.issueLDVerifiableCredential({
2956
+ credential,
2957
+ issuerDid: identifier.did,
2958
+ key: managedKey ?? signingKey,
2959
+ verificationMethodId: verificationMethodId ?? verificationMethod,
2960
+ purpose: args.purpose,
2961
+ credentialStatusOpts: args.credentialStatusOpts
2962
+ }, context);
2963
+ } catch (error) {
2964
+ debug3(error);
2965
+ return Promise.reject(error);
2966
+ }
2967
+ }
2968
+ async getSigningKey(identifier, keyRef) {
2969
+ let managedKey;
2970
+ let verificationMethod;
2971
+ if (keyRef) {
2972
+ const k = await this.keyStore?.get({
2973
+ alias: keyRef
2974
+ });
2975
+ if (k?.privateKeyHex) {
2976
+ managedKey = {
2977
+ ...identifier.keys.find((k2) => k2.kid === keyRef),
2978
+ privateKeyHex: k.privateKeyHex
2979
+ };
2980
+ verificationMethod = `${identifier.did}#${managedKey.kid ? managedKey.kid : k.alias}`;
2981
+ }
2982
+ }
2983
+ return {
2984
+ managedKey,
2985
+ verificationMethod
2986
+ };
2987
+ }
2988
+ /** {@inheritdoc ICredentialIssuerLD.createVerifiablePresentationLD} */
2989
+ async createVerifiablePresentation(args, context) {
2990
+ const { presentation, holder } = preProcessPresentation(args);
2991
+ if (presentation.verifiableCredential) {
2992
+ const credentials = presentation.verifiableCredential.map((cred) => {
2993
+ if (typeof cred !== "string" && cred.proof?.jwt) {
2994
+ return cred.proof.jwt;
2995
+ } else {
2996
+ return cred;
2997
+ }
2998
+ });
2999
+ presentation.verifiableCredential = credentials;
3000
+ }
3001
+ delete presentation.issuanceDate;
3002
+ delete presentation.validFrom;
3003
+ let identifier;
3004
+ try {
3005
+ identifier = await context.agent.didManagerGet({
3006
+ did: holder
3007
+ });
3008
+ } catch (e) {
3009
+ throw new Error(`invalid_argument: args.presentation.holderDID ${holder} must be a DID managed by this agent`);
3010
+ }
3011
+ try {
3012
+ const { managedKey, verificationMethod } = await this.getSigningKey(identifier, args.keyRef);
3013
+ const { signingKey, verificationMethodId } = await this.findSigningKeyWithId(context, identifier, {
3014
+ keyRef: args.keyRef
3015
+ });
3016
+ return await this.ldCredentialModule.signLDVerifiablePresentation(presentation, identifier.did, managedKey || signingKey, verificationMethodId ? verificationMethodId : verificationMethod, args.challenge, args.domain, args.purpose, context);
3017
+ } catch (error) {
3018
+ debug3(error);
3019
+ return Promise.reject(error);
3020
+ }
3021
+ }
3022
+ /** {@inheritdoc ICredentialHandlerLDLocal.verifyCredential} */
3023
+ async verifyCredential(args, context) {
3024
+ const credential = args.credential;
3025
+ let checkStatus = args.checkStatus;
3026
+ if (typeof checkStatus !== "function" && (!args.statusList || args.statusList.disableCheckStatusList2021 !== true)) {
3027
+ checkStatus = vcLibCheckStatusFunction({
3028
+ ...args.statusList,
3029
+ verifyStatusListCredential: false
3030
+ });
3031
+ }
3032
+ return this.ldCredentialModule.verifyCredential(credential, context, args.fetchRemoteContexts, args.purpose, checkStatus);
3033
+ }
3034
+ /** {@inheritdoc ICredentialHandlerLDLocal.verifyPresentation} */
3035
+ async verifyPresentation(args, context) {
3036
+ const presentation = args.presentation;
3037
+ let checkStatus = args.checkStatus;
3038
+ if (typeof checkStatus !== "function" && args.statusList && !args.statusList.disableCheckStatusList2021) {
3039
+ checkStatus = vcLibCheckStatusFunction({
3040
+ ...args.statusList
3041
+ });
3042
+ }
3043
+ return this.ldCredentialModule.verifyPresentation(presentation, args.challenge, args.domain, context, args.fetchRemoteContexts, args.presentationPurpose, checkStatus);
3044
+ }
3045
+ async findSigningKeyWithId(context, identifier, opts) {
3046
+ const keyRef = opts?.keyRef;
3047
+ debug3(`Retrieving signing key for id ${identifier.did} keyref ${keyRef}...`);
3048
+ const didDocument = opts?.didDocument ?? await getAgentResolver2(context).resolve(identifier.did).then((result) => result.didDocument ?? void 0);
3049
+ const extendedKeys = await mapIdentifierKeysToDocWithJwkSupport({
3050
+ identifier,
3051
+ vmRelationship: "verificationMethod",
3052
+ didDocument
3053
+ }, context);
3054
+ const supportedTypes = this.ldCredentialModule.ldSuiteLoader.getAllSignatureSuiteTypes();
3055
+ let signingKey;
3056
+ if (keyRef) {
3057
+ signingKey = extendedKeys.find((k) => k.kid === keyRef);
3058
+ }
3059
+ if (signingKey && !supportedTypes.includes(signingKey.meta.verificationMethod.type)) {
3060
+ debug3("WARNING: requested signing key DOES NOT correspond to a supported Signature suite type. Looking for the next best key.");
3061
+ signingKey = void 0;
3062
+ }
3063
+ if (!signingKey) {
3064
+ if (keyRef) {
3065
+ debug3("WARNING: no signing key was found that matches the reference provided. Searching for the first available signing key.");
3066
+ }
3067
+ signingKey = extendedKeys.find((k) => supportedTypes.filter((value) => value.startsWith(k.meta.verificationMethod.type)));
3068
+ }
3069
+ if (!signingKey) throw Error(`key_not_found: No suitable signing key found for ${identifier.did}. ${JSON.stringify(didDocument)}`);
3070
+ const verificationMethodId = signingKey.meta.verificationMethod.id;
3071
+ debug3(`Signing key for id ${identifier.did} and verification method id ${verificationMethodId} found.`);
3072
+ return {
3073
+ signingKey,
3074
+ verificationMethodId
3075
+ };
3076
+ }
3077
+ /**
3078
+ * Returns true if the key is supported by any of the installed LD Signature suites
3079
+ * @param k - the key to match
3080
+ *
3081
+ * @internal
3082
+ */
3083
+ matchKeyForLDSuite(k) {
3084
+ switch (k.type) {
3085
+ case "Ed25519":
3086
+ if (!k.meta?.algorithms?.includes("EdDSA")) return false;
3087
+ break;
3088
+ case "Secp256k1":
3089
+ if (intersect(k.meta?.algorithms ?? [], [
3090
+ "ES256K-R",
3091
+ "ES256K"
3092
+ ]).length == 0) return false;
3093
+ break;
3094
+ }
3095
+ const suites = this.ldCredentialModule.ldSuiteLoader.getAllSignatureSuites();
3096
+ return suites.map((suite) => suite.getSupportedKeyType().includes(k.type)).some((supportsThisKey) => supportsThisKey);
3097
+ }
3098
+ };
3099
+ export {
3100
+ AssertionProofPurpose,
3101
+ AuthenticationProofPurpose,
3102
+ ControllerProofPurpose,
3103
+ CredentialProviderJsonld,
3104
+ LdContextLoader,
3105
+ LdCredentialModule,
3106
+ LdDefaultContexts,
3107
+ LdDocumentLoader,
3108
+ LdSuiteLoader,
3109
+ MethodNames,
3110
+ ProofPurpose,
3111
+ SphereonEcdsaSecp256k1RecoverySignature2020,
3112
+ SphereonEd25519Signature2018,
3113
+ SphereonEd25519Signature2020,
3114
+ SphereonLdSignature,
3115
+ events
3116
+ };
3117
+ //# sourceMappingURL=index.js.map