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