@pagopa/io-react-native-wallet 3.2.0 → 3.4.0

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 (328) hide show
  1. package/README.md +1 -1
  2. package/lib/commonjs/credential/issuance/README.md +32 -14
  3. package/lib/commonjs/credential/issuance/api/IssuerConfig.js +1 -0
  4. package/lib/commonjs/credential/issuance/api/IssuerConfig.js.map +1 -1
  5. package/lib/commonjs/credential/issuance/common/02-start-user-authorization.js +4 -3
  6. package/lib/commonjs/credential/issuance/common/02-start-user-authorization.js.map +1 -1
  7. package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js +39 -8
  8. package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js.map +1 -1
  9. package/lib/commonjs/credential/issuance/mrtd-pop/02-init-challenge.js +46 -38
  10. package/lib/commonjs/credential/issuance/mrtd-pop/02-init-challenge.js.map +1 -1
  11. package/lib/commonjs/credential/issuance/mrtd-pop/03-validate-challenge.js +58 -51
  12. package/lib/commonjs/credential/issuance/mrtd-pop/03-validate-challenge.js.map +1 -1
  13. package/lib/commonjs/credential/issuance/mrtd-pop/index.js +21 -5
  14. package/lib/commonjs/credential/issuance/mrtd-pop/index.js.map +1 -1
  15. package/lib/commonjs/credential/issuance/v1.0.0/02-start-user-authorization.js +5 -4
  16. package/lib/commonjs/credential/issuance/v1.0.0/02-start-user-authorization.js.map +1 -1
  17. package/lib/commonjs/credential/issuance/v1.0.0/03-complete-user-authorization.js +8 -5
  18. package/lib/commonjs/credential/issuance/v1.0.0/03-complete-user-authorization.js.map +1 -1
  19. package/lib/commonjs/credential/issuance/v1.0.0/index.js +3 -2
  20. package/lib/commonjs/credential/issuance/v1.0.0/index.js.map +1 -1
  21. package/lib/commonjs/credential/issuance/v1.0.0/mappers.js +4 -2
  22. package/lib/commonjs/credential/issuance/v1.0.0/mappers.js.map +1 -1
  23. package/lib/commonjs/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js +0 -2
  24. package/lib/commonjs/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js.map +1 -1
  25. package/lib/commonjs/credential/issuance/v1.3.3/02-start-user-authorization.js +21 -17
  26. package/lib/commonjs/credential/issuance/v1.3.3/02-start-user-authorization.js.map +1 -1
  27. package/lib/commonjs/credential/issuance/v1.3.3/03-complete-user-authorization.js +108 -69
  28. package/lib/commonjs/credential/issuance/v1.3.3/03-complete-user-authorization.js.map +1 -1
  29. package/lib/commonjs/credential/issuance/v1.3.3/04-authorize-access.js +20 -19
  30. package/lib/commonjs/credential/issuance/v1.3.3/04-authorize-access.js.map +1 -1
  31. package/lib/commonjs/credential/issuance/v1.3.3/05-obtain-credential.js +5 -7
  32. package/lib/commonjs/credential/issuance/v1.3.3/05-obtain-credential.js.map +1 -1
  33. package/lib/commonjs/credential/issuance/v1.3.3/06-verify-and-parse-credential.js +4 -1
  34. package/lib/commonjs/credential/issuance/v1.3.3/06-verify-and-parse-credential.js.map +1 -1
  35. package/lib/commonjs/credential/issuance/v1.3.3/index.js +3 -2
  36. package/lib/commonjs/credential/issuance/v1.3.3/index.js.map +1 -1
  37. package/lib/commonjs/credential/issuance/v1.3.3/mappers.js +10 -11
  38. package/lib/commonjs/credential/issuance/v1.3.3/mappers.js.map +1 -1
  39. package/lib/commonjs/credential/presentation/api/types.js.map +1 -1
  40. package/lib/commonjs/credential/presentation/common/utils/http.js +9 -4
  41. package/lib/commonjs/credential/presentation/common/utils/http.js.map +1 -1
  42. package/lib/commonjs/credential/presentation/{v1.3.3/utils.mdoc.js → common/utils/mdoc.js} +2 -2
  43. package/lib/commonjs/credential/presentation/common/utils/mdoc.js.map +1 -0
  44. package/lib/commonjs/credential/presentation/v1.0.0/07-send-authorization-response.js +3 -1
  45. package/lib/commonjs/credential/presentation/v1.0.0/07-send-authorization-response.js.map +1 -1
  46. package/lib/commonjs/credential/presentation/v1.3.3/05-verify-request-object.js +11 -10
  47. package/lib/commonjs/credential/presentation/v1.3.3/05-verify-request-object.js.map +1 -1
  48. package/lib/commonjs/credential/presentation/v1.3.3/06-evaluate-dcql-query.js +2 -2
  49. package/lib/commonjs/credential/presentation/v1.3.3/06-evaluate-dcql-query.js.map +1 -1
  50. package/lib/commonjs/credential/presentation/v1.3.3/07-send-authorization-response.js +2 -0
  51. package/lib/commonjs/credential/presentation/v1.3.3/07-send-authorization-response.js.map +1 -1
  52. package/lib/commonjs/credential/presentation/v1.3.3/mappers.js +1 -1
  53. package/lib/commonjs/credential/presentation/v1.3.3/mappers.js.map +1 -1
  54. package/lib/commonjs/credential/status/README.md +3 -2
  55. package/lib/commonjs/credential/status/v1.3.3/01-status-list.js +27 -5
  56. package/lib/commonjs/credential/status/v1.3.3/01-status-list.js.map +1 -1
  57. package/lib/commonjs/credential/status/v1.3.3/02-verify-and-parse-status-list.js +17 -6
  58. package/lib/commonjs/credential/status/v1.3.3/02-verify-and-parse-status-list.js.map +1 -1
  59. package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js +2 -1
  60. package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
  61. package/lib/commonjs/credentials-catalogue/common/get-status-l10n-ids.js +23 -0
  62. package/lib/commonjs/credentials-catalogue/common/get-status-l10n-ids.js.map +1 -0
  63. package/lib/commonjs/credentials-catalogue/v1.0.0/index.js +3 -1
  64. package/lib/commonjs/credentials-catalogue/v1.0.0/index.js.map +1 -1
  65. package/lib/commonjs/credentials-catalogue/v1.3.3/index.js +3 -1
  66. package/lib/commonjs/credentials-catalogue/v1.3.3/index.js.map +1 -1
  67. package/lib/commonjs/mdoc/index.js +3 -24
  68. package/lib/commonjs/mdoc/index.js.map +1 -1
  69. package/lib/commonjs/sd-jwt/__test__/types.test.js +2 -14
  70. package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -1
  71. package/lib/commonjs/sd-jwt/__test__/utils.test.js +0 -12
  72. package/lib/commonjs/sd-jwt/__test__/utils.test.js.map +1 -1
  73. package/lib/commonjs/sd-jwt/types.js +1 -14
  74. package/lib/commonjs/sd-jwt/types.js.map +1 -1
  75. package/lib/commonjs/utils/callbacks.js +20 -1
  76. package/lib/commonjs/utils/callbacks.js.map +1 -1
  77. package/lib/commonjs/utils/config.js +9 -1
  78. package/lib/commonjs/utils/config.js.map +1 -1
  79. package/lib/commonjs/utils/x509.js +34 -0
  80. package/lib/commonjs/utils/x509.js.map +1 -0
  81. package/lib/commonjs/wallet-instance-attestation/api/types.js +0 -2
  82. package/lib/commonjs/wallet-instance-attestation/api/types.js.map +1 -1
  83. package/lib/commonjs/wallet-instance-attestation/v1.3.3/mappers.js +1 -14
  84. package/lib/commonjs/wallet-instance-attestation/v1.3.3/mappers.js.map +1 -1
  85. package/lib/commonjs/wallet-instance-attestation/v1.3.3/types.js +2 -7
  86. package/lib/commonjs/wallet-instance-attestation/v1.3.3/types.js.map +1 -1
  87. package/lib/commonjs/wallet-unit-attestation/api/types.js +0 -11
  88. package/lib/commonjs/wallet-unit-attestation/api/types.js.map +1 -1
  89. package/lib/module/credential/issuance/README.md +32 -14
  90. package/lib/module/credential/issuance/api/IssuerConfig.js +1 -0
  91. package/lib/module/credential/issuance/api/IssuerConfig.js.map +1 -1
  92. package/lib/module/credential/issuance/common/02-start-user-authorization.js +4 -3
  93. package/lib/module/credential/issuance/common/02-start-user-authorization.js.map +1 -1
  94. package/lib/module/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js +41 -10
  95. package/lib/module/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js.map +1 -1
  96. package/lib/module/credential/issuance/mrtd-pop/02-init-challenge.js +47 -34
  97. package/lib/module/credential/issuance/mrtd-pop/02-init-challenge.js.map +1 -1
  98. package/lib/module/credential/issuance/mrtd-pop/03-validate-challenge.js +58 -47
  99. package/lib/module/credential/issuance/mrtd-pop/03-validate-challenge.js.map +1 -1
  100. package/lib/module/credential/issuance/mrtd-pop/index.js +20 -5
  101. package/lib/module/credential/issuance/mrtd-pop/index.js.map +1 -1
  102. package/lib/module/credential/issuance/v1.0.0/02-start-user-authorization.js +3 -2
  103. package/lib/module/credential/issuance/v1.0.0/02-start-user-authorization.js.map +1 -1
  104. package/lib/module/credential/issuance/v1.0.0/03-complete-user-authorization.js +6 -4
  105. package/lib/module/credential/issuance/v1.0.0/03-complete-user-authorization.js.map +1 -1
  106. package/lib/module/credential/issuance/v1.0.0/index.js +5 -4
  107. package/lib/module/credential/issuance/v1.0.0/index.js.map +1 -1
  108. package/lib/module/credential/issuance/v1.0.0/mappers.js +4 -2
  109. package/lib/module/credential/issuance/v1.0.0/mappers.js.map +1 -1
  110. package/lib/module/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js +0 -2
  111. package/lib/module/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js.map +1 -1
  112. package/lib/module/credential/issuance/v1.3.3/02-start-user-authorization.js +21 -17
  113. package/lib/module/credential/issuance/v1.3.3/02-start-user-authorization.js.map +1 -1
  114. package/lib/module/credential/issuance/v1.3.3/03-complete-user-authorization.js +108 -70
  115. package/lib/module/credential/issuance/v1.3.3/03-complete-user-authorization.js.map +1 -1
  116. package/lib/module/credential/issuance/v1.3.3/04-authorize-access.js +22 -19
  117. package/lib/module/credential/issuance/v1.3.3/04-authorize-access.js.map +1 -1
  118. package/lib/module/credential/issuance/v1.3.3/05-obtain-credential.js +6 -8
  119. package/lib/module/credential/issuance/v1.3.3/05-obtain-credential.js.map +1 -1
  120. package/lib/module/credential/issuance/v1.3.3/06-verify-and-parse-credential.js +4 -1
  121. package/lib/module/credential/issuance/v1.3.3/06-verify-and-parse-credential.js.map +1 -1
  122. package/lib/module/credential/issuance/v1.3.3/index.js +5 -4
  123. package/lib/module/credential/issuance/v1.3.3/index.js.map +1 -1
  124. package/lib/module/credential/issuance/v1.3.3/mappers.js +10 -11
  125. package/lib/module/credential/issuance/v1.3.3/mappers.js.map +1 -1
  126. package/lib/module/credential/presentation/api/types.js.map +1 -1
  127. package/lib/module/credential/presentation/common/utils/http.js +9 -4
  128. package/lib/module/credential/presentation/common/utils/http.js.map +1 -1
  129. package/lib/module/credential/presentation/{v1.3.3/utils.mdoc.js → common/utils/mdoc.js} +2 -2
  130. package/lib/module/credential/presentation/common/utils/mdoc.js.map +1 -0
  131. package/lib/module/credential/presentation/v1.0.0/07-send-authorization-response.js +3 -1
  132. package/lib/module/credential/presentation/v1.0.0/07-send-authorization-response.js.map +1 -1
  133. package/lib/module/credential/presentation/v1.3.3/05-verify-request-object.js +11 -10
  134. package/lib/module/credential/presentation/v1.3.3/05-verify-request-object.js.map +1 -1
  135. package/lib/module/credential/presentation/v1.3.3/06-evaluate-dcql-query.js +2 -3
  136. package/lib/module/credential/presentation/v1.3.3/06-evaluate-dcql-query.js.map +1 -1
  137. package/lib/module/credential/presentation/v1.3.3/07-send-authorization-response.js +2 -0
  138. package/lib/module/credential/presentation/v1.3.3/07-send-authorization-response.js.map +1 -1
  139. package/lib/module/credential/presentation/v1.3.3/mappers.js +1 -1
  140. package/lib/module/credential/presentation/v1.3.3/mappers.js.map +1 -1
  141. package/lib/module/credential/status/README.md +3 -2
  142. package/lib/module/credential/status/v1.3.3/01-status-list.js +27 -5
  143. package/lib/module/credential/status/v1.3.3/01-status-list.js.map +1 -1
  144. package/lib/module/credential/status/v1.3.3/02-verify-and-parse-status-list.js +17 -6
  145. package/lib/module/credential/status/v1.3.3/02-verify-and-parse-status-list.js.map +1 -1
  146. package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js +1 -1
  147. package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
  148. package/lib/module/credentials-catalogue/common/get-status-l10n-ids.js +16 -0
  149. package/lib/module/credentials-catalogue/common/get-status-l10n-ids.js.map +1 -0
  150. package/lib/module/credentials-catalogue/v1.0.0/index.js +3 -1
  151. package/lib/module/credentials-catalogue/v1.0.0/index.js.map +1 -1
  152. package/lib/module/credentials-catalogue/v1.3.3/index.js +3 -1
  153. package/lib/module/credentials-catalogue/v1.3.3/index.js.map +1 -1
  154. package/lib/module/mdoc/index.js +3 -24
  155. package/lib/module/mdoc/index.js.map +1 -1
  156. package/lib/module/sd-jwt/__test__/types.test.js +2 -14
  157. package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
  158. package/lib/module/sd-jwt/__test__/utils.test.js +0 -12
  159. package/lib/module/sd-jwt/__test__/utils.test.js.map +1 -1
  160. package/lib/module/sd-jwt/types.js +1 -14
  161. package/lib/module/sd-jwt/types.js.map +1 -1
  162. package/lib/module/utils/callbacks.js +19 -1
  163. package/lib/module/utils/callbacks.js.map +1 -1
  164. package/lib/module/utils/config.js +7 -0
  165. package/lib/module/utils/config.js.map +1 -1
  166. package/lib/module/utils/x509.js +28 -0
  167. package/lib/module/utils/x509.js.map +1 -0
  168. package/lib/module/wallet-instance-attestation/api/types.js +0 -2
  169. package/lib/module/wallet-instance-attestation/api/types.js.map +1 -1
  170. package/lib/module/wallet-instance-attestation/v1.3.3/mappers.js +1 -14
  171. package/lib/module/wallet-instance-attestation/v1.3.3/mappers.js.map +1 -1
  172. package/lib/module/wallet-instance-attestation/v1.3.3/types.js +2 -7
  173. package/lib/module/wallet-instance-attestation/v1.3.3/types.js.map +1 -1
  174. package/lib/module/wallet-unit-attestation/api/types.js +0 -11
  175. package/lib/module/wallet-unit-attestation/api/types.js.map +1 -1
  176. package/lib/typescript/credential/issuance/api/02-start-user-authorization.d.ts +1 -0
  177. package/lib/typescript/credential/issuance/api/02-start-user-authorization.d.ts.map +1 -1
  178. package/lib/typescript/credential/issuance/api/03-complete-user-authorization.d.ts +19 -5
  179. package/lib/typescript/credential/issuance/api/03-complete-user-authorization.d.ts.map +1 -1
  180. package/lib/typescript/credential/issuance/api/06-verify-and-parse-credential.d.ts +4 -0
  181. package/lib/typescript/credential/issuance/api/06-verify-and-parse-credential.d.ts.map +1 -1
  182. package/lib/typescript/credential/issuance/api/IssuerConfig.d.ts +1 -0
  183. package/lib/typescript/credential/issuance/api/IssuerConfig.d.ts.map +1 -1
  184. package/lib/typescript/credential/issuance/common/02-start-user-authorization.d.ts.map +1 -1
  185. package/lib/typescript/credential/issuance/common/06-verify-and-parse-credential.sdjwt.d.ts.map +1 -1
  186. package/lib/typescript/credential/issuance/mrtd-pop/02-init-challenge.d.ts +12 -1
  187. package/lib/typescript/credential/issuance/mrtd-pop/02-init-challenge.d.ts.map +1 -1
  188. package/lib/typescript/credential/issuance/mrtd-pop/03-validate-challenge.d.ts +12 -1
  189. package/lib/typescript/credential/issuance/mrtd-pop/03-validate-challenge.d.ts.map +1 -1
  190. package/lib/typescript/credential/issuance/mrtd-pop/index.d.ts +2 -1
  191. package/lib/typescript/credential/issuance/mrtd-pop/index.d.ts.map +1 -1
  192. package/lib/typescript/credential/issuance/v1.0.0/02-start-user-authorization.d.ts.map +1 -1
  193. package/lib/typescript/credential/issuance/v1.0.0/03-complete-user-authorization.d.ts +2 -1
  194. package/lib/typescript/credential/issuance/v1.0.0/03-complete-user-authorization.d.ts.map +1 -1
  195. package/lib/typescript/credential/issuance/v1.0.0/index.d.ts.map +1 -1
  196. package/lib/typescript/credential/issuance/v1.0.0/mappers.d.ts +1 -0
  197. package/lib/typescript/credential/issuance/v1.0.0/mappers.d.ts.map +1 -1
  198. package/lib/typescript/credential/issuance/v1.3.3/01-evaluate-issuer-trust.d.ts.map +1 -1
  199. package/lib/typescript/credential/issuance/v1.3.3/02-start-user-authorization.d.ts.map +1 -1
  200. package/lib/typescript/credential/issuance/v1.3.3/03-complete-user-authorization.d.ts +2 -1
  201. package/lib/typescript/credential/issuance/v1.3.3/03-complete-user-authorization.d.ts.map +1 -1
  202. package/lib/typescript/credential/issuance/v1.3.3/04-authorize-access.d.ts.map +1 -1
  203. package/lib/typescript/credential/issuance/v1.3.3/05-obtain-credential.d.ts.map +1 -1
  204. package/lib/typescript/credential/issuance/v1.3.3/06-verify-and-parse-credential.d.ts.map +1 -1
  205. package/lib/typescript/credential/issuance/v1.3.3/index.d.ts.map +1 -1
  206. package/lib/typescript/credential/issuance/v1.3.3/mappers.d.ts +7 -4
  207. package/lib/typescript/credential/issuance/v1.3.3/mappers.d.ts.map +1 -1
  208. package/lib/typescript/credential/presentation/api/05-verify-request-object.d.ts +1 -1
  209. package/lib/typescript/credential/presentation/api/types.d.ts +3 -7
  210. package/lib/typescript/credential/presentation/api/types.d.ts.map +1 -1
  211. package/lib/typescript/credential/presentation/common/utils/http.d.ts +1 -1
  212. package/lib/typescript/credential/presentation/common/utils/http.d.ts.map +1 -1
  213. package/lib/typescript/credential/presentation/{v1.3.3/utils.mdoc.d.ts → common/utils/mdoc.d.ts} +2 -2
  214. package/lib/typescript/credential/presentation/common/utils/mdoc.d.ts.map +1 -0
  215. package/lib/typescript/credential/presentation/v1.3.3/05-verify-request-object.d.ts.map +1 -1
  216. package/lib/typescript/credential/presentation/v1.3.3/06-evaluate-dcql-query.d.ts.map +1 -1
  217. package/lib/typescript/credential/presentation/v1.3.3/07-send-authorization-response.d.ts.map +1 -1
  218. package/lib/typescript/credential/presentation/v1.3.3/mappers.d.ts +8 -8
  219. package/lib/typescript/credential/presentation/v1.3.3/types.d.ts +8 -8
  220. package/lib/typescript/credential/status/api/status-list.d.ts +8 -4
  221. package/lib/typescript/credential/status/api/status-list.d.ts.map +1 -1
  222. package/lib/typescript/credential/status/v1.3.3/01-status-list.d.ts.map +1 -1
  223. package/lib/typescript/credential/status/v1.3.3/02-verify-and-parse-status-list.d.ts.map +1 -1
  224. package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts +6 -0
  225. package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts.map +1 -1
  226. package/lib/typescript/credentials-catalogue/api/index.d.ts +14 -2
  227. package/lib/typescript/credentials-catalogue/api/index.d.ts.map +1 -1
  228. package/lib/typescript/credentials-catalogue/common/get-status-l10n-ids.d.ts +9 -0
  229. package/lib/typescript/credentials-catalogue/common/get-status-l10n-ids.d.ts.map +1 -0
  230. package/lib/typescript/credentials-catalogue/v1.0.0/index.d.ts.map +1 -1
  231. package/lib/typescript/credentials-catalogue/v1.3.3/index.d.ts.map +1 -1
  232. package/lib/typescript/mdoc/index.d.ts +1 -1
  233. package/lib/typescript/mdoc/index.d.ts.map +1 -1
  234. package/lib/typescript/mdoc/utils.d.ts +0 -24
  235. package/lib/typescript/mdoc/utils.d.ts.map +1 -1
  236. package/lib/typescript/sd-jwt/types.d.ts +0 -12
  237. package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
  238. package/lib/typescript/trust/v1.3.3/types.d.ts +6 -4
  239. package/lib/typescript/trust/v1.3.3/types.d.ts.map +1 -1
  240. package/lib/typescript/utils/callbacks.d.ts +7 -0
  241. package/lib/typescript/utils/callbacks.d.ts.map +1 -1
  242. package/lib/typescript/utils/config.d.ts +4 -0
  243. package/lib/typescript/utils/config.d.ts.map +1 -1
  244. package/lib/typescript/utils/x509.d.ts +10 -0
  245. package/lib/typescript/utils/x509.d.ts.map +1 -0
  246. package/lib/typescript/wallet-instance-attestation/api/types.d.ts +0 -2
  247. package/lib/typescript/wallet-instance-attestation/api/types.d.ts.map +1 -1
  248. package/lib/typescript/wallet-instance-attestation/v1.0.0/mappers.d.ts +0 -2
  249. package/lib/typescript/wallet-instance-attestation/v1.0.0/mappers.d.ts.map +1 -1
  250. package/lib/typescript/wallet-instance-attestation/v1.3.3/mappers.d.ts +2 -9
  251. package/lib/typescript/wallet-instance-attestation/v1.3.3/mappers.d.ts.map +1 -1
  252. package/lib/typescript/wallet-instance-attestation/v1.3.3/types.d.ts +2 -7
  253. package/lib/typescript/wallet-instance-attestation/v1.3.3/types.d.ts.map +1 -1
  254. package/lib/typescript/wallet-unit-attestation/api/types.d.ts +0 -11
  255. package/lib/typescript/wallet-unit-attestation/api/types.d.ts.map +1 -1
  256. package/lib/typescript/wallet-unit-attestation/v1.3.3/mappers.d.ts +0 -22
  257. package/lib/typescript/wallet-unit-attestation/v1.3.3/mappers.d.ts.map +1 -1
  258. package/lib/typescript/wallet-unit-attestation/v1.3.3/types.d.ts +0 -11
  259. package/lib/typescript/wallet-unit-attestation/v1.3.3/types.d.ts.map +1 -1
  260. package/package.json +6 -6
  261. package/src/credential/issuance/README.md +32 -14
  262. package/src/credential/issuance/api/02-start-user-authorization.ts +1 -0
  263. package/src/credential/issuance/api/03-complete-user-authorization.ts +26 -5
  264. package/src/credential/issuance/api/06-verify-and-parse-credential.ts +4 -0
  265. package/src/credential/issuance/api/IssuerConfig.ts +1 -0
  266. package/src/credential/issuance/common/02-start-user-authorization.ts +6 -3
  267. package/src/credential/issuance/common/06-verify-and-parse-credential.sdjwt.ts +47 -10
  268. package/src/credential/issuance/mrtd-pop/02-init-challenge.ts +69 -45
  269. package/src/credential/issuance/mrtd-pop/03-validate-challenge.ts +84 -62
  270. package/src/credential/issuance/mrtd-pop/index.ts +13 -5
  271. package/src/credential/issuance/v1.0.0/02-start-user-authorization.ts +8 -2
  272. package/src/credential/issuance/v1.0.0/03-complete-user-authorization.ts +16 -4
  273. package/src/credential/issuance/v1.0.0/index.ts +6 -4
  274. package/src/credential/issuance/v1.0.0/mappers.ts +9 -1
  275. package/src/credential/issuance/v1.3.3/01-evaluate-issuer-trust.ts +0 -2
  276. package/src/credential/issuance/v1.3.3/02-start-user-authorization.ts +25 -21
  277. package/src/credential/issuance/v1.3.3/03-complete-user-authorization.ts +138 -94
  278. package/src/credential/issuance/v1.3.3/04-authorize-access.ts +28 -23
  279. package/src/credential/issuance/v1.3.3/05-obtain-credential.ts +9 -9
  280. package/src/credential/issuance/v1.3.3/06-verify-and-parse-credential.ts +2 -1
  281. package/src/credential/issuance/v1.3.3/index.ts +6 -4
  282. package/src/credential/issuance/v1.3.3/mappers.ts +13 -11
  283. package/src/credential/presentation/api/05-verify-request-object.ts +1 -1
  284. package/src/credential/presentation/api/types.ts +3 -7
  285. package/src/credential/presentation/common/utils/http.ts +2 -2
  286. package/src/credential/presentation/{v1.3.3/utils.mdoc.ts → common/utils/mdoc.ts} +2 -2
  287. package/src/credential/presentation/v1.0.0/07-send-authorization-response.ts +1 -1
  288. package/src/credential/presentation/v1.3.3/05-verify-request-object.ts +15 -14
  289. package/src/credential/presentation/v1.3.3/06-evaluate-dcql-query.ts +3 -3
  290. package/src/credential/presentation/v1.3.3/07-send-authorization-response.ts +2 -0
  291. package/src/credential/presentation/v1.3.3/mappers.ts +1 -1
  292. package/src/credential/status/README.md +3 -2
  293. package/src/credential/status/api/status-list.ts +10 -7
  294. package/src/credential/status/v1.3.3/01-status-list.ts +21 -7
  295. package/src/credential/status/v1.3.3/02-verify-and-parse-status-list.ts +19 -5
  296. package/src/credentials-catalogue/api/DigitalCredentialsCatalogue.ts +4 -1
  297. package/src/credentials-catalogue/api/index.ts +15 -0
  298. package/src/credentials-catalogue/common/get-status-l10n-ids.ts +25 -0
  299. package/src/credentials-catalogue/v1.0.0/index.ts +2 -0
  300. package/src/credentials-catalogue/v1.3.3/index.ts +2 -0
  301. package/src/mdoc/index.ts +5 -41
  302. package/src/sd-jwt/__test__/types.test.ts +1 -13
  303. package/src/sd-jwt/__test__/utils.test.ts +0 -12
  304. package/src/sd-jwt/types.ts +0 -13
  305. package/src/utils/callbacks.ts +28 -1
  306. package/src/utils/config.ts +7 -0
  307. package/src/utils/x509.ts +43 -0
  308. package/src/wallet-instance-attestation/api/types.ts +0 -2
  309. package/src/wallet-instance-attestation/v1.3.3/mappers.ts +3 -11
  310. package/src/wallet-instance-attestation/v1.3.3/types.ts +2 -7
  311. package/src/wallet-unit-attestation/api/types.ts +0 -11
  312. package/lib/commonjs/credential/issuance/common/authorization.js +0 -56
  313. package/lib/commonjs/credential/issuance/common/authorization.js.map +0 -1
  314. package/lib/commonjs/credential/presentation/common/utils.js +0 -28
  315. package/lib/commonjs/credential/presentation/common/utils.js.map +0 -1
  316. package/lib/commonjs/credential/presentation/v1.3.3/utils.mdoc.js.map +0 -1
  317. package/lib/module/credential/issuance/common/authorization.js +0 -48
  318. package/lib/module/credential/issuance/common/authorization.js.map +0 -1
  319. package/lib/module/credential/presentation/common/utils.js +0 -21
  320. package/lib/module/credential/presentation/common/utils.js.map +0 -1
  321. package/lib/module/credential/presentation/v1.3.3/utils.mdoc.js.map +0 -1
  322. package/lib/typescript/credential/issuance/common/authorization.d.ts +0 -21
  323. package/lib/typescript/credential/issuance/common/authorization.d.ts.map +0 -1
  324. package/lib/typescript/credential/presentation/common/utils.d.ts +0 -11
  325. package/lib/typescript/credential/presentation/common/utils.d.ts.map +0 -1
  326. package/lib/typescript/credential/presentation/v1.3.3/utils.mdoc.d.ts.map +0 -1
  327. package/src/credential/issuance/common/authorization.ts +0 -89
  328. package/src/credential/presentation/common/utils.ts +0 -30
