@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
@@ -41,6 +41,7 @@ export const mapToIssuerConfig = createMapper<
41
41
  const {
42
42
  oauth_authorization_server,
43
43
  openid_credential_issuer,
44
+ openid_credential_verifier,
44
45
  federation_entity,
45
46
  } = x.metadata;
46
47
 
@@ -60,14 +61,19 @@ export const mapToIssuerConfig = createMapper<
60
61
  credential_configurations_supported: mapCredentialConfigurationsSupported(
61
62
  openid_credential_issuer
62
63
  ),
63
- keys: openid_credential_issuer.jwks.keys as JWK[],
64
+ keys: [
65
+ ...openid_credential_issuer.jwks.keys,
66
+ ...oauth_authorization_server.jwks.keys,
67
+ ] as JWK[],
64
68
  pushed_authorization_request_endpoint:
65
69
  oauth_authorization_server.pushed_authorization_request_endpoint,
66
70
  token_endpoint: oauth_authorization_server.token_endpoint,
67
- nonce_endpoint: openid_credential_issuer.nonce_endpoint!,
71
+ nonce_endpoint: openid_credential_issuer.nonce_endpoint ?? "",
68
72
  federation_entity: federation_entity ?? {},
69
73
  credential_issuance_batch_size:
70
74
  openid_credential_issuer.batch_credential_issuance?.batch_size,
75
+ encrypted_response_enc_values_supported:
76
+ openid_credential_verifier?.encrypted_response_enc_values_supported,
71
77
  };
72
78
  },
73
79
  { outputSchema: IssuerConfig } // Output validation for extra-safety
@@ -76,13 +82,9 @@ export const mapToIssuerConfig = createMapper<
76
82
  export const mapToRequestObject = createMapper<
77
83
  ParsedAuthorizeRequestResult,
78
84
  RequestObject
