@nmshd/consumption 7.4.0 → 7.5.0-openid4vc.1

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 (87) hide show
  1. package/dist/buildInformation.js +5 -5
  2. package/dist/consumption/ConsumptionConfig.d.ts +1 -0
  3. package/dist/consumption/ConsumptionConfig.d.ts.map +1 -1
  4. package/dist/consumption/ConsumptionController.d.ts +3 -1
  5. package/dist/consumption/ConsumptionController.d.ts.map +1 -1
  6. package/dist/consumption/ConsumptionController.js +7 -1
  7. package/dist/consumption/ConsumptionController.js.map +1 -1
  8. package/dist/consumption/ConsumptionControllerName.d.ts +2 -1
  9. package/dist/consumption/ConsumptionControllerName.d.ts.map +1 -1
  10. package/dist/consumption/ConsumptionControllerName.js +1 -0
  11. package/dist/consumption/ConsumptionControllerName.js.map +1 -1
  12. package/dist/consumption/ConsumptionIds.d.ts +1 -0
  13. package/dist/consumption/ConsumptionIds.d.ts.map +1 -1
  14. package/dist/consumption/ConsumptionIds.js +1 -0
  15. package/dist/consumption/ConsumptionIds.js.map +1 -1
  16. package/dist/modules/index.d.ts +1 -0
  17. package/dist/modules/index.d.ts.map +1 -1
  18. package/dist/modules/index.js +1 -0
  19. package/dist/modules/index.js.map +1 -1
  20. package/dist/modules/openid4vc/OpenId4VcController.d.ts +36 -0
  21. package/dist/modules/openid4vc/OpenId4VcController.d.ts.map +1 -0
  22. package/dist/modules/openid4vc/OpenId4VcController.js +100 -0
  23. package/dist/modules/openid4vc/OpenId4VcController.js.map +1 -0
  24. package/dist/modules/openid4vc/index.d.ts +8 -0
  25. package/dist/modules/openid4vc/index.d.ts.map +1 -0
  26. package/dist/modules/openid4vc/index.js +24 -0
  27. package/dist/modules/openid4vc/index.js.map +1 -0
  28. package/dist/modules/openid4vc/local/BaseAgent.d.ts +17 -0
  29. package/dist/modules/openid4vc/local/BaseAgent.d.ts.map +1 -0
  30. package/dist/modules/openid4vc/local/BaseAgent.js +72 -0
  31. package/dist/modules/openid4vc/local/BaseAgent.js.map +1 -0
  32. package/dist/modules/openid4vc/local/EnmeshedHolderFileSystem.d.ts +14 -0
  33. package/dist/modules/openid4vc/local/EnmeshedHolderFileSystem.d.ts.map +1 -0
  34. package/dist/modules/openid4vc/local/EnmeshedHolderFileSystem.js +29 -0
  35. package/dist/modules/openid4vc/local/EnmeshedHolderFileSystem.js.map +1 -0
  36. package/dist/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.d.ts +33 -0
  37. package/dist/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.d.ts.map +1 -0
  38. package/dist/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.js +345 -0
  39. package/dist/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.js.map +1 -0
  40. package/dist/modules/openid4vc/local/EnmeshedStorageService.d.ts +25 -0
  41. package/dist/modules/openid4vc/local/EnmeshedStorageService.d.ts.map +1 -0
  42. package/dist/modules/openid4vc/local/EnmeshedStorageService.js +139 -0
  43. package/dist/modules/openid4vc/local/EnmeshedStorageService.js.map +1 -0
  44. package/dist/modules/openid4vc/local/Holder.d.ts +43 -0
  45. package/dist/modules/openid4vc/local/Holder.d.ts.map +1 -0
  46. package/dist/modules/openid4vc/local/Holder.js +184 -0
  47. package/dist/modules/openid4vc/local/Holder.js.map +1 -0
  48. package/dist/modules/openid4vc/local/KeyStorage.d.ts +12 -0
  49. package/dist/modules/openid4vc/local/KeyStorage.d.ts.map +1 -0
  50. package/dist/modules/openid4vc/local/KeyStorage.js +67 -0
  51. package/dist/modules/openid4vc/local/KeyStorage.js.map +1 -0
  52. package/dist/modules/openid4vc/local/OpenId4VciCredentialResponseJSON.d.ts +7 -0
  53. package/dist/modules/openid4vc/local/OpenId4VciCredentialResponseJSON.d.ts.map +1 -0
  54. package/dist/modules/openid4vc/local/OpenId4VciCredentialResponseJSON.js +3 -0
  55. package/dist/modules/openid4vc/local/OpenId4VciCredentialResponseJSON.js.map +1 -0
  56. package/dist/modules/openid4vc/local/RequestedCredentialCache.d.ts +9 -0
  57. package/dist/modules/openid4vc/local/RequestedCredentialCache.d.ts.map +1 -0
  58. package/dist/modules/openid4vc/local/RequestedCredentialCache.js +57 -0
  59. package/dist/modules/openid4vc/local/RequestedCredentialCache.js.map +1 -0
  60. package/dist/modules/requests/events/ShareCredentialOfferRequestItemProcessedByRecipientEvent.d.ts +12 -0
  61. package/dist/modules/requests/events/ShareCredentialOfferRequestItemProcessedByRecipientEvent.d.ts.map +1 -0
  62. package/dist/modules/requests/events/ShareCredentialOfferRequestItemProcessedByRecipientEvent.js +12 -0
  63. package/dist/modules/requests/events/ShareCredentialOfferRequestItemProcessedByRecipientEvent.js.map +1 -0
  64. package/dist/modules/requests/events/index.d.ts +1 -0
  65. package/dist/modules/requests/events/index.d.ts.map +1 -1
  66. package/dist/modules/requests/events/index.js +1 -0
  67. package/dist/modules/requests/events/index.js.map +1 -1
  68. package/dist/modules/requests/index.d.ts +3 -0
  69. package/dist/modules/requests/index.d.ts.map +1 -1
  70. package/dist/modules/requests/index.js +3 -0
  71. package/dist/modules/requests/index.js.map +1 -1
  72. package/dist/modules/requests/itemProcessors/shareAuthorizationRequest/AcceptShareAuthorizationRequestRequestItemParameters.d.ts +11 -0
  73. package/dist/modules/requests/itemProcessors/shareAuthorizationRequest/AcceptShareAuthorizationRequestRequestItemParameters.d.ts.map +1 -0
  74. package/dist/modules/requests/itemProcessors/shareAuthorizationRequest/AcceptShareAuthorizationRequestRequestItemParameters.js +29 -0
  75. package/dist/modules/requests/itemProcessors/shareAuthorizationRequest/AcceptShareAuthorizationRequestRequestItemParameters.js.map +1 -0
  76. package/dist/modules/requests/itemProcessors/shareAuthorizationRequest/ShareAuthorizationRequestRequestItemProcessor.d.ts +12 -0
  77. package/dist/modules/requests/itemProcessors/shareAuthorizationRequest/ShareAuthorizationRequestRequestItemProcessor.d.ts.map +1 -0
  78. package/dist/modules/requests/itemProcessors/shareAuthorizationRequest/ShareAuthorizationRequestRequestItemProcessor.js +55 -0
  79. package/dist/modules/requests/itemProcessors/shareAuthorizationRequest/ShareAuthorizationRequestRequestItemProcessor.js.map +1 -0
  80. package/dist/modules/requests/itemProcessors/shareCredentialOffer/ShareCredentialOfferRequestItemProcessor.d.ts +14 -0
  81. package/dist/modules/requests/itemProcessors/shareCredentialOffer/ShareCredentialOfferRequestItemProcessor.d.ts.map +1 -0
  82. package/dist/modules/requests/itemProcessors/shareCredentialOffer/ShareCredentialOfferRequestItemProcessor.js +45 -0
  83. package/dist/modules/requests/itemProcessors/shareCredentialOffer/ShareCredentialOfferRequestItemProcessor.js.map +1 -0
  84. package/dist/modules/requests/outgoing/OutgoingRequestsController.d.ts.map +1 -1
  85. package/dist/modules/requests/outgoing/OutgoingRequestsController.js +3 -1
  86. package/dist/modules/requests/outgoing/OutgoingRequestsController.js.map +1 -1
  87. package/package.json +31 -9
