@credo-ts/openid4vc 0.4.1-alpha.157

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 (192) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +31 -0
  3. package/build/index.d.ts +4 -0
  4. package/build/index.js +21 -0
  5. package/build/index.js.map +1 -0
  6. package/build/openid4vc-holder/OpenId4VcHolderApi.d.ts +83 -0
  7. package/build/openid4vc-holder/OpenId4VcHolderApi.js +115 -0
  8. package/build/openid4vc-holder/OpenId4VcHolderApi.js.map +1 -0
  9. package/build/openid4vc-holder/OpenId4VcHolderModule.d.ts +13 -0
  10. package/build/openid4vc-holder/OpenId4VcHolderModule.js +30 -0
  11. package/build/openid4vc-holder/OpenId4VcHolderModule.js.map +1 -0
  12. package/build/openid4vc-holder/OpenId4VciHolderService.d.ts +33 -0
  13. package/build/openid4vc-holder/OpenId4VciHolderService.js +512 -0
  14. package/build/openid4vc-holder/OpenId4VciHolderService.js.map +1 -0
  15. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.ts +153 -0
  16. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.js +11 -0
  17. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.js.map +1 -0
  18. package/build/openid4vc-holder/OpenId4vcSiopHolderService.d.ts +18 -0
  19. package/build/openid4vc-holder/OpenId4vcSiopHolderService.js +228 -0
  20. package/build/openid4vc-holder/OpenId4vcSiopHolderService.js.map +1 -0
  21. package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.d.ts +43 -0
  22. package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.js +3 -0
  23. package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.js.map +1 -0
  24. package/build/openid4vc-holder/index.d.ts +6 -0
  25. package/build/openid4vc-holder/index.js +23 -0
  26. package/build/openid4vc-holder/index.js.map +1 -0
  27. package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.d.ts +9 -0
  28. package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.js +14 -0
  29. package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.js.map +1 -0
  30. package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.ts +60 -0
  31. package/build/openid4vc-issuer/OpenId4VcIssuerApi.js +106 -0
  32. package/build/openid4vc-issuer/OpenId4VcIssuerApi.js.map +1 -0
  33. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.d.ts +13 -0
  34. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.js +8 -0
  35. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.js.map +1 -0
  36. package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.ts +21 -0
  37. package/build/openid4vc-issuer/OpenId4VcIssuerModule.js +106 -0
  38. package/build/openid4vc-issuer/OpenId4VcIssuerModule.js.map +1 -0
  39. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.ts +41 -0
  40. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js +46 -0
  41. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js.map +1 -0
  42. package/build/openid4vc-issuer/OpenId4VcIssuerService.d.ts +54 -0
  43. package/build/openid4vc-issuer/OpenId4VcIssuerService.js +425 -0
  44. package/build/openid4vc-issuer/OpenId4VcIssuerService.js.map +1 -0
  45. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.ts +88 -0
  46. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.js +3 -0
  47. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.js.map +1 -0
  48. package/build/openid4vc-issuer/index.d.ts +8 -0
  49. package/build/openid4vc-issuer/index.js +27 -0
  50. package/build/openid4vc-issuer/index.js.map +1 -0
  51. package/build/openid4vc-issuer/repository/OpenId4VcCNonceStateManager.d.ts +18 -0
  52. package/build/openid4vc-issuer/repository/OpenId4VcCNonceStateManager.js +99 -0
  53. package/build/openid4vc-issuer/repository/OpenId4VcCNonceStateManager.js.map +1 -0
  54. package/build/openid4vc-issuer/repository/OpenId4VcCredentialOfferSessionStateManager.d.ts +21 -0
  55. package/build/openid4vc-issuer/repository/OpenId4VcCredentialOfferSessionStateManager.js +182 -0
  56. package/build/openid4vc-issuer/repository/OpenId4VcCredentialOfferSessionStateManager.js.map +1 -0
  57. package/build/openid4vc-issuer/repository/OpenId4VcCredentialOfferUriStateManager.d.ts +17 -0
  58. package/build/openid4vc-issuer/repository/OpenId4VcCredentialOfferUriStateManager.js +68 -0
  59. package/build/openid4vc-issuer/repository/OpenId4VcCredentialOfferUriStateManager.js.map +1 -0
  60. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts +84 -0
  61. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js +58 -0
  62. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js.map +1 -0
  63. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.d.ts +5 -0
  64. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.js +29 -0
  65. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.js.map +1 -0
  66. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.ts +37 -0
  67. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js +31 -0
  68. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js.map +1 -0
  69. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.d.ts +8 -0
  70. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.js +35 -0
  71. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.js.map +1 -0
  72. package/build/openid4vc-issuer/repository/index.d.ts +4 -0
  73. package/build/openid4vc-issuer/repository/index.js +21 -0
  74. package/build/openid4vc-issuer/repository/index.js.map +1 -0
  75. package/build/openid4vc-issuer/router/accessTokenEndpoint.d.ts +34 -0
  76. package/build/openid4vc-issuer/router/accessTokenEndpoint.js +111 -0
  77. package/build/openid4vc-issuer/router/accessTokenEndpoint.js.map +1 -0
  78. package/build/openid4vc-issuer/router/credentialEndpoint.d.ts +16 -0
  79. package/build/openid4vc-issuer/router/credentialEndpoint.js +44 -0
  80. package/build/openid4vc-issuer/router/credentialEndpoint.js.map +1 -0
  81. package/build/openid4vc-issuer/router/credentialOfferEndpoint.d.ts +11 -0
  82. package/build/openid4vc-issuer/router/credentialOfferEndpoint.js +61 -0
  83. package/build/openid4vc-issuer/router/credentialOfferEndpoint.js.map +1 -0
  84. package/build/openid4vc-issuer/router/index.d.ts +5 -0
  85. package/build/openid4vc-issuer/router/index.js +12 -0
  86. package/build/openid4vc-issuer/router/index.js.map +1 -0
  87. package/build/openid4vc-issuer/router/metadataEndpoint.d.ts +2 -0
  88. package/build/openid4vc-issuer/router/metadataEndpoint.js +30 -0
  89. package/build/openid4vc-issuer/router/metadataEndpoint.js.map +1 -0
  90. package/build/openid4vc-issuer/router/requestContext.d.ts +5 -0
  91. package/build/openid4vc-issuer/router/requestContext.js +3 -0
  92. package/build/openid4vc-issuer/router/requestContext.js.map +1 -0
  93. package/build/openid4vc-issuer/router/verifyAccessToken.d.ts +3 -0
  94. package/build/openid4vc-issuer/router/verifyAccessToken.js +33 -0
  95. package/build/openid4vc-issuer/router/verifyAccessToken.js.map +1 -0
  96. package/build/openid4vc-issuer/util/credentialRequest.d.ts +5 -0
  97. package/build/openid4vc-issuer/util/credentialRequest.js +18 -0
  98. package/build/openid4vc-issuer/util/credentialRequest.js.map +1 -0
  99. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.d.ts +43 -0
  100. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js +357 -0
  101. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js.map +1 -0
  102. package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.d.ts +45 -0
  103. package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.js +3 -0
  104. package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.js.map +1 -0
  105. package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.d.ts +6 -0
  106. package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.js +11 -0
  107. package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.js.map +1 -0
  108. package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.ts +60 -0
  109. package/build/openid4vc-verifier/OpenId4VcVerifierApi.js +102 -0
  110. package/build/openid4vc-verifier/OpenId4VcVerifierApi.js.map +1 -0
  111. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.d.ts +13 -0
  112. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.js +8 -0
  113. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.js.map +1 -0
  114. package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.ts +21 -0
  115. package/build/openid4vc-verifier/OpenId4VcVerifierModule.js +103 -0
  116. package/build/openid4vc-verifier/OpenId4VcVerifierModule.js.map +1 -0
  117. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.d.ts +31 -0
  118. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.js +28 -0
  119. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.js.map +1 -0
  120. package/build/openid4vc-verifier/index.d.ts +8 -0
  121. package/build/openid4vc-verifier/index.js +25 -0
  122. package/build/openid4vc-verifier/index.js.map +1 -0
  123. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.d.ts +50 -0
  124. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.js +229 -0
  125. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.js.map +1 -0
  126. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.d.ts +19 -0
  127. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.js +146 -0
  128. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.js.map +1 -0
  129. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.ts +61 -0
  130. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js +45 -0
  131. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js.map +1 -0
  132. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.d.ts +5 -0
  133. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.js +29 -0
  134. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.js.map +1 -0
  135. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.ts +26 -0
  136. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.js +28 -0
  137. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.js.map +1 -0
  138. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.d.ts +8 -0
  139. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.js +35 -0
  140. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.js.map +1 -0
  141. package/build/openid4vc-verifier/repository/index.d.ts +4 -0
  142. package/build/openid4vc-verifier/repository/index.js +21 -0
  143. package/build/openid4vc-verifier/repository/index.js.map +1 -0
  144. package/build/openid4vc-verifier/router/authorizationEndpoint.d.ts +11 -0
  145. package/build/openid4vc-verifier/router/authorizationEndpoint.js +37 -0
  146. package/build/openid4vc-verifier/router/authorizationEndpoint.js.map +1 -0
  147. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.d.ts +11 -0
  148. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js +65 -0
  149. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js.map +1 -0
  150. package/build/openid4vc-verifier/router/index.d.ts +2 -0
  151. package/build/openid4vc-verifier/router/index.js +6 -0
  152. package/build/openid4vc-verifier/router/index.js.map +1 -0
  153. package/build/openid4vc-verifier/router/requestContext.d.ts +5 -0
  154. package/build/openid4vc-verifier/router/requestContext.js +3 -0
  155. package/build/openid4vc-verifier/router/requestContext.js.map +1 -0
  156. package/build/shared/index.d.ts +2 -0
  157. package/build/shared/index.js +19 -0
  158. package/build/shared/index.js.map +1 -0
  159. package/build/shared/issuerMetadataUtils.d.ts +14 -0
  160. package/build/shared/issuerMetadataUtils.js +69 -0
  161. package/build/shared/issuerMetadataUtils.js.map +1 -0
  162. package/build/shared/models/CredentialHolderBinding.d.ts +10 -0
  163. package/build/shared/models/CredentialHolderBinding.js +3 -0
  164. package/build/shared/models/CredentialHolderBinding.js.map +1 -0
  165. package/build/shared/models/OpenId4VcJwtIssuer.d.ts +6 -0
  166. package/build/shared/models/OpenId4VcJwtIssuer.js +3 -0
  167. package/build/shared/models/OpenId4VcJwtIssuer.js.map +1 -0
  168. package/build/shared/models/OpenId4VciCredentialFormatProfile.d.ts +6 -0
  169. package/build/shared/models/OpenId4VciCredentialFormatProfile.js +11 -0
  170. package/build/shared/models/OpenId4VciCredentialFormatProfile.js.map +1 -0
  171. package/build/shared/models/index.d.ts +21 -0
  172. package/build/shared/models/index.js +20 -0
  173. package/build/shared/models/index.js.map +1 -0
  174. package/build/shared/router/context.d.ts +10 -0
  175. package/build/shared/router/context.js +22 -0
  176. package/build/shared/router/context.js.map +1 -0
  177. package/build/shared/router/express.d.ts +2 -0
  178. package/build/shared/router/express.js +16 -0
  179. package/build/shared/router/express.js.map +1 -0
  180. package/build/shared/router/index.d.ts +3 -0
  181. package/build/shared/router/index.js +20 -0
  182. package/build/shared/router/index.js.map +1 -0
  183. package/build/shared/router/tenants.d.ts +13 -0
  184. package/build/shared/router/tenants.js +50 -0
  185. package/build/shared/router/tenants.js.map +1 -0
  186. package/build/shared/transform.d.ts +5 -0
  187. package/build/shared/transform.js +61 -0
  188. package/build/shared/transform.js.map +1 -0
  189. package/build/shared/utils.d.ts +21 -0
  190. package/build/shared/utils.js +85 -0
  191. package/build/shared/utils.js.map +1 -0
  192. package/package.json +44 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2020-present Hyperledger Contributors.