@@ -39,10 +39,32 @@ export interface CompleteUserAuthorizationApi {
39
39
  * @param authRedirectUrl The URL to which the end user should be redirected to start the authentication flow
40
40
  * @returns the authorization response which contains code, state and iss
41
41
  */
42
- completeUserAuthorizationWithQueryMode(
42
+ completePidUserAuthorizationWithQueryMode(
43
43
  authRedirectUrl: string
44
44
  ): Promise<AuthorizationResult>;
45
45
 
46
+ /**
47
+ * Complete user authorization when the response mode is "query" and the requested credential is an Electronic Attestation of Attributes (EAA).
48
+ * This type of credentials requires a PID to be presented to complete the authorization process and then obtain an access token.
49
+ * @since 1.3.3
50
+ *
51
+ * @param requestObject The request object containing the necessary parameters for authorization.
52
+ * @param issuerConfig The issuer configuration returned by {@link evaluateIssuerTrust}
53
+ * @param pid The PID to present as a tuple [keyTag, credential].
54
+ * @param redirectUri The client redirect URI to which the authorization server will redirect after completing the authorization process.
55
+ * @param appFetch (optional) fetch api implementation. Default: built-in fetch
56
+ * @returns The authorization response which contains code, state and iss
57
+ */
58
+ completeEaaUserAuthorizationWithQueryMode(
59
+ requestObject: RequestObject,
60
+ issuerConf: IssuerConfig,
61
+ pid: [keyTag: string, credential: string],
62
+ redirectUri: string,
63
+ context?: {
64
+ appFetch?: GlobalFetch["fetch"];
65
+ }
66
+ ): Promise<AuthorizationResult>;
67
+
46
68
  /**
47
69
  * WARNING: This function must be called after {@link getRequestedCredentialToBePresented}. The next function to be called is {@link authorizeAccess}.
48
70
  *
@@ -51,8 +73,8 @@ export interface CompleteUserAuthorizationApi {
51
73
  * Following this,the redirect_uri from the response is used to obtain the final authorization response.
52
74
  * @since 1.0.0
53
75
  *
54
- * @param requestObject - The request object containing the necessary parameters for authorization.
55
- * @param pid The `PID` that must be presented for the issuance of credentials.
76
+ * @param requestObject The request object containing the necessary parameters for authorization.
77
+ * @param pid The PID to present as a tuple [keyTag, credential].
56
78
  * @param appFetch (optional) fetch api implementation. Default: built-in fetch
57
79
  * @returns the authorization response which contains code, state and iss
58
80
  * @throws {ValidationFailed} if an error while validating the response
@@ -60,10 +82,9 @@ export interface CompleteUserAuthorizationApi {
60
82
  completeUserAuthorizationWithFormPostJwtMode(
61
83
  requestObject: RequestObject,
62
84
  issuerConf: IssuerConfig,
63
- pid: string,
85
+ pid: [keyTag: string, credential: string],
64
86
  context: {
65
87
  wiaCryptoContext: CryptoContext;
66
- pidKeyTag: string;
67
88
  appFetch?: GlobalFetch["fetch"];
68
89
  }
69
90
  ): Promise<AuthorizationResult>;
@@ -32,6 +32,10 @@ export interface VerifyAndParseCredentialApi {
32
32
  * Include attributes that are not explicitly mapped in the issuer configuration.
33
33
  */
34
34
  includeUndefinedAttributes?: boolean;
35
+ /**
36
+ * Validate the certificate chain of the credential against the provided `x509CertRoot`.
37
+ */
38
+ validateCertificateChain?: boolean;
35
39
  },
36
40
  x509CertRoot?: string
37
41
  ): Promise<{
@@ -60,6 +60,7 @@ export const IssuerConfig = z.object({
60
60
  credential_configurations_supported: z.record(z.string(), CredentialConfig),
61
61
  federation_entity: FederationEntityMetadata,
62
62
  credential_issuance_batch_size: z.number().optional(),
63
+ encrypted_response_enc_values_supported: z.array(z.string()).optional(),
63
64
  /**
64
65
  * @deprecated
65
66
  */
@@ -1,3 +1,4 @@
1
+ import { IoWalletError } from "../../../utils/errors";
1
2
  import { LogLevel, Logger } from "../../../utils/logging";
2
3
  import { AuthorizationDetail } from "../../../utils/par";
3
4
  import type { IssuerConfig } from "../api";
@@ -30,7 +31,7 @@ export const selectCredentialDefinition = (
30
31
  LogLevel.ERROR,
31
32
  `Requested credential ${credentialId} is not supported by the issuer according to its configuration ${JSON.stringify(credential_configurations_supported)}`
32
33
  );
33
- throw new Error(`No credential support the type '${credentialId}'`);
34
+ throw new IoWalletError(`No credential support the type '${credentialId}'`);
34
35
  }
35
36
  return result;
36
37
  };
@@ -61,7 +62,7 @@ export const selectResponseMode = (
61
62
  LogLevel.ERROR,
62
63
  `${credentialIds} have incompatible response_mode: ${[...responseModeSet.values()]}`
63
64
  );
64
- throw new Error(
65
+ throw new IoWalletError(
65
66
  "Requested credentials have incompatible response_mode and cannot be requested with the same PAR request"
66
67
  );
67
68
  }
@@ -79,7 +80,9 @@ export const selectResponseMode = (
79
80
  LogLevel.ERROR,
80
81
  `Requested response mode ${responseMode} is not supported by the issuer according to its configuration ${JSON.stringify(responseModeSupported)}`
81
82
  );
82
- throw new Error(`No response mode support for IDs '${credentialIds}'`);
83
+ throw new IoWalletError(
84
+ `No response mode support for IDs '${credentialIds}'`
85
+ );
83
86
  }