@@ -6,11 +6,11 @@ const content_1 = require("@nmshd/content");
6
6
  const crypto_1 = require("@nmshd/crypto");
7
7
  const transport_1 = require("@nmshd/transport");
8
8
  exports.buildInformation = {
9
- version: "7.4.0",
10
- build: "405",
11
- date: "2026-04-21T15:14:56+00:00",
12
- commit: "92df7fd91521291ad315a6b3ae27069688e4d716",
13
- dependencies: {"@js-soft/docdb-querytranslator":"^1.1.7","@js-soft/logging-abstractions":"^1.2.4","@js-soft/ts-serval":"2.0.17","@js-soft/ts-utils":"2.3.6","@nmshd/content":"*","@nmshd/core-types":"*","@nmshd/iql":"^1.0.5","@nmshd/transport":"*","lodash":"^4.18.1","ts-simple-nameof":"^1.3.3"},
9
+ version: "7.5.0-openid4vc.1",
10
+ build: "407",
11
+ date: "2026-05-07T14:43:16+00:00",
12
+ commit: "247036fcc19bf940fe3bc4757dd61238cd445641",
13
+ dependencies: {"@credo-ts/core":"^0.6.1","@credo-ts/openid4vc":"^0.6.1","@js-soft/docdb-querytranslator":"^1.1.7","@js-soft/ts-serval":"2.0.17","@js-soft/ts-utils":"2.3.6","@nmshd/content":"*","@nmshd/core-types":"*","@nmshd/iql":"^1.0.5","@nmshd/transport":"*","@noble/ciphers":"^2.0.1","jose":"^6.1.1","lodash":"^4.18.1","sjcl":"^1.0.8","ts-simple-nameof":"^1.3.3","ws":"^8.18.3"},
14
14
  libraries: {
15
15
  transport: transport_1.buildInformation,
16
16
  crypto: crypto_1.buildInformation,
@@ -1,4 +1,5 @@
1
1
  export interface ConsumptionConfig {
2
2
  setDefaultOwnIdentityAttributes: boolean;
3
+ fetchInstance?: typeof fetch;
3
4
  }
4
5
  //# sourceMappingURL=ConsumptionConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConsumptionConfig.d.ts","sourceRoot":"","sources":["../../src/consumption/ConsumptionConfig.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAC9B,+BAA+B,EAAE,OAAO,CAAC;CAC5C"}
1
+ {"version":3,"file":"ConsumptionConfig.d.ts","sourceRoot":"","sources":["../../src/consumption/ConsumptionConfig.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAC9B,+BAA+B,EAAE,OAAO,CAAC;IACzC,aAAa,CAAC,EAAE,OAAO,KAAK,CAAC;CAChC"}
@@ -1,6 +1,6 @@
1
1
  import { CoreAddress, CoreId } from "@nmshd/core-types";
2
2
  import { AccountController, Transport } from "@nmshd/transport";
3
- import { AttributesController, DraftsController, IdentityMetadataController, IncomingRequestsController, NotificationItemConstructor, NotificationItemProcessorConstructor, NotificationsController, OutgoingRequestsController, RequestItemConstructor, RequestItemProcessorConstructor, SettingsController } from "../modules";
3
+ import { AttributesController, DraftsController, IdentityMetadataController, IncomingRequestsController, NotificationItemConstructor, NotificationItemProcessorConstructor, NotificationsController, OpenId4VcController, OutgoingRequestsController, RequestItemConstructor, RequestItemProcessorConstructor, SettingsController } from "../modules";
4
4
  import { ConsumptionConfig } from "./ConsumptionConfig";
5
5
  export declare class ConsumptionController {
6
6
  readonly transport: Transport;
@@ -19,6 +19,8 @@ export declare class ConsumptionController {
19
19
  get settings(): SettingsController;
20
20
  private _notifications;
21
21
  get notifications(): NotificationsController;
22
+ private _openId4Vc;
23
+ get openId4Vc(): OpenId4VcController;
22
24
  private _identityMetadata;
23
25
  get identityMetadata(): IdentityMetadataController;
24
26
  init(requestItemProcessorOverrides?: Map<RequestItemConstructor, RequestItemProcessorConstructor>, notificationItemProcessorOverrides?: Map<NotificationItemConstructor, NotificationItemProcessorConstructor>): Promise<ConsumptionController>;
@@ -1 +1 @@
1
- {"version":3,"file":"ConsumptionController.d.ts","sourceRoot":"","sources":["../../src/consumption/ConsumptionController.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EACH,oBAAoB,EAGpB,gBAAgB,EAIhB,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,EAC3B,oCAAoC,EAEpC,uBAAuB,EACvB,0BAA0B,EAM1B,sBAAsB,EACtB,+BAA+B,EAE/B,kBAAkB,EAGrB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBAAa,qBAAqB;aAEV,SAAS,EAAE,SAAS;aACpB,iBAAiB,EAAE,iBAAiB;aACpC,iBAAiB,EAAE,iBAAiB;gBAFpC,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,iBAAiB;IAGxD,OAAO,CAAC,WAAW,CAAuB;IAC1C,IAAW,UAAU,IAAI,oBAAoB,CAE5C;IAED,OAAO,CAAC,OAAO,CAAmB;IAClC,IAAW,MAAM,IAAI,gBAAgB,CAEpC;IAED,OAAO,CAAC,iBAAiB,CAA6B;IACtD,IAAW,gBAAgB,IAAI,0BAA0B,CAExD;IAED,OAAO,CAAC,iBAAiB,CAA6B;IACtD,IAAW,gBAAgB,IAAI,0BAA0B,CAExD;IAED,OAAO,CAAC,SAAS,CAAqB;IACtC,IAAW,QAAQ,IAAI,kBAAkB,CAExC;IAED,OAAO,CAAC,cAAc,CAA0B;IAChD,IAAW,aAAa,IAAI,uBAAuB,CAElD;IAED,OAAO,CAAC,iBAAiB,CAA6B;IACtD,IAAW,gBAAgB,IAAI,0BAA0B,CAExD;IAEY,IAAI,CACb,6BAA6B,+DAAqE,EAClG,kCAAkC,yEAA+E,GAClH,OAAO,CAAC,qBAAqB,CAAC;IAoDjC,OAAO,CAAC,+BAA+B;IAcvC,OAAO,CAAC,oCAAoC;IAS/B,mCAAmC,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ7G"}
1
+ {"version":3,"file":"ConsumptionController.d.ts","sourceRoot":"","sources":["../../src/consumption/ConsumptionController.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EACH,oBAAoB,EAGpB,gBAAgB,EAIhB,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,EAC3B,oCAAoC,EAEpC,uBAAuB,EACvB,mBAAmB,EACnB,0BAA0B,EAM1B,sBAAsB,EACtB,+BAA+B,EAE/B,kBAAkB,EAKrB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBAAa,qBAAqB;aAEV,SAAS,EAAE,SAAS;aACpB,iBAAiB,EAAE,iBAAiB;aACpC,iBAAiB,EAAE,iBAAiB;gBAFpC,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,iBAAiB;IAGxD,OAAO,CAAC,WAAW,CAAuB;IAC1C,IAAW,UAAU,IAAI,oBAAoB,CAE5C;IAED,OAAO,CAAC,OAAO,CAAmB;IAClC,IAAW,MAAM,IAAI,gBAAgB,CAEpC;IAED,OAAO,CAAC,iBAAiB,CAA6B;IACtD,IAAW,gBAAgB,IAAI,0BAA0B,CAExD;IAED,OAAO,CAAC,iBAAiB,CAA6B;IACtD,IAAW,gBAAgB,IAAI,0BAA0B,CAExD;IAED,OAAO,CAAC,SAAS,CAAqB;IACtC,IAAW,QAAQ,IAAI,kBAAkB,CAExC;IAED,OAAO,CAAC,cAAc,CAA0B;IAChD,IAAW,aAAa,IAAI,uBAAuB,CAElD;IAED,OAAO,CAAC,UAAU,CAAsB;IACxC,IAAW,SAAS,IAAI,mBAAmB,CAE1C;IAED,OAAO,CAAC,iBAAiB,CAA6B;IACtD,IAAW,gBAAgB,IAAI,0BAA0B,CAExD;IAEY,IAAI,CACb,6BAA6B,+DAAqE,EAClG,kCAAkC,yEAA+E,GAClH,OAAO,CAAC,qBAAqB,CAAC;IAuDjC,OAAO,CAAC,+BAA+B;IAgBvC,OAAO,CAAC,oCAAoC;IAS/B,mCAAmC,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ7G"}
@@ -27,6 +27,9 @@ class ConsumptionController {
27
27
  get notifications() {
28
28
  return this._notifications;
29
29
  }
30
+ get openId4Vc() {
31
+ return this._openId4Vc;
32
+ }
30
33
  get identityMetadata() {
31
34
  return this._identityMetadata;
32
35
  }
@@ -46,6 +49,7 @@ class ConsumptionController {
46
49
  this._notifications = await new modules_1.NotificationsController(await this.accountController.getSynchronizedCollection("Notifications"), notificationItemProcessorRegistry, this, this.transport.eventBus, this.accountController.activeDevice).init();
47
50
  this._identityMetadata = await new modules_1.IdentityMetadataController(this).init();
48
51
  this._settings = await new modules_1.SettingsController(this).init();
52
+ this._openId4Vc = await new modules_1.OpenId4VcController(this).init();
49
53
  return this;
50
54
  }
51
55
  getDefaultRequestItemProcessors() {
@@ -58,7 +62,9 @@ class ConsumptionController {
58
62
  [content_1.ConsentRequestItem, modules_1.GenericRequestItemProcessor],
59
63
  [content_1.AuthenticationRequestItem, modules_1.GenericRequestItemProcessor],
60
64
  [content_1.FormFieldRequestItem, modules_1.FormFieldRequestItemProcessor],
61
- [content_1.TransferFileOwnershipRequestItem, modules_1.TransferFileOwnershipRequestItemProcessor]
65
+ [content_1.TransferFileOwnershipRequestItem, modules_1.TransferFileOwnershipRequestItemProcessor],
66
+ [content_1.ShareCredentialOfferRequestItem, modules_1.ShareCredentialOfferRequestItemProcessor],
67
+ [content_1.ShareAuthorizationRequestRequestItem, modules_1.ShareAuthorizationRequestRequestItemProcessor]
62
68
  ]);
63
69
  }
64
70
  getDefaultNotificationItemProcessors() {
@@ -1 +1 @@
1
- {"version":3,"file":"ConsumptionController.js","sourceRoot":"","sources":["../../src/consumption/ConsumptionController.ts"],"names":[],"mappings":";;;AAAA,4CAcwB;AAGxB,wCA0BoB;AAGpB,MAAa,qBAAqB;IAC9B,YACoB,SAAoB,EACpB,iBAAoC,EACpC,iBAAoC;QAFpC,cAAS,GAAT,SAAS,CAAW;QACpB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,sBAAiB,GAAjB,iBAAiB,CAAmB;IACrD,CAAC;IAGJ,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAGD,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAGD,IAAW,gBAAgB;QACvB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IAGD,IAAW,gBAAgB;QACvB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IAGD,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAGD,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAGD,IAAW,gBAAgB;QACvB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IA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AAsC,EAAE,yDAA+C,CAAC;YACzF,CAAC,oDAA0C,EAAE,6DAAmD,CAAC;YACjG,CAAC,gEAAsD,EAAE,yEAA+D,CAAC;YACzH,CAAC,yDAA+C,EAAE,kEAAwD,CAAC;SAC9G,CAAC,CAAC;IACP,CAAC;IAEM,KAAK,CAAC,mCAAmC,CAAC,IAAiB,EAAE,cAAsB;QACtF,MAAM,IAAI,CAAC,UAAU,CAAC,iCAAiC,CAAC,IAAI,CAAC,CAAC;QAC9D,MAAM,IAAI,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACvD,MAAM,IAAI,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;QACzD,MAAM,IAAI,CAAC,QAAQ,CAAC,6BAA6B,CAAC,cAAc,CAAC,CAAC;QAClE,MAAM,IAAI,CAAC,aAAa,CAAC,oCAAoC,CAAC,IAAI,CAAC,CAAC;QACpE,MAAM,IAAI,CAAC,gBAAgB,CAAC,wCAAwC,CAAC,IAAI,CAAC,CAAC;IAC/E,CAAC;CACJ;AAhID,sDAgIC"}
1
+ {"version":3,"file":"ConsumptionController.js","sourceRoot":"","sources":["../../src/consumption/ConsumptionController.ts"],"names":[],"mappings":";;;AAAA,4CAgBwB;AAGxB,wCA6BoB;AAGpB,MAAa,qBAAqB;IAC9B,YACoB,SAAoB,EACpB,iBAAoC,EACpC,iBAAoC;QAFpC,cAAS,GAAT,SAAS,CAAW;QACpB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,sBAAiB,GAAjB,iBAAiB,CAAmB;IACrD,CAAC;IAGJ,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAGD,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAGD,IAAW,gBAAgB;QACvB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IAGD,IAAW,gBAAgB;QACvB,OAAO,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sController = "RequestsController",
5
5
  SettingsController = "SettingsController",
6
6
  NotificationsController = "NotificationsController",
7
- IdentityMetadataController = "IdentityMetadataController"
7
+ IdentityMetadataController = "IdentityMetadataController",
8
+ OpenId4VcController = "OpenId4VcController"
8
9
  }
9
10
  //# sourceMappingURL=ConsumptionControllerName.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConsumptionControllerName.d.ts","sourceRoot":"","sources":["../../src/consumption/ConsumptionControllerName.ts"],"names":[],"mappings":"AAAA,oBAAY,yBAAyB;IACjC,oBAAoB,yBAAyB;IAC7C,gBAAgB,qBAAqB;IACrC,kBAAkB,uBAAuB;IACzC,kBAAkB,uBAAuB;IACzC,uBAAuB,4BAA4B;IACnD,0BAA0B,+BAA+B;CAC5D"}
1
+ {"version":3,"file":"ConsumptionControllerName.d.ts","sourceRoot":"","sources":["../../src/consumption/ConsumptionControllerName.ts"],"names":[],"mappings":"AAAA,oBAAY,yBAAyB;IACjC,oBAAoB,yBAAyB;IAC7C,gBAAgB,qBAAqB;IACrC,kBAAkB,uBAAuB;IACzC,kBAAkB,uBAAuB;IACzC,uBAAuB,4BAA4B;IACnD,0BAA0B,+BAA+B;IACzD,mBAAmB,wBAAwB;CAC9C"}
@@ -9,5 +9,6 @@ var ConsumptionControllerName;
9
9
  ConsumptionControllerName["SettingsController"] = "SettingsController";
10
10
  ConsumptionControllerName["NotificationsController"] = "NotificationsController";
11
11
  ConsumptionControllerName["IdentityMetadataController"] = "IdentityMetadataController";
12
+ ConsumptionControllerName["OpenId4VcController"] = "OpenId4VcController";
12
13
  })(ConsumptionControllerName || (exports.ConsumptionControllerName = ConsumptionControllerName = {}));
13
14
  //# sourceMappingURL=ConsumptionControllerName.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConsumptionControllerName.js","sourceRoot":"","sources":["../../src/consumption/ConsumptionControllerName.ts"],"names":[],"mappings":";;;AAAA,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACjC,0EAA6C,CAAA;IAC7C,kEAAqC,CAAA;IACrC,sEAAyC,CAAA;IACzC,sEAAyC,CAAA;IACzC,gFAAmD,CAAA;IACnD,sFAAyD,CAAA;AAC7D,CAAC,EAPW,yBAAyB,yCAAzB,yBAAyB,QAOpC"}
1
+ {"version":3,"file":"ConsumptionControllerName.js","sourceRoot":"","sources":["../../src/consumption/ConsumptionControllerName.ts"],"names":[],"mappings":";;;AAAA,IAAY,yBAQX;AARD,WAAY,yBAAyB;IACjC,0EAA6C,CAAA;IAC7C,kEAAqC,CAAA;IACrC,sEAAyC,CAAA;IACzC,sEAAyC,CAAA;IACzC,gFAAmD,CAAA;IACnD,sFAAyD,CAAA;IACzD,wEAA2C,CAAA;AAC/C,CAAC,EARW,yBAAyB,yCAAzB,yBAAyB,QAQpC"}
@@ -2,6 +2,7 @@ import { CoreIdHelper } from "@nmshd/core-types";
2
2
  export declare class ConsumptionIds {
3
3
  static readonly draft: CoreIdHelper;
4
4
  static readonly setting: CoreIdHelper;
5
+ static readonly requestedCredentialCacheEntry: CoreIdHelper;
5
6
  static readonly attribute: CoreIdHelper;
6
7
  static readonly attributeForwardingDetails: CoreIdHelper;
7
8
  static readonly request: CoreIdHelper;
@@ -1 +1 @@
1
- {"version":3,"file":"ConsumptionIds.d.ts","sourceRoot":"","sources":["../../src/consumption/ConsumptionIds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBAAa,cAAc;IACvB,gBAAuB,KAAK,eAA8B;IAC1D,gBAAuB,OAAO,eAA8B;IAE5D,gBAAuB,SAAS,eAA2B;IAC3D,gBAAuB,0BAA0B,eAA6B;IAC9E,gBAAuB,OAAO,eAA2B;IACzD,gBAAuB,YAAY,eAA2B;IAC9D,gBAAuB,gBAAgB,eAA2B;CACrE"}
1
+ {"version":3,"file":"ConsumptionIds.d.ts","sourceRoot":"","sources":["../../src/consumption/ConsumptionIds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBAAa,cAAc;IACvB,gBAAuB,KAAK,eAA8B;IAC1D,gBAAuB,OAAO,eAA8B;IAC5D,gBAAuB,6BAA6B,eAA8B;IAElF,gBAAuB,SAAS,eAA2B;IAC3D,gBAAuB,0BAA0B,eAA6B;IAC9E,gBAAuB,OAAO,eAA2B;IACzD,gBAAuB,YAAY,eAA2B;IAC9D,gBAAuB,gBAAgB,eAA2B;CACrE"}
@@ -5,6 +5,7 @@ const core_types_1 = require("@nmshd/core-types");
5
5
  class ConsumptionIds {
6
6
  static { this.draft = new core_types_1.CoreIdHelper("LCLDRF"); }
7
7
  static { this.setting = new core_types_1.CoreIdHelper("LCLSET"); }
8
+ static { this.requestedCredentialCacheEntry = new core_types_1.CoreIdHelper("LCLRCC"); }
8
9
  static { this.attribute = new core_types_1.CoreIdHelper("ATT"); }
9
10
  static { this.attributeForwardingDetails = new core_types_1.CoreIdHelper("ATTFD"); }
10
11
  static { this.request = new core_types_1.CoreIdHelper("REQ"); }
@@ -1 +1 @@
1
- {"version":3,"file":"ConsumptionIds.js","sourceRoot":"","sources":["../../src/consumption/ConsumptionIds.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AAEjD,MAAa,cAAc;aACA,UAAK,GAAG,IAAI,yBAAY,CAAC,QAAQ,CAAC,CAAC;aACnC,YAAO,GAAG,IAAI,yBAAY,CAAC,QAAQ,CAAC,CAAC;aAErC,cAAS,GAAG,IAAI,yBAAY,CAAC,KAAK,CAAC,CAAC;aACpC,+BAA0B,GAAG,IAAI,yBAAY,CAAC,OAAO,CAAC,CAAC;aACvD,YAAO,GAAG,IAAI,yBAAY,CAAC,KAAK,CAAC,CAAC;aAClC,iBAAY,GAAG,IAAI,yBAAY,CAAC,KAAK,CAAC,CAAC;aACvC,qBAAgB,GAAG,IAAI,yBAAY,CAAC,KAAK,CAAC,CAAC;;AARtE,wCASC"}
1
+ {"version":3,"file":"ConsumptionIds.js","sourceRoot":"","sources":["../../src/consumption/ConsumptionIds.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AAEjD,MAAa,cAAc;aACA,UAAK,GAAG,IAAI,yBAAY,CAAC,QAAQ,CAAC,CAAC;aACnC,YAAO,GAAG,IAAI,yBAAY,CAAC,QAAQ,CAAC,CAAC;aACrC,kCAA6B,GAAG,IAAI,yBAAY,CAAC,QAAQ,CAAC,CAAC;aAE3D,cAAS,GAAG,IAAI,yBAAY,CAAC,KAAK,CAAC,CAAC;aACpC,+BAA0B,GAAG,IAAI,yBAAY,CAAC,OAAO,CAAC,CAAC;aACvD,YAAO,GAAG,IAAI,yBAAY,CAAC,KAAK,CAAC,CAAC;aAClC,iBAAY,GAAG,IAAI,yBAAY,CAAC,KAAK,CAAC,CAAC;aACvC,qBAAgB,GAAG,IAAI,yBAAY,CAAC,KAAK,CAAC,CAAC;;AATtE,wCAUC"}
@@ -3,6 +3,7 @@ export * from "./common";
3
3
  export * from "./drafts";
4
4
  export * from "./identityMetadata";
5
5
  export * from "./notifications";
6
+ export * from "./openid4vc";
6
7
  export * from "./requests";
7
8
  export * from "./settings";
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
@@ -19,6 +19,7 @@ __exportStar(require("./common"), exports);
19
19
  __exportStar(require("./drafts"), exports);
20
20
  __exportStar(require("./identityMetadata"), exports);
21
21
  __exportStar(require("./notifications"), exports);
22
+ __exportStar(require("./openid4vc"), exports);
22
23
  __exportStar(require("./requests"), exports);
23
24
  __exportStar(require("./settings"), exports);
24
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2CAAyB;AACzB,2CAAyB;AACzB,qDAAmC;AACnC,kDAAgC;AAChC,6CAA2B;AAC3B,6CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2CAAyB;AACzB,2CAAyB;AACzB,qDAAmC;AACnC,kDAAgC;AAChC,8CAA4B;AAC5B,6CAA2B;AAC3B,6CAA2B"}
@@ -0,0 +1,36 @@
1
+ import { OpenId4VciResolvedCredentialOffer, OpenId4VpResolvedAuthorizationRequest } from "@credo-ts/openid4vc";
2
+ import { TokenContentVerifiablePresentation, VerifiableCredential } from "@nmshd/content";
3
+ import { ConsumptionBaseController } from "../../consumption/ConsumptionBaseController";
4
+ import { ConsumptionController } from "../../consumption/ConsumptionController";
5
+ import { OwnIdentityAttribute } from "../attributes";
6
+ import { OpenId4VciCredentialResponseJSON } from "./local/OpenId4VciCredentialResponseJSON";
7
+ export declare class OpenId4VcController extends ConsumptionBaseController {
8
+ private holder;
9
+ private requestedCredentialCache;
10
+ constructor(parent: ConsumptionController);
11
+ init(): Promise<this>;
12
+ private get fetchInstance();
13
+ requestAllCredentialsFromCredentialOfferUrl(credentialOfferUrl: string): Promise<OpenId4VciCredentialResponseJSON[]>;
14
+ resolveCredentialOffer(credentialOfferUrl: string): Promise<OpenId4VciResolvedCredentialOffer>;
15
+ requestCredentials(credentialOffer: OpenId4VciResolvedCredentialOffer, credentialConfigurationIds: string[], access: {
16
+ pinCode?: string;
17
+ } | {
18
+ accessToken: string;
19
+ }): Promise<OpenId4VciCredentialResponseJSON[]>;
20
+ storeCredentials(credentialResponses: OpenId4VciCredentialResponseJSON[]): Promise<OwnIdentityAttribute>;
21
+ resolveAuthorizationRequest(authorizationRequestUrl: string): Promise<{
22
+ authorizationRequest: OpenId4VpResolvedAuthorizationRequest;
23
+ matchingCredentials: OwnIdentityAttribute[];
24
+ }>;
25
+ private extractMatchingCredentialsFromAuthorizationRequest;
26
+ acceptAuthorizationRequest(authorizationRequest: OpenId4VpResolvedAuthorizationRequest, credential: OwnIdentityAttribute): Promise<{
27
+ status: number;
28
+ message: string | Record<string, unknown> | null;
29
+ }>;
30
+ createPresentationTokenContent(credential: VerifiableCredential, nonce: string): Promise<TokenContentVerifiablePresentation>;
31
+ verifyPresentationTokenContent(tokenContent: TokenContentVerifiablePresentation, expectedNonce: string): Promise<{
32
+ isValid: boolean;
33
+ error?: Error;
34
+ }>;
35
+ }
36
+ //# sourceMappingURL=OpenId4VcController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenId4VcController.d.ts","sourceRoot":"","sources":["../../../src/modules/openid4vc/OpenId4VcController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,qCAAqC,EAAE,MAAM,qBAAqB,CAAC;AAC/G,OAAO,EAAE,kCAAkC,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAEhF,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;AAG5F,qBAAa,mBAAoB,SAAQ,yBAAyB;IAC9D,OAAO,CAAC,MA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AE,CAAC;CAGrK"}
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenId4VcController = void 0;
4
+ const ConsumptionBaseController_1 = require("../../consumption/ConsumptionBaseController");
5
+ const ConsumptionControllerName_1 = require("../../consumption/ConsumptionControllerName");
6
+ const Holder_1 = require("./local/Holder");
7
+ const KeyStorage_1 = require("./local/KeyStorage");
8
+ const RequestedCredentialCache_1 = require("./local/RequestedCredentialCache");
9
+ class OpenId4VcController extends ConsumptionBaseController_1.ConsumptionBaseController {
10
+ constructor(parent) {
11
+ super(ConsumptionControllerName_1.ConsumptionControllerName.OpenId4VcController, parent);
12
+ }
13
+ async init() {
14
+ const keyCollection = await this.parent.accountController.getSynchronizedCollection("openid4vc-keys");
15
+ const keyStorage = new KeyStorage_1.KeyStorage(keyCollection, this._log);
16
+ this.holder = new Holder_1.Holder(keyStorage, this.parent.accountController, this.parent.attributes, this.fetchInstance);
17
+ await this.holder.initializeAgent("96213c3d7fc8d4d6754c7a0fd969598e");
18
+ const requestedCredentialsCacheCollection = await this.parent.accountController.getSynchronizedCollection("openid4vc-requested-credentials-cache");
19
+ this.requestedCredentialCache = new RequestedCredentialCache_1.RequestedCredentialCache(requestedCredentialsCacheCollection);
20
+ return this;
21
+ }
22
+ get fetchInstance() {
23
+ return this.parent.consumptionConfig.fetchInstance ?? fetch;
24
+ }
25
+ async requestAllCredentialsFromCredentialOfferUrl(credentialOfferUrl) {
26
+ const cachedCredentialResponses = await this.requestedCredentialCache.get(credentialOfferUrl);
27
+ if (cachedCredentialResponses)
28
+ return cachedCredentialResponses;
29
+ const offer = await this.resolveCredentialOffer(credentialOfferUrl);
30
+ const credentialResponses = await this.requestCredentials(offer, offer.credentialOfferPayload.credential_configuration_ids, { pinCode: undefined });
31
+ await this.requestedCredentialCache.set(credentialOfferUrl, credentialResponses);
32
+ await this.parent.accountController.syncDatawallet();
33
+ return credentialResponses;
34
+ }
35
+ async resolveCredentialOffer(credentialOfferUrl) {
36
+ return await this.holder.resolveCredentialOffer(credentialOfferUrl);
37
+ }
38
+ async requestCredentials(credentialOffer, credentialConfigurationIds, access) {
39
+ const credentialResponses = await this.holder.requestCredentials(credentialOffer, credentialConfigurationIds, access);
40
+ const mappedResponses = credentialResponses.map((response) => ({
41
+ claimFormat: response.record.firstCredential.claimFormat,
42
+ encoded: response.record.firstCredential.encoded,
43
+ displayInformation: response.credentialConfiguration.credential_metadata?.display ?? response.credentialConfiguration.display
44
+ }));
45
+ return mappedResponses;
46
+ }
47
+ async storeCredentials(credentialResponses) {
48
+ const credentials = await this.holder.storeCredentials(credentialResponses);
49
+ // TODO: support multiple credentials
50
+ return credentials[0];
51
+ }
52
+ async resolveAuthorizationRequest(authorizationRequestUrl) {
53
+ const authorizationRequest = await this.holder.resolveAuthorizationRequest(authorizationRequestUrl);
54
+ const matchingCredentials = await this.extractMatchingCredentialsFromAuthorizationRequest(authorizationRequest);
55
+ return {
56
+ authorizationRequest,
57
+ matchingCredentials
58
+ };
59
+ }
60
+ async extractMatchingCredentialsFromAuthorizationRequest(authorizationRequest) {
61
+ const dcqlSatisfied = authorizationRequest.dcql?.queryResult.can_be_satisfied ?? false;
62
+ const pexSatisfied = authorizationRequest.presentationExchange?.credentialsForRequest.areRequirementsSatisfied ?? false;
63
+ if (!dcqlSatisfied && !pexSatisfied)
64
+ return [];
65
+ let matchedCredentials = [];
66
+ if (dcqlSatisfied) {
67
+ const queryId = authorizationRequest.dcql.queryResult.credentials[0].id; // assume there is only one query for now
68
+ const queryResult = authorizationRequest.dcql.queryResult.credential_matches[queryId];
69
+ if (queryResult.success) {
70
+ matchedCredentials = queryResult.valid_credentials.map((vc) => vc.record.encoded).flat();
71
+ }
72
+ }
73
+ else if (pexSatisfied) {
74
+ matchedCredentials = authorizationRequest
75
+ .presentationExchange.credentialsForRequest.requirements.map((entry) => entry.submissionEntry.map((subEntry) => subEntry.verifiableCredentials.map((vc) => vc.credentialRecord.encoded)).flat())
76
+ .flat();
77
+ }
78
+ const allCredentials = (await this.parent.attributes.getLocalAttributes({
79
+ "@type": "OwnIdentityAttribute",
80
+ "content.value.@type": "VerifiableCredential"
81
+ }));
82
+ const matchingCredentials = allCredentials.filter((credential) => matchedCredentials.includes(credential.content.value.value)); // in current demo scenarios this is a string
83
+ return matchingCredentials;
84
+ }
85
+ async acceptAuthorizationRequest(authorizationRequest, credential) {
86
+ // parse the credential type to be sdjwt
87
+ const serverResponse = await this.holder.acceptAuthorizationRequest(authorizationRequest, credential);
88
+ if (!serverResponse)
89
+ throw new Error("No response from server");
90
+ return { status: serverResponse.status, message: serverResponse.body };
91
+ }
92
+ async createPresentationTokenContent(credential, nonce) {
93
+ return await this.holder.createPresentationTokenContent(credential, nonce);
94
+ }
95
+ async verifyPresentationTokenContent(tokenContent, expectedNonce) {
96
+ return await this.holder.verifyPresentationTokenContent(tokenContent, expectedNonce);
97
+ }
98
+ }
99
+ exports.OpenId4VcController = OpenId4VcController;
100
+ //# sourceMappingURL=OpenId4VcController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenId4VcController.js","sourceRoot":"","sources":["../../../src/modules/openid4vc/OpenId4VcController.ts"],"names":[],"mappings":";;;AAGA,2FAAwF;AAExF,2FAAwF;AAExF,2CAAwC;AACxC,mDAAgD;AAEhD,+EAA4E;AAE5E,MAAa,mBAAoB,SAAQ,qDAAyB;IAI9D,YAAmB,MAA6B;QAC5C,KAAK,CAAC,qDAAyB,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;IAEe,KAAK,CAAC,IAAI;QACtB,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,CAAC;QACtG,MAAM,UAAU,GAAG,IAAI,uBAAU,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAE5D,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,CAAC,UAAU,EA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AC,UAAU,EAAE,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAE,UAAU,CAAC,OAAO,CAAC,KAA8B,CAAC,KAAe,CAAC,CAAC,CAAC,CAAC,6CAA6C;QACjN,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,KAAK,CAAC,0BAA0B,CACnC,oBAA2D,EAC3D,UAAgC;QAEhC,wCAAwC;QAExC,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;QACtG,IAAI,CAAC,cAAc;YAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAEhE,OAAO,EAAE,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,IAAI,EAAE,CAAC;IAC3E,CAAC;IAEM,KAAK,CAAC,8BAA8B,CAAC,UAAgC,EAAE,KAAa;QACvF,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,8BAA8B,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAC/E,CAAC;IAEM,KAAK,CAAC,8BAA8B,CAAC,YAAgD,EAAE,aAAqB;QAC/G,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,8BAA8B,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IACzF,CAAC;CACJ;AA/HD,kDA+HC"}
@@ -0,0 +1,8 @@
1
+ export * from "./local/BaseAgent";
2
+ export * from "./local/EnmeshedHolderFileSystem";
3
+ export * from "./local/EnmeshedHolderKeyManagmentService";
4
+ export * from "./local/EnmeshedStorageService";
5
+ export * from "./local/Holder";
6
+ export * from "./local/OpenId4VciCredentialResponseJSON";
7
+ export * from "./OpenId4VcController";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/openid4vc/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0CAA0C,CAAC;AACzD,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./local/BaseAgent"), exports);
18
+ __exportStar(require("./local/EnmeshedHolderFileSystem"), exports);
19
+ __exportStar(require("./local/EnmeshedHolderKeyManagmentService"), exports);
20
+ __exportStar(require("./local/EnmeshedStorageService"), exports);
21
+ __exportStar(require("./local/Holder"), exports);
22
+ __exportStar(require("./local/OpenId4VciCredentialResponseJSON"), exports);
23
+ __exportStar(require("./OpenId4VcController"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/openid4vc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,mEAAiD;AACjD,4EAA0D;AAC1D,iEAA+C;AAC/C,iDAA+B;AAC/B,2EAAyD;AACzD,wDAAsC"}
@@ -0,0 +1,17 @@
1
+ import { Agent, DidKey, type InitConfig, type ModulesMap, type VerificationMethod } from "@credo-ts/core";
2
+ import { AccountController } from "@nmshd/transport";
3
+ import { AttributesController } from "../../attributes";
4
+ import { KeyStorage } from "./KeyStorage";
5
+ export declare class BaseAgent<AgentModules extends ModulesMap> {
6
+ private readonly keyStorage;
7
+ config: InitConfig;
8
+ agent: Agent<AgentModules>;
9
+ did: string;
10
+ didKey: DidKey;
11
+ kid: string;
12
+ verificationMethod: VerificationMethod;
13
+ constructor(keyStorage: KeyStorage, modules: AgentModules, accountController: AccountController, attributeController: AttributesController, fetchInstance: typeof fetch);
14
+ initializeAgent(privateKey: string): Promise<void>;
15
+ shutdown(): Promise<void>;
16
+ }
17
+ //# sourceMappingURL=BaseAgent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseAgent.d.ts","sourceRoot":"","sources":["../../../../src/modules/openid4vc/local/BaseAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EAGL,MAAM,EAKN,KAAK,UAAU,EAEf,KAAK,UAAU,EACf,KAAK,kBAAkB,EAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAIxD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,qBAAa,SAAS,CAAC,YAAY,SAAS,UAAU;IAS9C,OAAO,CAAC,QAAQ,CAAC,UAAU;IARxB,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAC3B,GAAG,EAAG,MAAM,CAAC;IACb,MAAM,EAAG,MAAM,CAAC;IAChB,GAAG,EAAG,MAAM,CAAC;IACb,kBAAkB,EAAG,kBAAkB,CAAC;gBAG1B,UAAU,EAAE,UAAU,EACvC,OAAO,EAAE,YAAY,EACrB,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,EAAE,oBAAoB,EACzC,aAAa,EAAE,OAAO,KAAK;IA6BlB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmClD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAGzC"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.BaseAgent = void 0;
7
+ const core_1 = require("@credo-ts/core");
8
+ const events_1 = require("events");
9
+ const ws_1 = __importDefault(require("ws"));
10
+ const EnmeshedHolderFileSystem_1 = require("./EnmeshedHolderFileSystem");
11
+ const EnmeshedHolderKeyManagmentService_1 = require("./EnmeshedHolderKeyManagmentService");
12
+ const EnmeshedStorageService_1 = require("./EnmeshedStorageService");
13
+ class BaseAgent {
14
+ constructor(keyStorage, modules, accountController, attributeController, fetchInstance) {
15
+ this.keyStorage = keyStorage;
16
+ const config = {
17
+ allowInsecureHttpUrls: true,
18
+ logger: new core_1.ConsoleLogger(core_1.LogLevel.off)
19
+ };
20
+ this.config = config;
21
+ const dependencyManager = new core_1.DependencyManager();
22
+ dependencyManager.registerInstance(core_1.InjectionSymbols.StorageService, new EnmeshedStorageService_1.EnmeshedStorageService(accountController, attributeController, this.keyStorage));
23
+ this.agent = new core_1.Agent({
24
+ config,
25
+ dependencies: {
26
+ // eslint-disable-next-line @typescript-eslint/naming-convention
27
+ FileSystem: EnmeshedHolderFileSystem_1.EnmeshedHolderFileSystem,
28
+ // eslint-disable-next-line @typescript-eslint/naming-convention
29
+ EventEmitterClass: events_1.EventEmitter,
30
+ fetch: fetchInstance,
31
+ // eslint-disable-next-line @typescript-eslint/naming-convention
32
+ WebSocketClass: ws_1.default
33
+ },
34
+ modules
35
+ }, dependencyManager);
36
+ }
37
+ async initializeAgent(privateKey) {
38
+ // as we are not using askar we need to set the storage version
39
+ const storage = this.agent.dependencyManager.resolve(core_1.InjectionSymbols.StorageService);
40
+ await storage.save(this.agent.context, new core_1.StorageVersionRecord({ storageVersion: "0.5.0" }));
41
+ const kmsConfig = this.agent.dependencyManager.resolve(core_1.Kms.KeyManagementModuleConfig);
42
+ kmsConfig.registerBackend(new EnmeshedHolderKeyManagmentService_1.EnmshedHolderKeyManagmentService(this.keyStorage));
43
+ if (kmsConfig.backends.length === 0)
44
+ throw new Error("No KMS backend registered");
45
+ await this.agent.initialize();
46
+ const keyId = privateKey;
47
+ const didCreateResult = await this.agent.dids.create({
48
+ method: "key",
49
+ options: {
50
+ createKey: {
51
+ type: {
52
+ crv: "Ed25519",
53
+ kty: "OKP"
54
+ },
55
+ keyId: keyId
56
+ }
57
+ }
58
+ });
59
+ this.did = didCreateResult.didState.did;
60
+ this.didKey = core_1.DidKey.fromDid(this.did);
61
+ this.kid = `${this.did}#${this.didKey.publicJwk.fingerprint}`;
62
+ const verificationMethod = didCreateResult.didState.didDocument?.dereferenceKey(this.kid, ["authentication"]);
63
+ if (!verificationMethod)
64
+ throw new Error("No verification method found");
65
+ this.verificationMethod = verificationMethod;
66
+ }
67
+ async shutdown() {
68
+ await this.agent.shutdown();
69
+ }
70
+ }
71
+ exports.BaseAgent = BaseAgent;
72
+ //# sourceMappingURL=BaseAgent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseAgent.js","sourceRoot":"","sources":["../../../../src/modules/openid4vc/local/BaseAgent.ts"],"names":[],"mappings":";;;;;;AAAA,yCAawB;AAExB,mCAAsC;AACtC,4CAA2B;AAE3B,yEAAsE;AACtE,2FAAuF;AACvF,qEAAkE;AAGlE,MAAa,SAAS;IAQlB,YACqB,UAAsB,EACvC,OAAqB,EACrB,iBAAoC,EACpC,mBAAyC,EACzC,aAA2B;QAJV,eAAU,GAAV,UAAU,CAAY;QAMvC,MAAM,MAAM,GAAG;YACX,qBAAqB,EAAE,IAAI;YAC3B,MAAM,EAAE,IAAI,oBAAa,CAAC,eAAQ,CAAC,GAAG,CAAC;SACrB,CAAC;QAEvB,IAAI,C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,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAsB;YACtE,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;gBACL,SAAS,EAAE;oBACP,IAAI,EAAE;wBACF,GAAG,EAAE,SAAS;wBACd,GAAG,EAAE,KAAK;qBACb;oBACD,KAAK,EAAE,KAAK;iBACf;aACJ;SACJ,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,GAAG,eAAe,CAAC,QAAQ,CAAC,GAAI,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,aAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;QAE9D,MAAM,kBAAkB,GAAG,eAAe,CAAC,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC9G,IAAI,CAAC,kBAAkB;YAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACzE,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IACjD,CAAC;IAEM,KAAK,CAAC,QAAQ;QACjB,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC;CACJ;AAhFD,8BAgFC"}
@@ -0,0 +1,14 @@
1
+ import { DownloadToFileOptions, FileSystem } from "@credo-ts/core";
2
+ export declare class EnmeshedHolderFileSystem implements FileSystem {
3
+ exists(_path: string): Promise<boolean>;
4
+ createDirectory(_path: string): Promise<void>;
5
+ copyFile(_sourcePath: string, _destinationPath: string): Promise<void>;
6
+ write(_path: string, _data: string): Promise<void>;
7
+ read(_path: string): Promise<string>;
8
+ delete(_path: string): Promise<void>;
9
+ downloadToFile(_url: string, _path: string, _options?: DownloadToFileOptions): Promise<void>;
10
+ readonly dataPath: string;
11
+ readonly cachePath: string;
12
+ readonly tempPath: string;
13
+ }
14
+ //# sourceMappingURL=EnmeshedHolderFileSystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnmeshedHolderFileSystem.d.ts","sourceRoot":"","sources":["../../../../src/modules/openid4vc/local/EnmeshedHolderFileSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGnE,qBAAa,wBAAyB,YAAW,UAAU;IAChD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAGvC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAG7C,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAGtE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAGlD,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAGpC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAGpC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAGnG,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,QAAQ,EAAE,MAAM,CAAC;CACpC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EnmeshedHolderFileSystem = void 0;
4
+ // File system is not used since we don't use Askar or AnonCreds.
5
+ class EnmeshedHolderFileSystem {
6
+ exists(_path) {
7
+ throw new Error("File system not implemented because previously not needed.");
8
+ }
9
+ createDirectory(_path) {
10
+ throw new Error("File system not implemented because previously not needed.");
11
+ }
12
+ copyFile(_sourcePath, _destinationPath) {
13
+ throw new Error("File system not implemented because previously not needed.");
14
+ }
15
+ write(_path, _data) {
16
+ throw new Error("File system not implemented because previously not needed.");
17
+ }
18
+ read(_path) {
19
+ throw new Error("File system not implemented because previously not needed.");
20
+ }
21
+ delete(_path) {
22
+ throw new Error("File system not implemented because previously not needed.");
23
+ }
24
+ downloadToFile(_url, _path, _options) {
25
+ throw new Error("File system not implemented because previously not needed.");
26
+ }
27
+ }
28
+ exports.EnmeshedHolderFileSystem = EnmeshedHolderFileSystem;
29
+ //# sourceMappingURL=EnmeshedHolderFileSystem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnmeshedHolderFileSystem.js","sourceRoot":"","sources":["../../../../src/modules/openid4vc/local/EnmeshedHolderFileSystem.ts"],"names":[],"mappings":";;;AAEA,iEAAiE;AACjE,MAAa,wBAAwB;IAC1B,MAAM,CAAC,KAAa;QACvB,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAClF,CAAC;IACM,eAAe,CAAC,KAAa;QAChC,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAClF,CAAC;IACM,QAAQ,CAAC,WAAmB,EAAE,gBAAwB;QACzD,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAClF,CAAC;IACM,KAAK,CAAC,KAAa,EAAE,KAAa;QACrC,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAClF,CAAC;IACM,IAAI,CAAC,KAAa;QACrB,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAClF,CAAC;IACM,MAAM,CAAC,KAAa;QACvB,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAClF,CAAC;IACM,cAAc,CAAC,IAAY,EAAE,KAAa,EAAE,QAAgC;QAC/E,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAClF,CAAC;CAIJ;AAzBD,4DAyBC"}
@@ -0,0 +1,33 @@
1
+ import { AgentContext, Kms } from "@credo-ts/core";
2
+ import { KeyStorage } from "./KeyStorage";
3
+ export interface JwkKeyPair {
4
+ publicKey: JsonWebKey;
5
+ privateKey: JsonWebKey;
6
+ keyType?: string;
7
+ }
8
+ export declare class EnmshedHolderKeyManagmentService implements Kms.KeyManagementService {
9
+ private readonly keyStorage;
10
+ static readonly backend = "enmeshed";
11
+ readonly backend = "enmeshed";
12
+ private readonly b64url;
13
+ private readonly b64urlDecode;
14
+ private readonly buf2hex;
15
+ private readonly hex2buf;
16
+ constructor(keyStorage: KeyStorage);
17
+ isOperationSupported(agentContext: AgentContext, operation: Kms.KmsOperation): boolean;
18
+ getPublicKey(agentContext: AgentContext, keyId: string): Promise<Kms.KmsJwkPublic>;
19
+ createKey<Type extends Kms.KmsCreateKeyType>(agentContext: AgentContext, options: Kms.KmsCreateKeyOptions<Type>): Promise<Kms.KmsCreateKeyReturn<Type>>;
20
+ importKey<Jwk extends Kms.KmsJwkPrivate>(agentContext: AgentContext, options: Kms.KmsImportKeyOptions<Jwk>): Promise<Kms.KmsImportKeyReturn<Jwk>>;
21
+ deleteKey(agentContext: AgentContext, options: Kms.KmsDeleteKeyOptions): Promise<boolean>;
22
+ sign(agentContext: AgentContext, options: Kms.KmsSignOptions): Promise<Kms.KmsSignReturn>;
23
+ verify(agentContext: AgentContext, options: Kms.KmsVerifyOptions): Promise<Kms.KmsVerifyReturn>;
24
+ private ecdhEs;
25
+ private utf8;
26
+ private concat;
27
+ private lenPrefix;
28
+ private concatKdf;
29
+ encrypt(agentContext: AgentContext, options: Kms.KmsEncryptOptions): Promise<Kms.KmsEncryptReturn>;
30
+ decrypt(agentContext: AgentContext, options: Kms.KmsDecryptOptions): Promise<Kms.KmsDecryptReturn>;
31
+ randomBytes(agentContext: AgentContext, options: Kms.KmsRandomBytesOptions): Kms.KmsRandomBytesReturn;
32
+ }
33
+ //# sourceMappingURL=EnmeshedHolderKeyManagmentService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnmeshedHolderKeyManagmentService.d.ts","sourceRoot":"","sources":["../../../../src/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAKnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,WAAW,UAAU;IACvB,SAAS,EAAE,UAAU,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,gCAAiC,YAAW,GAAG,CAAC,oBAAoB;IAuB1D,OAAO,CAAC,QAAQ,CAAC,UAAU;IAtB9C,gBAAuB,OAAO,cAAc;IAE5C,SAAgB,OAAO,cAA4C;IAEnE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkI;IACzJ,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAkI;IAI/J,OAAO,CAAC,QAAQ,CAAC,OAAO,CAItB;IACF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAMtB;gBAEkC,UAAU,EAAE,UAAU;IAEnD,oBAAoB,CAAC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,CAAC,YAAY,GAAG,OAAO;IA4BhF,YAAY,CAAC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IASlF,SAAS,CAAC,IAAI,SAAS,GAAG,CAAC,gBAAgB,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAyE7J,SAAS,CAAC,GAAG,SAAS,GAAG,CAAC,aAAa,EAAE,YAAY,EAAE,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