79
- >(({ payload }) => ({
80
- iss: payload.iss ?? "UNKNOWN_ISSUER",
81
- client_id: payload.client_id,
82
- dcql_query: payload.dcql_query,
83
- nonce: payload.nonce,
84
- response_uri: payload.response_uri,
85
- state: payload.state,
86
- response_mode: payload.response_mode,
87
- response_type: payload.response_type,
85
+ >(({ header, payload }) => ({
86
+ ...payload,
87
+ iss: payload.iss ?? "",
88
+ trust_chain: header.trust_chain,
89
+ x5c: header.x5c as string[] | undefined,
88
90
  }));
@@ -7,7 +7,7 @@ export interface VerifyRequestObjectApi {
7
7
  * @since 1.0.0
8
8
  *
9
9
  * @param requestObjectEncodedJwt The Request Object in JWT format
10
- * @param params.clientId The client ID to verify
10
+ * @param params.clientId The client ID to verify (it may include a prefix)
11
11
  * @param params.rpConf Optional Relying Party configuration (OpenID Federation clients only)
12
12
  * @param params.state Optional state
13
13
  * @returns The verified Request Object
@@ -72,13 +72,9 @@ export type RemotePresentationDetails = {
72
72
  type ClientMetadata = {
73
73
  jwks: jsonWebKeySet;
74
74
  encrypted_response_enc_values_supported: string[];
75
- client_id: string;
76
- client_name: string;
77
- logo_uri: string;
78
- application_type: "web";
79
- request_uris: string[];
80
- response_uris: string[];
81
75
  vp_formats_supported: Record<string, { "sd-jwt_alg_values"?: string[] }>;
76
+ client_name?: string;
77
+ logo_uri?: string;
82
78
  };
83
79
 
84
80
  /**
@@ -88,7 +84,7 @@ export type RequestObject = {
88
84
  iss: string;
89
85
  response_uri: string;
90
86
  nonce: string;
91
- state: string;
87
+ state?: string;
92
88
  client_id: string;
93
89
  dcql_query: Record<string, unknown>;
94
90
  response_type: "vp_token";
@@ -9,11 +9,11 @@ import type { DirectAuthorizationBodyPayload } from "../../v1.0.0/types";
9
9
  * @returns A URL-encoded string suitable for an `application/x-www-form-urlencoded` POST body.
10
10
  */
11
11
  export const buildDirectPostBody = async (
12
- requestObject: RequestObject,
12
+ { state }: RequestObject,
13
13
  payload: DirectAuthorizationBodyPayload
14
14
  ): Promise<string> => {
15
15
  const formUrlEncodedBody = new URLSearchParams({
16
- state: requestObject.state,
16
+ ...(state && { state }),
17
17
  ...Object.entries(payload).reduce(
18
18
  (acc, [key, value]) => ({
19
19
  ...acc,
@@ -5,8 +5,8 @@ import type {
5
5
  Credential4Dcql,
6
6
  EvaluatedDisclosure,
7
7
  PresentationFrame,
8
- } from "../api";
9
- import { getValidDcqlClaims } from "../common/utils/dcql";
8
+ } from "../../api";
9
+ import { getValidDcqlClaims } from "./dcql";
10
10
 
11
11
  type CustomDcqlMdocCredential = DcqlMdocCredential & {
12
12
  original_credential: Credential4Dcql;
@@ -81,7 +81,7 @@ export const buildDirectPostJwtBody = async (
81
81
  // Build the x-www-form-urlencoded form body
82
82
  const formBody = new URLSearchParams({
83
83
  response: encryptedResponse,
84
- state: requestObject.state,
84
+ ...(requestObject.state && { state: requestObject.state }),
85
85
  });
86
86
  return formBody.toString();
87
87
  };
@@ -14,7 +14,7 @@ import { mapToRequestObject } from "./mappers";
14
14
  import type { RawRequestObject } from "./types";
15
15
 
16
16
  export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
17
- async (requestObjectEncodedJwt, { clientId, rpConf }) => {
17
+ async (requestObjectEncodedJwt, { clientId: fullClientId, rpConf }) => {
18
18
  const parsedRequestObject = await sdkParseAuthorizeRequest({
19
19
  config: sdkConfigV1_3,
20
20
  requestObjectJwt: requestObjectEncodedJwt,
@@ -25,17 +25,22 @@ export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
25
25
 
26
26
  const rawRequestObject = parsedRequestObject as RawRequestObject;
27
27
 
28
- const clientIdPrefix = extractClientIdPrefix(clientId);
28
+ const { prefix, clientId } = extractClientIdPrefix(fullClientId);
29
29
 
30
- if (clientIdPrefix === ClientIdPrefix.X509_HASH) {
30
+ if (prefix === ClientIdPrefix.X509_HASH) {
31
31
  validateX509HashClient(rawRequestObject.header.x5c, clientId);
32
32
  }
33
33
 
34
34
  if (
35
- clientIdPrefix === ClientIdPrefix.OPENID_FEDERATION ||
36
- clientIdPrefix === ClientIdPrefix.NONE
35
+ prefix === ClientIdPrefix.OPENID_FEDERATION ||
36
+ prefix === ClientIdPrefix.NONE
37
37
  ) {
38
- validateOpenIDFederationClient(rawRequestObject, clientId, rpConf);
38
+ validateOpenIDFederationClient(
39
+ rawRequestObject,
40
+ fullClientId,
41
+ clientId,
42
+ rpConf
43
+ );
39
44
  }
40
45
 
41
46
  return {
@@ -45,6 +50,7 @@ export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
45
50
 
46
51
  const validateOpenIDFederationClient = (
47
52
  requestObject: RawRequestObject,
53
+ fullClientId: string,
48
54
  clientId: string,
49
55
  rpConf: RelyingPartyConfig | undefined
50
56
  ) => {
@@ -55,8 +61,8 @@ const validateOpenIDFederationClient = (
55
61
  }
56
62
 
57
63
  const isClientIdMatch =
58
- clientId === requestObject.payload.client_id &&
59
- stripOpenIdFederationPrefix(clientId) === rpConf.subject;
64
+ fullClientId === requestObject.payload.client_id &&
65
+ clientId === rpConf.subject;
60
66
 
61
67
  if (!isClientIdMatch) {
62
68
  throw new InvalidRequestObjectError(
@@ -67,10 +73,8 @@ const validateOpenIDFederationClient = (
67
73
 
68
74
  const validateX509HashClient = (
69
75
  certificateChain: string[],
70
- clientId: string
76
+ x509Hash: string
71
77
  ) => {
72
- const [, x509Hash] = clientId.split(":");
73
-
74
78
  const calculatedHash = QuickCrypto.createHash("sha-256")
75
79
  .update(certificateChain[0]!, "base64")
76
80
  .digest("base64url");
@@ -81,6 +85,3 @@ const validateX509HashClient = (
81
85
  );
82
86
  }
83
87
  };
84
-
85
- const stripOpenIdFederationPrefix = (clientId: string) =>
86
- clientId.replace("openid_federation:", "");
@@ -2,13 +2,13 @@ import { DcqlQuery, DcqlError } from "dcql";
2
2
  import { isValiError } from "valibot";
3
3
  import { CredentialsNotFoundError } from "../common/errors";
4
4
  import type { CredentialPurpose } from "../api/06-evaluate-dcql-query";
5
- import * as mdocUtils from "./utils.mdoc";
6
- import type { Credential4Dcql, RemotePresentationApi } from "../api";
7
5
  import * as sdJwtUtils from "../common/utils/sd-jwt";
8
- import { getClaimsFromDcqlMatch } from "./utils.mdoc";
6
+ import * as mdocUtils from "../common/utils/mdoc";
7
+ import type { Credential4Dcql, RemotePresentationApi } from "../api";
9
8
  import {
10
9
  extractFailedCredentialsDetails,
11
10
  getDcqlQueryMatches,
11
+ getClaimsFromDcqlMatch,
12
12
  getPresentationFrameFromDcqlMatch,
13
13
  } from "../common/utils/dcql";
14
14
 
@@ -17,6 +17,7 @@ import { AuthorizationResponse } from "./types";
17
17
  import { buildDirectPostBody } from "../common/utils/http";
18
18
  import { prepareVpToken } from "../../../sd-jwt";
19
19
  import { createCryptoContextFor } from "../../../utils/crypto";
20
+ import { sdkConfigV1_3 } from "../../../utils/config";
20
21
  import { prepareVpTokenMdoc } from "../../../mdoc";
21
22
 
22
23
  /**
@@ -126,6 +127,7 @@ export const sendAuthorizationResponse: RemotePresentationApi["sendAuthorization
126
127
  );
127
128
 
128
129
  const { jarm } = await sdkCreateAuthorizationResponse({
130
+ config: sdkConfigV1_3,
129
131
  requestObject,
130
132
  rpJwks,
131
133
  vp_token,
@@ -21,7 +21,7 @@ export const mapToRelyingPartyConfig = createMapper<
21
21
 
22
22
  export const mapToRequestObject = createMapper<RawRequestObject, RequestObject>(
23
23
  ({ payload, header }) => ({
24
- iss: payload.iss,
24
+ iss: payload.iss ?? "",
25
25
  client_id: payload.client_id,
26
26
  dcql_query: payload.dcql_query,
27
27
  nonce: payload.nonce,
@@ -111,15 +111,16 @@ const res = await wallet.CredentialStatus.statusList.get(
111
111
  );
112
112
 
113
113
  // Verify and parse the status list response to get the credential status
114
- const { status } =
114
+ const { status, statusBit } =
115
115
  await wallet.CredentialStatus.statusList.verifyAndParse(
116
- issuerConf,
116
+ issuerConf.keys,
117
117
  res
118
118
  );
119
119
 
120
120
  return {
121
121
  statusList: res.statusList,
122
122
  status,
123
+ statusBit,
123
124
  };
124
125
  ```
125
126
 
@@ -1,8 +1,6 @@
1
1
  import type { Out } from "../../../utils/misc";
2
- import type {
3
- CredentialFormat,
4
- IssuerConfig,
5
- } from "../../../credential/issuance/api";
2
+ import type { CredentialFormat } from "../../../credential/issuance/api";
3
+ import type { JWK } from "../../../utils/jwk";
6
4
 
7
5
  export interface StatusListApi {
8
6
  isSupported: true;
@@ -22,6 +20,7 @@ export interface StatusListApi {
22
20
  * @since 1.3.3
23
21
  * @param credential The credential to get the status list for
24
22
  * @param format The credential format
23
+ * @param context.appFetch Optional fetch function to use for the network request
25
24
  * @returns The raw status list, the index of the credential and other metadata
26
25
  */
27
26
  get(
@@ -40,11 +39,15 @@ export interface StatusListApi {
40
39
  /**
41
40
  * Verifies the signature of a status list and extract the status at the specified index.
42
41
  * @since 1.3.3
43
- * @param issuerConf The Credential Issuer common configuration
42
+ * @param keys The JSON Web Key Set to verify the status list signature
44
43
  * @param statusListParams The raw status list, the index to read and other metadata
44
+ * @return The status of the credential and the raw status bit in hexadecimal format (e.g. "0x01")
45
45
  */
46
46
  verifyAndParse(
47
- issuerConf: IssuerConfig,
47
+ keys: JWK[],
48
48
  statusListParams: Out<StatusListApi["get"]>
49
- ): Promise<{ status: number }>;
49
+ ): Promise<{
50
+ statusBit: string;
51
+ status: string;
52
+ }>;
50
53
  }
@@ -1,4 +1,5 @@
1
1
  import { CBOR } from "@pagopa/io-react-native-iso18013";
2
+ import { decode as decodeJwt } from "@pagopa/io-react-native-jwt";
2
3
  import {
3
4
  getStatusListFromJWT,
4
5
  type StatusListEntry,
@@ -38,13 +39,26 @@ export const getStatusList: StatusListApi["get"] = async (
38
39
  ) => {
39
40
  const { uri, idx } = await getStatusListEntry(credential, format);
40
41
 
41
- const statusList = await appFetch(uri, {
42
- headers: {
43
- Accept: "application/statuslist+jwt",
44
- },
45
- })
46
- .then(hasStatusOrThrow(200))
47
- .then((response) => response.text());
42
+ const fetchStatusList = (options: { cacheDisabled?: boolean } = {}) =>
43
+ appFetch(uri, {
44
+ headers: {
45
+ Accept: "application/statuslist+jwt",
46
+ ...(options.cacheDisabled && { "Cache-Control": "no-cache" }),
47
+ },
48
+ })
49
+ .then(hasStatusOrThrow(200))
50
+ .then((response) => response.text());
48
51
 
52
+ // When the HTTP response includes cache headers, fetch will return a cached response and the JWT might be expired
53
+ let statusList = await fetchStatusList();
54
+ const decoded = decodeJwt(statusList);
55
+
56
+ const { exp } = decoded.payload;
57
+
58
+ // If the status list JWT is expired, try to fetch it again bypassing the HTTP cache.
59
+ // If it is still expired after the refetch, `verifyAndParseStatusList` will throw.
60
+ if (exp && exp < Math.floor(Date.now() / 1000)) {
61
+ statusList = await fetchStatusList({ cacheDisabled: true });
62
+ }
49
63
  return { statusList, uri, idx, format: "jwt" };
50
64
  };
@@ -2,18 +2,32 @@ import { verify } from "@pagopa/io-react-native-jwt";
2
2
  import { getListFromStatusListJWT } from "@sd-jwt/jwt-status-list";
3
3
  import type { StatusListApi } from "../api/status-list";
4
4
 
5
+ /**
6
+ * Mapping of status bits to their corresponding meaning as defined in the specification.
7
+ * @see https://italia.github.io/eid-wallet-it-docs/releases/1.3.3/en/credential-revocation.html#token-status-lists
8
+ */
9
+ const CredentialStatusMap = {
10
+ 0x00: "VALID",
11
+ 0x01: "INVALID",
12
+ 0x02: "SUSPENDED",
13
+ 0x03: "UPDATE",
14
+ 0x0b: "ATTRIBUTE_UPDATE",
15
+ } as const;
16
+
17
+ type CredentialStatusBit = keyof typeof CredentialStatusMap;
18
+
5
19
  export const verifyAndParseStatusList: StatusListApi["verifyAndParse"] = async (
6
- issuerConf,
20
+ keys,
7
21
  { statusList: rawStatusList, idx }
8
22
  ) => {
9
- await verify(rawStatusList, issuerConf.keys);
23
+ await verify(rawStatusList, keys);
10
24
 
11
25
  const statusList = getListFromStatusListJWT(rawStatusList);
26
+ const statusBit = statusList.getStatus(idx) as CredentialStatusBit;
27
+ const status = CredentialStatusMap[statusBit];
12
28
 
13
- const status = statusList.getStatus(idx);
14
-
15
- // TODO: [SIW-3992] Improve the return object with additional data, throw CredentialInvalidStatus when invalid
16
29
  return {
17
30
  status,
31
+ statusBit: `0x${statusBit.toString(16).padStart(2, "0").toUpperCase()}`,
18
32
  };
19
33
  };
@@ -20,13 +20,15 @@ const AdministrativeExpirationUserInfo = z.object({
20
20
  description_l10n_id: z.string(),
21
21
  });
22
22
 
23
- const AllowedState = z
23
+ export const AllowedState = z
24
24
  .object({
25
25
  title_l10n_id: z.string(),
26
26
  description_l10n_id: z.string(),
27
27
  })
28
28
  .catchall(z.string());
29
29
 
30
+ export type AllowedState = z.infer<typeof AllowedState>;
31
+
30
32
  const CredentialPurpose = z.object({
31
33
  id: z.string(),
32
34
  description: z.string().optional(),
@@ -116,6 +118,7 @@ export const DigitalCredential = z.object({
116
118
  formats: z.array(CredentialFormat).optional(),
117
119
  // claims: z.array(Claim), // TODO: [SIW-3978] Should we keep claims?
118
120
  });
121
+ export type DigitalCredential = z.infer<typeof DigitalCredential>;
119
122
 
120
123
  const TaxonomyPurpose = z.object({
121
124
  id: z.string(),
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  type CatalogueTranslations,
3
+ type DigitalCredential,
3
4
  type DigitalCredentialsCatalogue,
4
5
  type LocalizationInfo,
5
6
  type Taxonomy,
@@ -48,10 +49,24 @@ export interface CredentialsCatalogueApi {
48
49
  locales: string[],
49
50
  ctx?: FetchContext
50
51
  ): Promise<CatalogueTranslations>;
52
+
53
+ /**
54
+ * Given a statusBit (e.g. "0x00", "0x0B") and a DigitalCredential from the
55
+ * catalogue, returns the matching l10n IDs or undefined if not found.
56
+ * The comparison is case-insensitive to handle uppercase statusBit values
57
+ * returned by verifyAndParseStatusList against lowercase keys in the catalogue.
58
+ *
59
+ * @since 1.0.0
60
+ */
61
+ getStatusL10nIds(
62
+ statusBit: string,
63
+ credentialConfig: DigitalCredential
64
+ ): { titleL10nId: string; descriptionL10nId: string } | undefined;
51
65
  }
52
66
 
53
67
  export {
54
68
  type CatalogueTranslations,
69
+ type DigitalCredential,
55
70
  type DigitalCredentialsCatalogue,
56
71
  type LocalizationInfo,
57
72
  type Taxonomy,
@@ -0,0 +1,25 @@
1
+ import { AllowedState } from "../api/DigitalCredentialsCatalogue";
2
+ import { type CredentialsCatalogueApi } from "../api";
3
+
4
+ /**
5
+ * Given a statusBit (e.g. "0x00", "0x0B") and a DigitalCredential from the
6
+ * catalogue, returns the matching l10n IDs or undefined if not found.
7
+ * The comparison is case-insensitive to handle uppercase statusBit values
8
+ * returned by verifyAndParseStatusList against lowercase keys in the catalogue.
9
+ */
10
+ export const getStatusL10nIds: CredentialsCatalogueApi["getStatusL10nIds"] = (
11
+ statusBit,
12
+ credentialConfig
13
+ ) => {
14
+ const normalizedBit = statusBit.toLowerCase();
15
+ const match = credentialConfig.validity_info.allowed_states.find(
16
+ (s): s is AllowedState =>
17
+ typeof s === "object" &&
18
+ Object.keys(s).some((k) => k.toLowerCase() === normalizedBit)
19
+ );
20
+ if (!match) return undefined;
21
+ return {
22
+ titleL10nId: match.title_l10n_id,
23
+ descriptionL10nId: match.description_l10n_id,
24
+ };
25
+ };
@@ -1,6 +1,8 @@
1
1
  import type { CredentialsCatalogueApi } from "../api";
2
2
  import { fetchAndParseCatalogue } from "./fetch-and-parse-catalogue";
3
+ import { getStatusL10nIds } from "../common/get-status-l10n-ids";
3
4
 
4
5
  export const CredentialsCatalogue: CredentialsCatalogueApi = {
5
6
  fetchAndParseCatalogue,
7
+ getStatusL10nIds,
6
8
  };
@@ -1,8 +1,10 @@
1
1
  import type { CredentialsCatalogueApi } from "../api";
2
2
  import { fetchAndParseCatalogue } from "./fetch-and-parse-catalogue";
3
3
  import { fetchTranslations } from "./fetch-translations";
4
+ import { getStatusL10nIds } from "../common/get-status-l10n-ids";
4
5
 
5
6
  export const CredentialsCatalogue: CredentialsCatalogueApi = {
6
7
  fetchAndParseCatalogue,
7
8
  fetchTranslations,
9
+ getStatusL10nIds,
8
10
  };
package/src/mdoc/index.ts CHANGED
@@ -1,19 +1,12 @@
1
1
  import { CBOR, COSE, ISO18013_7 } from "@pagopa/io-react-native-iso18013";
2
2
  import { b64utob64 } from "jsrsasign";
3
- import {
4
- verifyCertificateChain,
5
- type CertificateValidationResult,
6
- type PublicKey,
7
- type X509CertificateOptions,
8
- } from "@pagopa/io-react-native-crypto";
9
- import {
10
- MissingX509CertsError,
11
- X509ValidationError,
12
- } from "../trust/common/errors";
3
+ import { type PublicKey } from "@pagopa/io-react-native-crypto";
4
+ import { MissingX509CertsError } from "../trust/common/errors";
13
5
  import { IoWalletError } from "../utils/errors";
14
6
  import { convertBase64DerToPem, getSigninJwkFromCert } from "../utils/crypto";
15
- import type { Presentation } from "src/credential/presentation";
7
+ import type { Presentation } from "../credential/presentation";
16
8
  import { removePadding } from "@pagopa/io-react-native-jwt";
9
+ import { verifyX509Chain } from "../utils/x509";
17
10
  export * from "./utils";
18
11
 
19
12
  export const verify = async (
@@ -37,7 +30,7 @@ export const verify = async (
37
30
  const x5chain =
38
31
  issuerSigned.issuerAuth.unprotectedHeader.x5chain.map(b64utob64);
39
32
  // Verify the x5chain
40
- await verifyX5chain(x5chain, x509CertRoot);
33
+ await verifyX509Chain(x5chain, x509CertRoot);
41
34
 
42
35
  const coseSign1 = issuerSigned.issuerAuth.rawValue;
43
36
 
@@ -50,35 +43,6 @@ export const verify = async (
50
43
  return { issuerSigned };
51
44
  };
52
45
 
53
- /**
54
- * This function checks whether the x509 certificate chain is valid against a specified Certificate Authority (CA)
55
- *
56
- * @param x5chain The mdoc's x509 certificate chain
57
- * @param x509CertRoot The Trust Anchor CA
58
- * @param options Options for certificate validation
59
- */
60
- const verifyX5chain = async (
61
- x5chain: string[],
62
- x509CertRoot: string,
63
- options: X509CertificateOptions = {
64
- connectTimeout: 10000,
65
- readTimeout: 10000,
66
- requireCrl: true,
67
- }
68
- ) => {
69
- const x509ValidationResult: CertificateValidationResult =
70
- await verifyCertificateChain(x5chain, x509CertRoot, options);
71
-
72
- if (!x509ValidationResult.isValid) {
73
- throw new X509ValidationError(
74
- `X.509 certificate chain validation failed. Status: ${x509ValidationResult.validationStatus}. Error: ${x509ValidationResult.errorMessage}`,
75
- {
76
- x509ValidationStatus: x509ValidationResult.validationStatus,
77
- x509ErrorMessage: x509ValidationResult.errorMessage,
78
- }
79
- );
80
- }
81
- };
82
46
  /**
83
47
  * This function verifies that the signature is valid for the given certificate.
84
48
  * If not, it throws an error
@@ -28,20 +28,8 @@ describe("Verification.time", () => {
28
28
 
29
29
  it("rejects invalid type", () => {
30
30
  const value = {
31
- trust_framework: "eidas",
31
+ trust_framework: ["eidas"],
32
32
  assurance_level: "high",
33
- evidence: [
34
- {
35
- type: "vouch",
36
- time: null,
37
- attestation: {
38
- type: "digital_attestation",
39
- reference_number: "abc",
40
- date_of_issuance: "2025-09-02",
41
- voucher: { organization: "IPZS" },
42
- },
43
- },
44
- ],
45
33
  };
46
34
 
47
35
  expect(Verification.safeParse(value).success).toBe(false);
@@ -4,18 +4,6 @@ import { getVerification } from "..";
4
4
  describe("SD-JWT getVerification", () => {
5
5
  it("extracts the verification claims correctly", () => {
6
6
  expect(getVerification(pid)).toEqual({
7
- evidence: [
8
- {
9
- attestation: {
10
- date_of_issuance: "2025-06-23",
11
- voucher: { organization: "Ministero dell'Interno" },
12
- type: "digital_attestation",
13
- reference_number: "123456789",
14
- },
15
- time: "2025-06-23T13:14:25Z",
16
- type: "vouch",
17
- },
18
- ],
19
7
  trust_framework: "it_cie",
20
8
  assurance_level: "high",
21
9
  });
@@ -64,19 +64,6 @@ export type Verification = z.infer<typeof Verification>;
64
64
  export const Verification = z.object({
65
65
  trust_framework: z.string(),
66
66
  assurance_level: z.string(),
67
- evidence: z.array(
68
- z.object({
69
- type: z.literal("vouch"),
70
- // Support both string and UNIX timestamp for backward compatibility
71
- time: z.union([z.string(), z.number()]),
72
- attestation: z.object({
73
- type: z.literal("digital_attestation"),
74
- reference_number: z.string(),
75
- date_of_issuance: z.string(),
76
- voucher: z.object({ organization: z.string() }),
77
- }),
78
- })
79
- ),
80
67
  });
81
68
 
82
69
  /**
@@ -1,4 +1,9 @@
1
- import { EncryptJwe, getJwkFromHeader } from "@pagopa/io-react-native-jwt";
1
+ import {
2
+ EncryptJwe,
3
+ getJwkFromHeader,
4
+ SignJWT,
5
+ type CryptoContext,
6
+ } from "@pagopa/io-react-native-jwt";
2
7
  import { verify } from "@pagopa/io-react-native-jwt";
3
8
  import { type CallbackContext, type JwtSigner } from "@pagopa/io-wallet-oauth2";
4
9
  import { digest } from "@sd-jwt/crypto-nodejs";
@@ -109,3 +114,25 @@ export const createVerifyJwtFromJwks = (
109
114
  }
110
115
  };
111
116
  };
117
+
118
+ /**
119
+ * Create a signJwt implementation that signs a JWT using the provided CryptoContext.
120
+ * @param cryptoContext The CryptoContext to use for signing the JWT
121
+ * @returns Function that implements `signJwt` callback
122
+ */
123
+ export const createSignJwtFromCryptoContext = (
124
+ cryptoContext: CryptoContext
125
+ ): CallbackContext["signJwt"] => {
126
+ return async function signJwt(jwtSigner, { header, payload }) {
127
+ return {
128
+ jwt: await new SignJWT(cryptoContext)
129
+ .setProtectedHeader(header)
130
+ .setPayload(payload)
131
+ .sign(),
132
+ signerJwk:
133
+ jwtSigner.method === "jwk"
134
+ ? jwtSigner.publicJwk
135
+ : await cryptoContext.getPublicKey(),
136
+ };
137
+ };
138
+ };
@@ -16,3 +16,10 @@ export const sdkConfigV1_0 = new IoWalletSdkConfig({
16
16
  export const sdkConfigV1_3 = new IoWalletSdkConfig({
17
17
  itWalletSpecsVersion: ItWalletSpecsVersion.V1_3,
18
18
  });
19
+
20
+ /**
21
+ * IO Wallet SDK configuration object for v1.4 specs.
22
+ */
23
+ export const sdkConfigV1_4 = new IoWalletSdkConfig({
24
+ itWalletSpecsVersion: ItWalletSpecsVersion.V1_4,
25
+ });