84
87
 
85
88
  return responseMode!;
@@ -1,16 +1,18 @@
1
1
  import {
2
- getJwkFromHeader,
3
2
  type CryptoContext,
4
- decode,
3
+ verify as verifyJwt,
5
4
  } from "@pagopa/io-react-native-jwt";
6
- import { type SDJwt, SDJwtInstance } from "@sd-jwt/core";
7
- import { digest, ES256 } from "@sd-jwt/crypto-nodejs";
5
+ import { type SDJwt, type VerifierOptions, SDJwtInstance } from "@sd-jwt/core";
6
+ import { digest } from "@sd-jwt/crypto-nodejs";
7
+ import type { Verifier } from "@sd-jwt/types";
8
8
  import { isPathEqual, isPrefixOf } from "../../../utils/parser";
9
9
  import { IoWalletError } from "../../../utils/errors";
10
10
  import { LogLevel, Logger } from "../../../utils/logging";
11
11
  import { isSameThumbprint, type JWK } from "../../../utils/jwk";
12
12
  import type { SdJwt4VCBase } from "../../../sd-jwt/types";
13
13
  import { fixLegacyCredentialSdJwt } from "../../../utils/credentials";
14
+ import { verifyX509Chain } from "../../../utils/x509";
15
+ import { MissingX509CertsError } from "../../../trust/common/errors";
14
16
  import type { IssuanceApi, IssuerConfig, ParsedCredential } from "../api";