190
+ Copyright 2021 Queen’s Printer for Ontario. Mostafa Youssef (https://github.com/MosCD3), Amit Padmani (https://github.com/nbAmit), Prasad Katkar (https://github.com/NB-PrasadKatkar), Mike Richardson (https://github.com/NB-MikeRichardson)
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ <p align="center">
2
+ <br />
3
+ <img
4
+ alt="Credo Logo"
5
+ src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png"
6
+ height="250px"
7
+ />
8
+ </p>
9
+ <h1 align="center"><b>Credo OpenID4VC Module</b></h1>
10
+ <p align="center">
11
+ <a
12
+ href="https://raw.githubusercontent.com/openwallet-foundation/credo-ts/main/LICENSE"
13
+ ><img
14
+ alt="License"
15
+ src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"
16
+ /></a>
17
+ <a href="https://www.typescriptlang.org/"
18
+ ><img
19
+ alt="typescript"
20
+ src="https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg"
21
+ /></a>
22
+ <a href="https://www.npmjs.com/package/@credo-ts/openid4vc"
23
+ ><img
24
+ alt="@credo-ts/openid4vc version"
25
+ src="https://img.shields.io/npm/v/@credo-ts/openid4vc"
26
+ /></a>
27
+
28
+ </p>
29
+ <br />
30
+
31
+ Open ID For Verifiable Credentials Holder Module for [Credo](https://credo.js.org).
@@ -0,0 +1,4 @@
1
+ export * from './openid4vc-holder';
2
+ export * from './openid4vc-verifier';
3
+ export * from './openid4vc-issuer';
4
+ export * from './shared';
package/build/index.js ADDED
@@ -0,0 +1,21 @@
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("./openid4vc-holder"), exports);
18
+ __exportStar(require("./openid4vc-verifier"), exports);
19
+ __exportStar(require("./openid4vc-issuer"), exports);
20
+ __exportStar(require("./shared"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,uDAAoC;AACpC,qDAAkC;AAClC,2CAAwB"}
@@ -0,0 +1,83 @@
1
+ import type { OpenId4VciResolvedCredentialOffer, OpenId4VciResolvedAuthorizationRequest, OpenId4VciAuthCodeFlowOptions, OpenId4VciAcceptCredentialOfferOptions } from './OpenId4VciHolderServiceOptions';
2
+ import type { OpenId4VcSiopAcceptAuthorizationRequestOptions } from './OpenId4vcSiopHolderServiceOptions';
3
+ import { AgentContext } from '@credo-ts/core';
4
+ import { OpenId4VciHolderService } from './OpenId4VciHolderService';
5
+ import { OpenId4VcSiopHolderService } from './OpenId4vcSiopHolderService';
6
+ /**
7
+ * @public
8
+ */
9
+ export declare class OpenId4VcHolderApi {
10
+ private agentContext;
11
+ private openId4VciHolderService;
12
+ private openId4VcSiopHolderService;
13
+ constructor(agentContext: AgentContext, openId4VciHolderService: OpenId4VciHolderService, openId4VcSiopHolderService: OpenId4VcSiopHolderService);
14
+ /**
15
+ * Resolves the authentication request given as URI or JWT to a unified format, and
16
+ * verifies the validity of the request.
17
+ *
18
+ * The resolved request can be accepted with the @see acceptSiopAuthorizationRequest.
19
+ *
20
+ * If the authorization request uses OpenID4VP and included presentation definitions,
21
+ * a `presentationExchange` property will be defined with credentials that satisfy the
22
+ * incoming request. When `presentationExchange` is present, you MUST supply `presentationExchange`
23
+ * when calling `acceptSiopAuthorizationRequest` as well.
24
+ *
25
+ * @param requestJwtOrUri JWT or an SIOPv2 request URI
26
+ * @returns the resolved and verified authentication request.
27
+ */
28
+ resolveSiopAuthorizationRequest(requestJwtOrUri: string): Promise<import("./OpenId4vcSiopHolderServiceOptions").OpenId4VcSiopResolvedAuthorizationRequest>;
29
+ /**
30
+ * Accepts the authentication request after it has been resolved and verified with {@link resolveSiopAuthorizationRequest}.
31
+ *
32
+ * If the resolved authorization request included a `presentationExchange` property, you MUST supply `presentationExchange`
33
+ * in the `options` parameter.
34
+ *
35
+ * If no `presentationExchange` property is present, you MUST supply `openIdTokenIssuer` in the `options` parameter.
36
+ */
37
+ acceptSiopAuthorizationRequest(options: OpenId4VcSiopAcceptAuthorizationRequestOptions): Promise<{
38
+ serverResponse: {
39
+ status: number;
40
+ body: string | Record<string, unknown> | undefined;
41
+ };
42
+ submittedResponse: import("@sphereon/did-auth-siop").AuthorizationResponsePayload;
43
+ }>;
44
+ /**
45
+ * Resolves a credential offer given as credential offer URL, or issuance initiation URL,
46
+ * into a unified format with metadata.
47
+ *
48
+ * @param credentialOffer the credential offer to resolve
49
+ * @returns The uniform credential offer payload, the issuer metadata, protocol version, and the offered credentials with metadata.
50
+ */
51
+ resolveCredentialOffer(credentialOffer: string): Promise<OpenId4VciResolvedCredentialOffer>;
52
+ /**
53
+ * This function is to be used to receive an credential in OpenID4VCI using the Authorization Code Flow.
54
+ *
55
+ * Not to be confused with the {@link resolveSiopAuthorizationRequest}, which is only used for SIOP requests.
56
+ *
57
+ * It will generate the authorization request URI based on the provided options.
58
+ * The authorization request URI is used to obtain the authorization code. Currently this needs to be done manually.
59
+ *
60
+ * Authorization to request credentials can be requested via authorization_details or scopes.
61
+ * This function automatically generates the authorization_details for all offered credentials.
62
+ * If scopes are provided, the provided scopes are sent alongside the authorization_details.
63
+ *
64
+ * @param resolvedCredentialOffer Obtained through @see resolveCredentialOffer
65
+ * @param authCodeFlowOptions
66
+ * @returns The authorization request URI alongside the code verifier and original @param authCodeFlowOptions
67
+ */
68
+ resolveIssuanceAuthorizationRequest(resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, authCodeFlowOptions: OpenId4VciAuthCodeFlowOptions): Promise<OpenId4VciResolvedAuthorizationRequest>;
69
+ /**
70
+ * Accepts a credential offer using the pre-authorized code flow.
71
+ * @param resolvedCredentialOffer Obtained through @see resolveCredentialOffer
72
+ * @param acceptCredentialOfferOptions
73
+ */
74
+ acceptCredentialOfferUsingPreAuthorizedCode(resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, acceptCredentialOfferOptions: OpenId4VciAcceptCredentialOfferOptions): Promise<import("@credo-ts/core").VerifiableCredential[]>;
75
+ /**
76
+ * Accepts a credential offer using the authorization code flow.
77
+ * @param resolvedCredentialOffer Obtained through @see resolveCredentialOffer
78
+ * @param resolvedAuthorizationRequest Obtained through @see resolveIssuanceAuthorizationRequest
79
+ * @param code The authorization code obtained via the authorization request URI
80
+ * @param acceptCredentialOfferOptions
81
+ */
82
+ acceptCredentialOfferUsingAuthorizationCode(resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, resolvedAuthorizationRequest: OpenId4VciResolvedAuthorizationRequest, code: string, acceptCredentialOfferOptions: OpenId4VciAcceptCredentialOfferOptions): Promise<import("@credo-ts/core").VerifiableCredential[]>;
83
+ }
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OpenId4VcHolderApi = void 0;
13
+ const core_1 = require("@credo-ts/core");
14
+ const OpenId4VciHolderService_1 = require("./OpenId4VciHolderService");
15
+ const OpenId4vcSiopHolderService_1 = require("./OpenId4vcSiopHolderService");
16
+ /**
17
+ * @public
18
+ */
19
+ let OpenId4VcHolderApi = class OpenId4VcHolderApi {
20
+ constructor(agentContext, openId4VciHolderService, openId4VcSiopHolderService) {
21
+ this.agentContext = agentContext;
22
+ this.openId4VciHolderService = openId4VciHolderService;
23
+ this.openId4VcSiopHolderService = openId4VcSiopHolderService;
24
+ }
25
+ /**
26
+ * Resolves the authentication request given as URI or JWT to a unified format, and
27
+ * verifies the validity of the request.
28
+ *
29
+ * The resolved request can be accepted with the @see acceptSiopAuthorizationRequest.
30
+ *
31
+ * If the authorization request uses OpenID4VP and included presentation definitions,
32
+ * a `presentationExchange` property will be defined with credentials that satisfy the
33
+ * incoming request. When `presentationExchange` is present, you MUST supply `presentationExchange`
34
+ * when calling `acceptSiopAuthorizationRequest` as well.
35
+ *
36
+ * @param requestJwtOrUri JWT or an SIOPv2 request URI
37
+ * @returns the resolved and verified authentication request.
38
+ */
39
+ async resolveSiopAuthorizationRequest(requestJwtOrUri) {
40
+ return this.openId4VcSiopHolderService.resolveAuthorizationRequest(this.agentContext, requestJwtOrUri);
41
+ }
42
+ /**
43
+ * Accepts the authentication request after it has been resolved and verified with {@link resolveSiopAuthorizationRequest}.
44
+ *
45
+ * If the resolved authorization request included a `presentationExchange` property, you MUST supply `presentationExchange`
46
+ * in the `options` parameter.
47
+ *
48
+ * If no `presentationExchange` property is present, you MUST supply `openIdTokenIssuer` in the `options` parameter.
49
+ */
50
+ async acceptSiopAuthorizationRequest(options) {
51
+ return await this.openId4VcSiopHolderService.acceptAuthorizationRequest(this.agentContext, options);
52
+ }
53
+ /**
54
+ * Resolves a credential offer given as credential offer URL, or issuance initiation URL,
55
+ * into a unified format with metadata.
56
+ *
57
+ * @param credentialOffer the credential offer to resolve
58
+ * @returns The uniform credential offer payload, the issuer metadata, protocol version, and the offered credentials with metadata.
59
+ */
60
+ async resolveCredentialOffer(credentialOffer) {
61
+ return await this.openId4VciHolderService.resolveCredentialOffer(credentialOffer);
62
+ }
63
+ /**
64
+ * This function is to be used to receive an credential in OpenID4VCI using the Authorization Code Flow.
65
+ *
66
+ * Not to be confused with the {@link resolveSiopAuthorizationRequest}, which is only used for SIOP requests.
67
+ *
68
+ * It will generate the authorization request URI based on the provided options.
69
+ * The authorization request URI is used to obtain the authorization code. Currently this needs to be done manually.
70
+ *
71
+ * Authorization to request credentials can be requested via authorization_details or scopes.
72
+ * This function automatically generates the authorization_details for all offered credentials.
73
+ * If scopes are provided, the provided scopes are sent alongside the authorization_details.
74
+ *
75
+ * @param resolvedCredentialOffer Obtained through @see resolveCredentialOffer
76
+ * @param authCodeFlowOptions
77
+ * @returns The authorization request URI alongside the code verifier and original @param authCodeFlowOptions
78
+ */
79
+ async resolveIssuanceAuthorizationRequest(resolvedCredentialOffer, authCodeFlowOptions) {
80
+ return await this.openId4VciHolderService.resolveAuthorizationRequest(this.agentContext, resolvedCredentialOffer, authCodeFlowOptions);
81
+ }
82
+ /**
83
+ * Accepts a credential offer using the pre-authorized code flow.
84
+ * @param resolvedCredentialOffer Obtained through @see resolveCredentialOffer
85
+ * @param acceptCredentialOfferOptions
86
+ */
87
+ async acceptCredentialOfferUsingPreAuthorizedCode(resolvedCredentialOffer, acceptCredentialOfferOptions) {
88
+ return this.openId4VciHolderService.acceptCredentialOffer(this.agentContext, {
89
+ resolvedCredentialOffer,
90
+ acceptCredentialOfferOptions,
91
+ });
92
+ }
93
+ /**
94
+ * Accepts a credential offer using the authorization code flow.
95
+ * @param resolvedCredentialOffer Obtained through @see resolveCredentialOffer
96
+ * @param resolvedAuthorizationRequest Obtained through @see resolveIssuanceAuthorizationRequest
97
+ * @param code The authorization code obtained via the authorization request URI
98
+ * @param acceptCredentialOfferOptions
99
+ */
100
+ async acceptCredentialOfferUsingAuthorizationCode(resolvedCredentialOffer, resolvedAuthorizationRequest, code, acceptCredentialOfferOptions) {
101
+ return this.openId4VciHolderService.acceptCredentialOffer(this.agentContext, {
102
+ resolvedCredentialOffer,
103
+ resolvedAuthorizationRequestWithCode: Object.assign(Object.assign({}, resolvedAuthorizationRequest), { code }),
104
+ acceptCredentialOfferOptions,
105
+ });
106
+ }
107
+ };
108
+ OpenId4VcHolderApi = __decorate([
109
+ (0, core_1.injectable)(),
110
+ __metadata("design:paramtypes", [core_1.AgentContext,
111
+ OpenId4VciHolderService_1.OpenId4VciHolderService,
112
+ OpenId4vcSiopHolderService_1.OpenId4VcSiopHolderService])
113
+ ], OpenId4VcHolderApi);
114
+ exports.OpenId4VcHolderApi = OpenId4VcHolderApi;
115
+ //# sourceMappingURL=OpenId4VcHolderApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenId4VcHolderApi.js","sourceRoot":"","sources":["../../src/openid4vc-holder/OpenId4VcHolderApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAQA,yCAAyD;AAEzD,uEAAmE;AACnE,6EAAyE;AAEzE;;GAEG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YACU,YAA0B,EAC1B,uBAAgD,EAChD,0BAAsD;QAFtD,iBAAY,GAAZ,YAAY,CAAc;QAC1B,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,+BAA0B,GAA1B,0BAA0B,CAA4B;IAC7D,CAAC;IAEJ;;;;;;;;;;;;;OAaG;IACI,KAAK,CAAC,+BAA+B,CAAC,eAAuB;QAClE,OAAO,IAAI,CAAC,0BAA0B,CAAC,2BAA2B,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CAAA;IACxG,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,8BAA8B,CAAC,OAAuD;QACjG,OAAO,MAAM,IAAI,CAAC,0BAA0B,CAAC,0BAA0B,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACrG,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,sBAAsB,CAAC,eAAuB;QACzD,OAAO,MAAM,IAAI,CAAC,uBAAuB,CAAC,sBAAsB,CAAC,eAAe,CAAC,CAAA;IACnF,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACI,KAAK,CAAC,mCAAmC,CAC9C,uBAA0D,EAC1D,mBAAkD;QAElD,OAAO,MAAM,IAAI,CAAC,uBAAuB,CAAC,2BAA2B,CACnE,IAAI,CAAC,YAAY,EACjB,uBAAuB,EACvB,mBAAmB,CACpB,CAAA;IACH,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,2CAA2C,CACtD,uBAA0D,EAC1D,4BAAoE;QAEpE,OAAO,IAAI,CAAC,uBAAuB,CAAC,qBAAqB,CAAC,IAAI,CAAC,YAAY,EAAE;YAC3E,uBAAuB;YACvB,4BAA4B;SAC7B,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,2CAA2C,CACtD,uBAA0D,EAC1D,4BAAoE,EACpE,IAAY,EACZ,4BAAoE;QAEpE,OAAO,IAAI,CAAC,uBAAuB,CAAC,qBAAqB,CAAC,IAAI,CAAC,YAAY,EAAE;YAC3E,uBAAuB;YACvB,oCAAoC,kCAAO,4BAA4B,KAAE,IAAI,GAAE;YAC/E,4BAA4B;SAC7B,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AA7GY,kBAAkB;IAD9B,IAAA,iBAAU,GAAE;qCAGa,mBAAY;QACD,iDAAuB;QACpB,uDAA0B;GAJrD,kBAAkB,CA6G9B;AA7GY,gDAAkB"}
@@ -0,0 +1,13 @@
1
+ import type { DependencyManager, Module } from '@credo-ts/core';
2
+ import { OpenId4VcHolderApi } from './OpenId4VcHolderApi';
3
+ /**
4
+ * @public @module OpenId4VcHolderModule
5
+ * This module provides the functionality to assume the role of owner in relation to the OpenId4VC specification suite.
6
+ */
7
+ export declare class OpenId4VcHolderModule implements Module {
8
+ readonly api: typeof OpenId4VcHolderApi;
9
+ /**
10
+ * Registers the dependencies of the question answer module on the dependency manager.
11
+ */
12
+ register(dependencyManager: DependencyManager): void;
13
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenId4VcHolderModule = void 0;
4
+ const core_1 = require("@credo-ts/core");
5
+ const OpenId4VcHolderApi_1 = require("./OpenId4VcHolderApi");
6
+ const OpenId4VciHolderService_1 = require("./OpenId4VciHolderService");
7
+ const OpenId4vcSiopHolderService_1 = require("./OpenId4vcSiopHolderService");
8
+ /**
9
+ * @public @module OpenId4VcHolderModule
10
+ * This module provides the functionality to assume the role of owner in relation to the OpenId4VC specification suite.
11
+ */
12
+ class OpenId4VcHolderModule {
13
+ constructor() {
14
+ this.api = OpenId4VcHolderApi_1.OpenId4VcHolderApi;
15
+ }
16
+ /**
17
+ * Registers the dependencies of the question answer module on the dependency manager.
18
+ */
19
+ register(dependencyManager) {
20
+ // Warn about experimental module
21
+ dependencyManager
22
+ .resolve(core_1.AgentConfig)
23
+ .logger.warn("The '@credo-ts/openid4vc' Holder module is experimental and could have unexpected breaking changes. When using this module, make sure to use strict versions for all @credo-ts packages.");
24
+ // Services
25
+ dependencyManager.registerSingleton(OpenId4VciHolderService_1.OpenId4VciHolderService);
26
+ dependencyManager.registerSingleton(OpenId4vcSiopHolderService_1.OpenId4VcSiopHolderService);
27
+ }
28
+ }
29
+ exports.OpenId4VcHolderModule = OpenId4VcHolderModule;
30
+ //# sourceMappingURL=OpenId4VcHolderModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenId4VcHolderModule.js","sourceRoot":"","sources":["../../src/openid4vc-holder/OpenId4VcHolderModule.ts"],"names":[],"mappings":";;;AAEA,yCAA4C;AAE5C,6DAAyD;AACzD,uEAAmE;AACnE,6EAAyE;AAEzE;;;GAGG;AACH,MAAa,qBAAqB;IAAlC;QACkB,QAAG,GAAG,uCAAkB,CAAA;IAiB1C,CAAC;IAfC;;OAEG;IACI,QAAQ,CAAC,iBAAoC;QAClD,iCAAiC;QACjC,iBAAiB;aACd,OAAO,CAAC,kBAAW,CAAC;aACpB,MAAM,CAAC,IAAI,CACV,0LAA0L,CAC3L,CAAA;QAEH,WAAW;QACX,iBAAiB,CAAC,iBAAiB,CAAC,iDAAuB,CAAC,CAAA;QAC5D,iBAAiB,CAAC,iBAAiB,CAAC,uDAA0B,CAAC,CAAA;IACjE,CAAC;CACF;AAlBD,sDAkBC"}
@@ -0,0 +1,33 @@
1
+ import type { OpenId4VciAuthCodeFlowOptions, OpenId4VciAcceptCredentialOfferOptions, OpenId4VciResolvedCredentialOffer, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedAuthorizationRequestWithCode } from './OpenId4VciHolderServiceOptions';
2
+ import type { AgentContext, VerifiableCredential } from '@credo-ts/core';
3
+ import { JwsService, Logger, W3cCredentialService } from '@credo-ts/core';
4
+ export declare class OpenId4VciHolderService {
5
+ private logger;
6
+ private w3cCredentialService;
7
+ private jwsService;
8
+ constructor(logger: Logger, w3cCredentialService: W3cCredentialService, jwsService: JwsService);
9
+ resolveCredentialOffer(credentialOffer: string): Promise<OpenId4VciResolvedCredentialOffer>;
10
+ private getAuthDetailsFromOfferedCredential;
11
+ resolveAuthorizationRequest(agentContext: AgentContext, resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, authCodeFlowOptions: OpenId4VciAuthCodeFlowOptions): Promise<OpenId4VciResolvedAuthorizationRequest>;
12
+ acceptCredentialOffer(agentContext: AgentContext, options: {
13
+ resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer;
14
+ acceptCredentialOfferOptions: OpenId4VciAcceptCredentialOfferOptions;
15
+ resolvedAuthorizationRequestWithCode?: OpenId4VciResolvedAuthorizationRequestWithCode;
16
+ }): Promise<VerifiableCredential[]>;
17
+ /**
18
+ * Get the options for the credential request. Internally this will resolve the proof of possession
19
+ * requirements, and based on that it will call the proofOfPossessionVerificationMethodResolver to
20
+ * allow the caller to select the correct verification method based on the requirements for the proof
21
+ * of possession.
22
+ */
23
+ private getCredentialRequestOptions;
24
+ /**
25
+ * Get the requirements for creating the proof of possession. Based on the allowed
26
+ * credential formats, the allowed proof of possession signature algorithms, and the
27
+ * credential type, this method will select the best credential format and signature
28
+ * algorithm to use, based on the order of preference.
29
+ */
30
+ private getProofOfPossessionRequirements;
31
+ private handleCredentialResponse;
32
+ private proofOfPossessionSignCallback;
33
+ }