15
17
 
16
18
  type CredentialConf =
@@ -151,6 +153,31 @@ const parseCredentialSdJwt = (
151
153
  return processLevel(parsedCredentialRaw, []) as ParsedCredential;
152
154
  };
153
155
 
156
+ type SdJwtInstanceVerifier = Verifier<VerifierOptions & { issuerKeys: JWK[] }>;
157
+
158
+ /**
159
+ * JWT verifier implementing the interface expected by the SD-JWT library.
160
+ * Verification is delegated to `io-react-native-jwt` to leverage its support for multiple algorithms.
161
+ * @returns Boolean indicating whether the verification succeeded or not
162
+ */
163
+ const sdJwtInstanceVerifier: SdJwtInstanceVerifier = async (
164
+ data,
165
+ signature,
166
+ options
167
+ ) => {
168
+ if (!options?.issuerKeys) {
169
+ return false;
170
+ }
171
+ try {
172
+ await verifyJwt(`${data}.${signature}`, options.issuerKeys, {
173
+ clockTolerance: options.skewSeconds,
174
+ });
175
+ return true;
176
+ } catch {
177
+ return false;
178
+ }
179
+ };
180
+
154
181
  /**
155
182
  * Given a credential, verify it's in the supported format
156
183
  * and the credential is correctly signed
@@ -171,16 +198,13 @@ async function verifyCredentialSdJwt(
171
198
  issuerKeys: JWK[],
172
199
  holderBindingContext: CryptoContext
173
200
  ): Promise<SDJwt> {
174
- const { protectedHeader } = decode(rawCredential);
175
- const verifierJwk = getJwkFromHeader(protectedHeader, issuerKeys);
176
-
177
201
  const sdJwtInstance = new SDJwtInstance({
178
202
  hasher: digest,
179
- verifier: await ES256.getVerifier(verifierJwk),
203
+ verifier: sdJwtInstanceVerifier,
180
204
  });
181
205
 
182
206
  const [verifiedCredential, holderBindingKey] = await Promise.all([
183
- sdJwtInstance.verify(rawCredential),
207
+ sdJwtInstance.verify(rawCredential, { issuerKeys, skewSeconds: 30 }),
184
208
  holderBindingContext.getPublicKey(),
185
209
  ]);
186
210
 
@@ -203,7 +227,9 @@ export const verifyAndParseCredentialSdJwt: IssuanceApi["verifyAndParseCredentia
203
227
  credentialCryptoContext,
204
228
  ignoreMissingAttributes,
205
229
  includeUndefinedAttributes,
206
- }
230
+ validateCertificateChain,
231
+ },
232
+ x509CertRoot
207
233
  ) => {
208
234
  const decoded = await verifyCredentialSdJwt(
209
235
  credential,
@@ -216,6 +242,17 @@ export const verifyAndParseCredentialSdJwt: IssuanceApi["verifyAndParseCredentia
216
242
  `Decoded credential: ${JSON.stringify(decoded)}`
217
243
  );
218
244
 
245
+ if (validateCertificateChain) {
246
+ if (!x509CertRoot) {
247
+ throw new IoWalletError("Missing x509CertRoot");
248
+ }
249
+ const x5c = decoded.jwt?.header?.x5c as string[] | undefined;
250
+ if (!x5c || !Array.isArray(x5c) || x5c.length === 0) {
251
+ throw new MissingX509CertsError("Missing x509 certificates");
252
+ }
253
+ await verifyX509Chain(x5c, x509CertRoot);
254
+ }
255
+
219
256
  const credentialConfig =
220
257
  issuerConf.credential_configurations_supported[credentialConfigurationId];
221
258
 
@@ -1,61 +1,85 @@
1
- import { v4 as uuidv4 } from "uuid";
2
- import { fetchMrtdPopInit } from "@pagopa/io-wallet-oauth2";
3
- import { UnexpectedStatusCodeError as SdkUnexpectedStatusCodeError } from "@pagopa/io-wallet-utils";
4
- import { createPopToken } from "../../../utils/pop";
1
+ import {
2
+ createClientAttestationPopJwt,
3
+ fetchMrtdPopInit,
4
+ } from "@pagopa/io-wallet-oauth2";
5
+ import {
6
+ IoWalletSdkConfig,
7
+ UnexpectedStatusCodeError as SdkUnexpectedStatusCodeError,
8
+ } from "@pagopa/io-wallet-utils";
5
9
  import { Logger, LogLevel } from "../../../utils/logging";
6
- import * as WalletInstanceAttestation from "../../../wallet-instance-attestation/v1.0.0/utils"; // TODO: decouple from version 1.0.0
7
10
  import {
8
11
  IssuerResponseError,
9
12
  IssuerResponseErrorCodes,
10
13
  ResponseErrorBuilder,
11
14
  } from "../../../utils/errors";
12
15
  import type { MRTDPoPApi } from "../api/mrtd-pop";
13
- import { createVerifyJwtFromJwks } from "../../../utils/callbacks";
16
+ import {
17
+ createSignJwtFromCryptoContext,
18
+ createVerifyJwtFromJwks,
19
+ partialCallbacks,
20
+ } from "../../../utils/callbacks";
14
21
 
15
- export const initChallenge: MRTDPoPApi["initChallenge"] = async (
16
- issuerConf,
17
- initUrl,
18
- mrtd_auth_session,
19
- mrtd_pop_jwt_nonce,
20
- context
21
- ) => {
22
- const {
23
- appFetch = fetch,
24
- walletInstanceAttestation,
25
- wiaCryptoContext,
26
- } = context;
22
+ type Config = {
23
+ sdkConfig: IoWalletSdkConfig;
24
+ };
27
25
 
28
- const iss = WalletInstanceAttestation.decode(walletInstanceAttestation)
29
- .payload.cnf.jwk.kid;
26
+ /**
27
+ * Factory function to create `initChallenge` for MRTD PoP flow.
28
+ * The factory is needed to inject version specific SDK configuration.
29
+ * @param config Configuration object containing the IO Wallet SDK configuration
30
+ * @returns `initChallenge` function compliant with the public API
31
+ */
32
+ export function createInitChallenge(
33
+ config: Config
34
+ ): MRTDPoPApi["initChallenge"] {
35
+ return async function initChallenge(
36
+ issuerConf,
37
+ initUrl,
38
+ mrtd_auth_session,
39
+ mrtd_pop_jwt_nonce,
40
+ context
41
+ ) {
42
+ const {
43
+ appFetch = fetch,
44
+ walletInstanceAttestation,
45
+ wiaCryptoContext,
46
+ } = context;
30
47
 
31
- const signedWiaPoP = await createPopToken(
32
- {
33
- jti: uuidv4(),
34
- aud: issuerConf.credential_issuer,
35
- iss,
36
- },
37
- wiaCryptoContext
38
- );
48
+ const clientAttestationDPoP = await createClientAttestationPopJwt({
49
+ config: config.sdkConfig,
50
+ callbacks: {
51
+ generateRandom: partialCallbacks.generateRandom,
52
+ signJwt: createSignJwtFromCryptoContext(wiaCryptoContext),
53
+ },
54
+ clientAttestation: walletInstanceAttestation,
55
+ authorizationServer: issuerConf.credential_issuer,
56
+ signer: {
57
+ method: "jwk",
58
+ alg: "ES256",
59
+ publicJwk: await wiaCryptoContext.getPublicKey(),
60
+ },
61
+ });
39
62
 
40
- const initResult = await fetchMrtdPopInit({
41
- popInitEndpoint: initUrl,
42
- mrtdAuthSession: mrtd_auth_session,
43
- mrtdPopJwtNonce: mrtd_pop_jwt_nonce,
44
- walletAttestation: walletInstanceAttestation,
45
- clientAttestationDPoP: signedWiaPoP,
46
- callbacks: {
47
- verifyJwt: createVerifyJwtFromJwks(issuerConf.keys),
48
- fetch: appFetch,
49
- },
50
- }).catch(handleInitChallengeError);
63
+ const initResult = await fetchMrtdPopInit({
64
+ popInitEndpoint: initUrl,
65
+ mrtdAuthSession: mrtd_auth_session,
66
+ mrtdPopJwtNonce: mrtd_pop_jwt_nonce,
67
+ walletAttestation: walletInstanceAttestation,
68
+ clientAttestationDPoP,
69
+ callbacks: {
70
+ verifyJwt: createVerifyJwtFromJwks(issuerConf.keys),
71
+ fetch: appFetch,
72
+ },
73
+ }).catch(handleInitChallengeError);
51
74
 
52
- return {
53
- challenge: initResult.challenge,
54
- mrtd_pop_nonce: initResult.mrtdPopNonce,
55
- pop_verify_endpoint: initResult.popVerifyEndpoint,
56
- mrz: initResult.mrz,
75
+ return {
76
+ challenge: initResult.challenge,
77
+ mrtd_pop_nonce: initResult.mrtdPopNonce,
78
+ pop_verify_endpoint: initResult.popVerifyEndpoint,
79
+ mrz: initResult.mrz,
80
+ };
57
81
  };
58
- };
82
+ }
59
83
 
60
84
  const handleInitChallengeError = (e: unknown) => {
61
85
  Logger.log(LogLevel.ERROR, `Failed to get MRTD challenge: ${e}`);
@@ -1,76 +1,98 @@
1
1
  import { SignJWT } from "@pagopa/io-react-native-jwt";
2
- import { fetchMrtdPopVerify } from "@pagopa/io-wallet-oauth2";
3
- import { v4 as uuidv4 } from "uuid";
4
- import { createPopToken } from "../../../utils/pop";
5
- import * as WalletInstanceAttestation from "../../../wallet-instance-attestation/v1.0.0/utils"; // TODO: decouple from 1.0.0 version
2
+ import {
3
+ createClientAttestationPopJwt,
4
+ fetchMrtdPopVerify,
5
+ } from "@pagopa/io-wallet-oauth2";
6
+ import type { IoWalletSdkConfig } from "@pagopa/io-wallet-utils";
6
7
  import { sdkUnexpectedStatusCodeToIssuerError } from "../../../utils/errors";
7
- import { partialCallbacks } from "../../../utils/callbacks";
8
+ import {
9
+ createSignJwtFromCryptoContext,
10
+ partialCallbacks,
11
+ } from "../../../utils/callbacks";
8
12
  import type { MRTDPoPApi } from "../api/mrtd-pop";
9
13
 
10
- export const validateChallenge: MRTDPoPApi["validateChallenge"] = async (
11
- issuerConf,
12
- verifyUrl,
13
- mrtd_auth_session,
14
- mrtd_pop_nonce,
15
- mrtd,
16
- ias,
17
- context
18
- ) => {
19
- const {
20
- appFetch = fetch,
21
- walletInstanceAttestation,
22
- wiaCryptoContext,
23
- } = context;
14
+ type Config = {
15
+ sdkConfig: IoWalletSdkConfig;
16
+ };
17
+
18
+ /**
19
+ * Factory function to create `validateChallenge` for MRTD PoP flow.
20
+ * The factory is needed to inject version specific SDK configuration.
21
+ * @param config Configuration object containing the IO Wallet SDK configuration
22
+ * @returns `validateChallenge` function compliant with the public API
23
+ */
24
+ export function createValidateChallenge(
25
+ config: Config
26
+ ): MRTDPoPApi["validateChallenge"] {
27
+ return async function validateChallenge(
28
+ issuerConf,
29
+ verifyUrl,
30
+ mrtd_auth_session,
31
+ mrtd_pop_nonce,
32
+ mrtd,
33
+ ias,
34
+ context
35
+ ) {
36
+ const {
37
+ appFetch = fetch,
38
+ walletInstanceAttestation,
39
+ wiaCryptoContext,
40
+ } = context;
24
41
 
25
- const aud = issuerConf.credential_issuer;
26
- const iss = WalletInstanceAttestation.decode(walletInstanceAttestation)
27
- .payload.cnf.jwk.kid;
42
+ const aud = issuerConf.credential_issuer;
28
43
 
29
- const signedWiaPoP = await createPopToken(
30
- {
31
- jti: uuidv4(),
32
- aud,
33
- iss,
34
- },
35
- wiaCryptoContext
36
- );
44
+ const wiaPublicJwk = await wiaCryptoContext.getPublicKey();
37
45
 
38
- const { kid } = await wiaCryptoContext.getPublicKey();
46
+ const clientAttestationDPoP = await createClientAttestationPopJwt({
47
+ config: config.sdkConfig,
48
+ callbacks: {
49
+ generateRandom: partialCallbacks.generateRandom,
50
+ signJwt: createSignJwtFromCryptoContext(wiaCryptoContext),
51
+ },
52
+ clientAttestation: walletInstanceAttestation,
53
+ authorizationServer: aud,
54
+ signer: {
55
+ method: "jwk",
56
+ alg: "ES256",
57
+ publicJwk: wiaPublicJwk,
58
+ },
59
+ });
39
60
 
40
- const mrtdValidationJwt = await new SignJWT(wiaCryptoContext)
41
- .setProtectedHeader({
42
- typ: "mrtd-ias+jwt",
43
- kid,
44
- })
45
- .setPayload({
46
- iss,
47
- aud,
48
- document_type: "cie",
49
- mrtd,
50
- ias,
51
- })
52
- .setIssuedAt()
53
- .setExpirationTime("5m")
54
- .sign();
61
+ const mrtdValidationJwt = await new SignJWT(wiaCryptoContext)
62
+ .setProtectedHeader({
63
+ typ: "mrtd-ias+jwt",
64
+ kid: wiaPublicJwk.kid,
65
+ })
66
+ .setPayload({
67
+ iss: wiaPublicJwk.kid,
68
+ aud,
69
+ document_type: "cie",
70
+ mrtd,
71
+ ias,
72
+ })
73
+ .setIssuedAt()
74
+ .setExpirationTime("5m")
75
+ .sign();
55
76
 
56
- const verifyResult = await fetchMrtdPopVerify({
57
- popVerifyEndpoint: verifyUrl,
58
- mrtdAuthSession: mrtd_auth_session,
59
- mrtdPopNonce: mrtd_pop_nonce,
60
- clientAttestationDPoP: signedWiaPoP,
61
- mrtdValidationJwt,
62
- walletAttestation: walletInstanceAttestation,
63
- callbacks: {
64
- fetch: appFetch,
65
- ...partialCallbacks,
66
- },
67
- }).catch(sdkUnexpectedStatusCodeToIssuerError);
77
+ const verifyResult = await fetchMrtdPopVerify({
78
+ popVerifyEndpoint: verifyUrl,
79
+ mrtdAuthSession: mrtd_auth_session,
80
+ mrtdPopNonce: mrtd_pop_nonce,
81
+ clientAttestationDPoP,
82
+ mrtdValidationJwt,
83
+ walletAttestation: walletInstanceAttestation,
84
+ callbacks: {
85
+ fetch: appFetch,
86
+ ...partialCallbacks,
87
+ },
88
+ }).catch(sdkUnexpectedStatusCodeToIssuerError);
68
89
 
69
- return {
70
- redirect_uri: verifyResult.redirectUri,
71
- mrtd_val_pop_nonce: verifyResult.mrtdValPopNonce,
90
+ return {
91
+ redirect_uri: verifyResult.redirectUri,
92
+ mrtd_val_pop_nonce: verifyResult.mrtdValPopNonce,
93
+ };
72
94
  };
73
- };
95
+ }
74
96
 
75
97
  export const buildChallengeCallbackUrl: MRTDPoPApi["buildChallengeCallbackUrl"] =
76
98
  async (redirectUri, valPopNonce, authSession) => {
@@ -1,14 +1,22 @@
1
+ import { sdkConfigV1_0, sdkConfigV1_3 } from "../../../utils/config";
1
2
  import type { MRTDPoPApi } from "../api/mrtd-pop";
2
3
  import { verifyAndParseChallengeInfo } from "./01-verify-and-parse-challenge-info";
3
- import { initChallenge } from "./02-init-challenge";
4
+ import { createInitChallenge } from "./02-init-challenge";
4
5
  import {
5
- validateChallenge,
6
+ createValidateChallenge,
6
7
  buildChallengeCallbackUrl,
7
8
  } from "./03-validate-challenge";
8
9
 
9
- export const MRTDPoP: MRTDPoPApi = {
10
+ export const MRTDPoPv1_0: MRTDPoPApi = {
10
11
  verifyAndParseChallengeInfo,
11
- initChallenge,
12
- validateChallenge,
12
+ initChallenge: createInitChallenge({ sdkConfig: sdkConfigV1_0 }),
13
+ validateChallenge: createValidateChallenge({ sdkConfig: sdkConfigV1_0 }),
14
+ buildChallengeCallbackUrl,
15
+ };
16
+
17
+ export const MRTDPoPv1_3: MRTDPoPApi = {
18
+ verifyAndParseChallengeInfo,
19
+ initChallenge: createInitChallenge({ sdkConfig: sdkConfigV1_3 }),
20
+ validateChallenge: createValidateChallenge({ sdkConfig: sdkConfigV1_3 }),
13
21
  buildChallengeCallbackUrl,
14
22
  };
@@ -6,7 +6,7 @@ import type { IssuanceApi } from "../api";
6
6
  import {
7
7
  selectCredentialDefinition,
8
8
  selectResponseMode,
9
- } from "../common/authorization";
9
+ } from "../common/02-start-user-authorization";
10
10
 
11
11
  export const startUserAuthorization: IssuanceApi["startUserAuthorization"] =
12
12
  async (issuerConf, credentialIds, proof, ctx) => {
@@ -64,5 +64,11 @@ export const startUserAuthorization: IssuanceApi["startUserAuthorization"] =
64
64
  }
65
65
  );
66
66
 
67
- return { issuerRequestUri, clientId, codeVerifier, credentialDefinition };
67
+ return {
68
+ issuerRequestUri,
69
+ clientId,
70
+ codeVerifier,
71
+ credentialDefinition,
72
+ responseMode,
73
+ };
68
74
  };
@@ -7,7 +7,11 @@ import {
7
7
  import { hasStatusOrThrow } from "../../../utils/misc";
8
8
  import parseUrl from "parse-url";
9
9
  import type { DcqlQuery } from "dcql";
10
- import { IssuerResponseError, ValidationFailed } from "../../../utils/errors";
10
+ import {
11
+ IssuerResponseError,
12
+ UnimplementedFeatureError,
13
+ ValidationFailed,
14
+ } from "../../../utils/errors";
11
15
  import {
12
16
  decode,
13
17
  SignJWT,
@@ -70,7 +74,7 @@ export const buildAuthorizationUrl: IssuanceApi["buildAuthorizationUrl"] =
70
74
  return { authUrl };
71
75
  };
72
76
 
73
- export const completeUserAuthorizationWithQueryMode: IssuanceApi["completeUserAuthorizationWithQueryMode"] =
77
+ export const completePidUserAuthorizationWithQueryMode: IssuanceApi["completePidUserAuthorizationWithQueryMode"] =
74
78
  async (authRedirectUrl) => {
75
79
  Logger.log(
76
80
  LogLevel.DEBUG,
@@ -81,6 +85,14 @@ export const completeUserAuthorizationWithQueryMode: IssuanceApi["completeUserAu
81
85
  return parseAuthorizationResponse(query);
82
86
  };
83
87
 
88
+ export const completeEaaUserAuthorizationWithQueryMode: IssuanceApi["completeEaaUserAuthorizationWithQueryMode"] =
89
+ () => {
90
+ throw new UnimplementedFeatureError(
91
+ "completeEaaUserAuthorizationWithQueryMode",
92
+ "1.0.0"
93
+ );
94
+ };
95
+
84
96
  export const getRequestedCredentialToBePresented: IssuanceApi["getRequestedCredentialToBePresented"] =
85
97
  async (issuerRequestUri, clientId, issuerConf, appFetch = fetch) => {
86
98
  Logger.log(
@@ -130,7 +142,7 @@ export const completeUserAuthorizationWithFormPostJwtMode: IssuanceApi["complete
130
142
  requestObject,
131
143
  _issuerConfig,
132
144
  pid,
133
- { wiaCryptoContext, pidKeyTag, appFetch = fetch }
145
+ { wiaCryptoContext, appFetch = fetch }
134
146
  ) => {
135
147
  Logger.log(
136
148
  LogLevel.DEBUG,
@@ -139,7 +151,7 @@ export const completeUserAuthorizationWithFormPostJwtMode: IssuanceApi["complete
139
151
 
140
152
  const dcqlQueryResult = await RemotePresentationFlow.evaluateDcqlQuery(
141
153
  requestObject.dcql_query as DcqlQuery,
142
- [[pidKeyTag, pid]]
154
+ [pid]
143
155
  );
144
156
 
145
157
  const authRequestObject = {
@@ -3,7 +3,8 @@ import { evaluateIssuerTrust } from "./01-evaluate-issuer-trust";
3
3
  import { startUserAuthorization } from "./02-start-user-authorization";
4
4
  import {
5
5
  continueUserAuthorizationWithMRTDPoPChallenge,
6
- completeUserAuthorizationWithQueryMode,
6
+ completePidUserAuthorizationWithQueryMode,
7
+ completeEaaUserAuthorizationWithQueryMode,
7
8
  completeUserAuthorizationWithFormPostJwtMode,
8
9
  buildAuthorizationUrl,
9
10
  getRequestedCredentialToBePresented,
@@ -14,13 +15,14 @@ import {
14
15
  obtainCredentialsBatch,
15
16
  } from "./05-obtain-credential";
16
17
  import { verifyAndParseCredential } from "./06-verify-and-parse-credential";
17
- import { MRTDPoP } from "../mrtd-pop";
18
+ import { MRTDPoPv1_0 } from "../mrtd-pop";
18
19
 
19
20
  export const Issuance: IssuanceApi = {
20
21
  evaluateIssuerTrust,
21
22
  startUserAuthorization,
22
23
  buildAuthorizationUrl,
23
- completeUserAuthorizationWithQueryMode,
24
+ completePidUserAuthorizationWithQueryMode,
25
+ completeEaaUserAuthorizationWithQueryMode,
24
26
  continueUserAuthorizationWithMRTDPoPChallenge,
25
27
  getRequestedCredentialToBePresented,
26
28
  completeUserAuthorizationWithFormPostJwtMode,
@@ -28,5 +30,5 @@ export const Issuance: IssuanceApi = {
28
30
  obtainCredential,
29
31
  obtainCredentialsBatch,
30
32
  verifyAndParseCredential,
31
- MRTDPoP,
33
+ MRTDPoP: MRTDPoPv1_0,
32
34
  };