@pagopa/io-react-native-wallet 1.7.1 → 2.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (443) hide show
  1. package/README.md +47 -1
  2. package/lib/commonjs/client/generated/wallet-provider.js +49 -20
  3. package/lib/commonjs/client/generated/wallet-provider.js.map +1 -1
  4. package/lib/commonjs/credential/index.js +5 -1
  5. package/lib/commonjs/credential/index.js.map +1 -1
  6. package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js +27 -0
  7. package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js.map +1 -0
  8. package/lib/commonjs/credential/issuance/03-start-user-authorization.js +25 -16
  9. package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
  10. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +30 -18
  11. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
  12. package/lib/commonjs/credential/issuance/05-authorize-access.js +17 -12
  13. package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
  14. package/lib/commonjs/credential/issuance/06-obtain-credential.js +36 -29
  15. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  16. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +27 -207
  17. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  18. package/lib/commonjs/credential/issuance/README.md +23 -20
  19. package/lib/commonjs/credential/issuance/const.js +1 -1
  20. package/lib/commonjs/credential/issuance/const.js.map +1 -1
  21. package/lib/commonjs/credential/issuance/index.js +3 -3
  22. package/lib/commonjs/credential/issuance/index.js.map +1 -1
  23. package/lib/commonjs/credential/presentation/01-start-flow.js +14 -15
  24. package/lib/commonjs/credential/presentation/01-start-flow.js.map +1 -1
  25. package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js +6 -4
  26. package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
  27. package/lib/commonjs/credential/presentation/03-get-request-object.js +34 -7
  28. package/lib/commonjs/credential/presentation/03-get-request-object.js.map +1 -1
  29. package/lib/commonjs/credential/presentation/04-retrieve-rp-jwks.js +4 -126
  30. package/lib/commonjs/credential/presentation/04-retrieve-rp-jwks.js.map +1 -1
  31. package/lib/commonjs/credential/presentation/05-verify-request-object.js +80 -25
  32. package/lib/commonjs/credential/presentation/05-verify-request-object.js.map +1 -1
  33. package/lib/commonjs/credential/presentation/06-fetch-presentation-definition.js +6 -30
  34. package/lib/commonjs/credential/presentation/06-fetch-presentation-definition.js.map +1 -1
  35. package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +97 -117
  36. package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
  37. package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js +86 -191
  38. package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
  39. package/lib/commonjs/credential/presentation/08-send-authorization-response.js +112 -176
  40. package/lib/commonjs/credential/presentation/08-send-authorization-response.js.map +1 -1
  41. package/lib/commonjs/credential/presentation/README.md +74 -79
  42. package/lib/commonjs/credential/presentation/errors.js +42 -21
  43. package/lib/commonjs/credential/presentation/errors.js.map +1 -1
  44. package/lib/commonjs/credential/presentation/index.js +13 -13
  45. package/lib/commonjs/credential/presentation/index.js.map +1 -1
  46. package/lib/commonjs/credential/presentation/types.js +53 -29
  47. package/lib/commonjs/credential/presentation/types.js.map +1 -1
  48. package/lib/commonjs/credential/status/01-start-flow.js +2 -0
  49. package/lib/commonjs/credential/status/01-start-flow.js.map +1 -0
  50. package/lib/commonjs/credential/status/02-status-attestation.js +73 -0
  51. package/lib/commonjs/credential/status/02-status-attestation.js.map +1 -0
  52. package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js +55 -0
  53. package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js.map +1 -0
  54. package/lib/commonjs/credential/status/README.md +67 -0
  55. package/lib/commonjs/credential/status/index.js +27 -0
  56. package/lib/commonjs/credential/status/index.js.map +1 -0
  57. package/lib/commonjs/credential/status/types.js +48 -0
  58. package/lib/commonjs/credential/status/types.js.map +1 -0
  59. package/lib/commonjs/credential/trustmark/README.md +62 -0
  60. package/lib/commonjs/credential/trustmark/get-credential-trustmark.js +86 -0
  61. package/lib/commonjs/credential/trustmark/get-credential-trustmark.js.map +1 -0
  62. package/lib/commonjs/credential/trustmark/index.js +13 -0
  63. package/lib/commonjs/credential/trustmark/index.js.map +1 -0
  64. package/lib/commonjs/index.js +5 -1
  65. package/lib/commonjs/index.js.map +1 -1
  66. package/lib/commonjs/pid/sd-jwt/types.js +18 -2
  67. package/lib/commonjs/pid/sd-jwt/types.js.map +1 -1
  68. package/lib/commonjs/sd-jwt/__test__/index.test.js +22 -34
  69. package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -1
  70. package/lib/commonjs/sd-jwt/__test__/types.test.js +11 -23
  71. package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -1
  72. package/lib/commonjs/sd-jwt/index.js +1 -7
  73. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  74. package/lib/commonjs/sd-jwt/types.js +5 -21
  75. package/lib/commonjs/sd-jwt/types.js.map +1 -1
  76. package/lib/commonjs/trust/README.md +147 -0
  77. package/lib/commonjs/trust/chain.js +153 -0
  78. package/lib/commonjs/trust/chain.js.map +1 -0
  79. package/lib/commonjs/trust/errors.js +133 -0
  80. package/lib/commonjs/trust/errors.js.map +1 -0
  81. package/lib/commonjs/trust/index.js +288 -0
  82. package/lib/commonjs/trust/index.js.map +1 -0
  83. package/lib/commonjs/{entity/trust → trust}/types.js +27 -47
  84. package/lib/commonjs/trust/types.js.map +1 -0
  85. package/lib/commonjs/trust/utils.js +70 -0
  86. package/lib/commonjs/trust/utils.js.map +1 -0
  87. package/lib/commonjs/utils/crypto.js +5 -112
  88. package/lib/commonjs/utils/crypto.js.map +1 -1
  89. package/lib/commonjs/utils/decoder.js +2 -0
  90. package/lib/commonjs/utils/decoder.js.map +1 -1
  91. package/lib/commonjs/utils/error-codes.js +22 -2
  92. package/lib/commonjs/utils/error-codes.js.map +1 -1
  93. package/lib/commonjs/utils/errors.js +72 -4
  94. package/lib/commonjs/utils/errors.js.map +1 -1
  95. package/lib/commonjs/utils/logging.js +68 -0
  96. package/lib/commonjs/utils/logging.js.map +1 -0
  97. package/lib/commonjs/utils/misc.js +2 -0
  98. package/lib/commonjs/utils/misc.js.map +1 -1
  99. package/lib/commonjs/utils/par.js +17 -10
  100. package/lib/commonjs/utils/par.js.map +1 -1
  101. package/lib/commonjs/utils/string.js +1 -12
  102. package/lib/commonjs/utils/string.js.map +1 -1
  103. package/lib/commonjs/wallet-instance/index.js +14 -0
  104. package/lib/commonjs/wallet-instance/index.js.map +1 -1
  105. package/lib/commonjs/wallet-instance-attestation/README.md +8 -3
  106. package/lib/commonjs/wallet-instance-attestation/issuing.js +15 -8
  107. package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
  108. package/lib/commonjs/wallet-instance-attestation/types.js +16 -20
  109. package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
  110. package/lib/module/client/generated/wallet-provider.js +40 -15
  111. package/lib/module/client/generated/wallet-provider.js.map +1 -1
  112. package/lib/module/credential/index.js +3 -1
  113. package/lib/module/credential/index.js.map +1 -1
  114. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js +20 -0
  115. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js.map +1 -0
  116. package/lib/module/credential/issuance/03-start-user-authorization.js +25 -16
  117. package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
  118. package/lib/module/credential/issuance/04-complete-user-authorization.js +30 -18
  119. package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
  120. package/lib/module/credential/issuance/05-authorize-access.js +17 -11
  121. package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
  122. package/lib/module/credential/issuance/06-obtain-credential.js +36 -28
  123. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  124. package/lib/module/credential/issuance/07-verify-and-parse-credential.js +27 -205
  125. package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  126. package/lib/module/credential/issuance/README.md +23 -20
  127. package/lib/module/credential/issuance/const.js +1 -1
  128. package/lib/module/credential/issuance/const.js.map +1 -1
  129. package/lib/module/credential/issuance/index.js +2 -2
  130. package/lib/module/credential/issuance/index.js.map +1 -1
  131. package/lib/module/credential/presentation/01-start-flow.js +14 -15
  132. package/lib/module/credential/presentation/01-start-flow.js.map +1 -1
  133. package/lib/module/credential/presentation/02-evaluate-rp-trust.js +5 -3
  134. package/lib/module/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
  135. package/lib/module/credential/presentation/03-get-request-object.js +34 -7
  136. package/lib/module/credential/presentation/03-get-request-object.js.map +1 -1
  137. package/lib/module/credential/presentation/04-retrieve-rp-jwks.js +2 -124
  138. package/lib/module/credential/presentation/04-retrieve-rp-jwks.js.map +1 -1
  139. package/lib/module/credential/presentation/05-verify-request-object.js +78 -23
  140. package/lib/module/credential/presentation/05-verify-request-object.js.map +1 -1
  141. package/lib/module/credential/presentation/06-fetch-presentation-definition.js +6 -30
  142. package/lib/module/credential/presentation/06-fetch-presentation-definition.js.map +1 -1
  143. package/lib/module/credential/presentation/07-evaluate-dcql-query.js +97 -118
  144. package/lib/module/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
  145. package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +83 -186
  146. package/lib/module/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
  147. package/lib/module/credential/presentation/08-send-authorization-response.js +107 -170
  148. package/lib/module/credential/presentation/08-send-authorization-response.js.map +1 -1
  149. package/lib/module/credential/presentation/README.md +74 -79
  150. package/lib/module/credential/presentation/errors.js +30 -17
  151. package/lib/module/credential/presentation/errors.js.map +1 -1
  152. package/lib/module/credential/presentation/index.js +6 -6
  153. package/lib/module/credential/presentation/index.js.map +1 -1
  154. package/lib/module/credential/presentation/types.js +49 -27
  155. package/lib/module/credential/presentation/types.js.map +1 -1
  156. package/lib/module/credential/status/01-start-flow.js +2 -0
  157. package/lib/module/credential/status/01-start-flow.js.map +1 -0
  158. package/lib/module/credential/status/02-status-attestation.js +66 -0
  159. package/lib/module/credential/status/02-status-attestation.js.map +1 -0
  160. package/lib/module/credential/status/03-verify-and-parse-status-attestation.js +49 -0
  161. package/lib/module/credential/status/03-verify-and-parse-status-attestation.js.map +1 -0
  162. package/lib/module/credential/status/README.md +67 -0
  163. package/lib/module/credential/status/index.js +5 -0
  164. package/lib/module/credential/status/index.js.map +1 -0
  165. package/lib/module/credential/status/types.js +40 -0
  166. package/lib/module/credential/status/types.js.map +1 -0
  167. package/lib/module/credential/trustmark/README.md +62 -0
  168. package/lib/module/credential/trustmark/get-credential-trustmark.js +77 -0
  169. package/lib/module/credential/trustmark/get-credential-trustmark.js.map +1 -0
  170. package/lib/module/credential/trustmark/index.js +3 -0
  171. package/lib/module/credential/trustmark/index.js.map +1 -0
  172. package/lib/module/index.js +3 -1
  173. package/lib/module/index.js.map +1 -1
  174. package/lib/module/pid/sd-jwt/types.js +16 -1
  175. package/lib/module/pid/sd-jwt/types.js.map +1 -1
  176. package/lib/module/sd-jwt/__test__/index.test.js +22 -34
  177. package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
  178. package/lib/module/sd-jwt/__test__/types.test.js +11 -23
  179. package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
  180. package/lib/module/sd-jwt/index.js +1 -7
  181. package/lib/module/sd-jwt/index.js.map +1 -1
  182. package/lib/module/sd-jwt/types.js +4 -19
  183. package/lib/module/sd-jwt/types.js.map +1 -1
  184. package/lib/module/trust/README.md +147 -0
  185. package/lib/module/trust/chain.js +145 -0
  186. package/lib/module/trust/chain.js.map +1 -0
  187. package/lib/module/trust/errors.js +115 -0
  188. package/lib/module/trust/errors.js.map +1 -0
  189. package/lib/module/trust/index.js +269 -0
  190. package/lib/module/trust/index.js.map +1 -0
  191. package/lib/module/{entity/trust → trust}/types.js +25 -46
  192. package/lib/module/trust/types.js.map +1 -0
  193. package/lib/module/trust/utils.js +60 -0
  194. package/lib/module/trust/utils.js.map +1 -0
  195. package/lib/module/utils/crypto.js +4 -107
  196. package/lib/module/utils/crypto.js.map +1 -1
  197. package/lib/module/utils/decoder.js +3 -0
  198. package/lib/module/utils/decoder.js.map +1 -1
  199. package/lib/module/utils/error-codes.js +20 -1
  200. package/lib/module/utils/error-codes.js.map +1 -1
  201. package/lib/module/utils/errors.js +61 -4
  202. package/lib/module/utils/errors.js.map +1 -1
  203. package/lib/module/utils/logging.js +62 -0
  204. package/lib/module/utils/logging.js.map +1 -0
  205. package/lib/module/utils/misc.js +2 -0
  206. package/lib/module/utils/misc.js.map +1 -1
  207. package/lib/module/utils/par.js +17 -9
  208. package/lib/module/utils/par.js.map +1 -1
  209. package/lib/module/utils/string.js +0 -10
  210. package/lib/module/utils/string.js.map +1 -1
  211. package/lib/module/wallet-instance/index.js +13 -0
  212. package/lib/module/wallet-instance/index.js.map +1 -1
  213. package/lib/module/wallet-instance-attestation/README.md +8 -3
  214. package/lib/module/wallet-instance-attestation/index.js +2 -2
  215. package/lib/module/wallet-instance-attestation/index.js.map +1 -1
  216. package/lib/module/wallet-instance-attestation/issuing.js +16 -9
  217. package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
  218. package/lib/module/wallet-instance-attestation/types.js +14 -18
  219. package/lib/module/wallet-instance-attestation/types.js.map +1 -1
  220. package/lib/typescript/client/generated/wallet-provider.d.ts +206 -51
  221. package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -1
  222. package/lib/typescript/credential/index.d.ts +3 -1
  223. package/lib/typescript/credential/index.d.ts.map +1 -1
  224. package/lib/typescript/credential/issuance/01-start-flow.d.ts +1 -1
  225. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts +19 -0
  226. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts.map +1 -0
  227. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +3 -3
  228. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -1
  229. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +9 -9
  230. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
  231. package/lib/typescript/credential/issuance/05-authorize-access.d.ts +3 -3
  232. package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
  233. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +4 -4
  234. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  235. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts +3 -15
  236. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
  237. package/lib/typescript/credential/issuance/const.d.ts +1 -1
  238. package/lib/typescript/credential/issuance/const.d.ts.map +1 -1
  239. package/lib/typescript/credential/issuance/index.d.ts +3 -3
  240. package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
  241. package/lib/typescript/credential/issuance/types.d.ts +8 -3
  242. package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
  243. package/lib/typescript/credential/presentation/01-start-flow.d.ts +28 -9
  244. package/lib/typescript/credential/presentation/01-start-flow.d.ts.map +1 -1
  245. package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts +2 -1
  246. package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts.map +1 -1
  247. package/lib/typescript/credential/presentation/03-get-request-object.d.ts +7 -5
  248. package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +1 -1
  249. package/lib/typescript/credential/presentation/04-retrieve-rp-jwks.d.ts +4 -30
  250. package/lib/typescript/credential/presentation/04-retrieve-rp-jwks.d.ts.map +1 -1
  251. package/lib/typescript/credential/presentation/05-verify-request-object.d.ts +17 -4
  252. package/lib/typescript/credential/presentation/05-verify-request-object.d.ts.map +1 -1
  253. package/lib/typescript/credential/presentation/06-fetch-presentation-definition.d.ts +4 -9
  254. package/lib/typescript/credential/presentation/06-fetch-presentation-definition.d.ts.map +1 -1
  255. package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts +13 -12
  256. package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts.map +1 -1
  257. package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts +40 -42
  258. package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts.map +1 -1
  259. package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts +30 -43
  260. package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts.map +1 -1
  261. package/lib/typescript/credential/presentation/errors.d.ts +25 -10
  262. package/lib/typescript/credential/presentation/errors.d.ts.map +1 -1
  263. package/lib/typescript/credential/presentation/index.d.ts +7 -8
  264. package/lib/typescript/credential/presentation/index.d.ts.map +1 -1
  265. package/lib/typescript/credential/presentation/types.d.ts +137 -307
  266. package/lib/typescript/credential/presentation/types.d.ts.map +1 -1
  267. package/lib/typescript/credential/status/01-start-flow.d.ts +10 -0
  268. package/lib/typescript/credential/status/01-start-flow.d.ts.map +1 -0
  269. package/lib/typescript/credential/status/02-status-attestation.d.ts +19 -0
  270. package/lib/typescript/credential/status/02-status-attestation.d.ts.map +1 -0
  271. package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts +24 -0
  272. package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts.map +1 -0
  273. package/lib/typescript/credential/status/index.d.ts +7 -0
  274. package/lib/typescript/credential/status/index.d.ts.map +1 -0
  275. package/lib/typescript/credential/status/types.d.ts +305 -0
  276. package/lib/typescript/credential/status/types.d.ts.map +1 -0
  277. package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts +52 -0
  278. package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts.map +1 -0
  279. package/lib/typescript/credential/trustmark/index.d.ts +4 -0
  280. package/lib/typescript/credential/trustmark/index.d.ts.map +1 -0
  281. package/lib/typescript/index.d.ts +3 -1
  282. package/lib/typescript/index.d.ts.map +1 -1
  283. package/lib/typescript/pid/sd-jwt/types.d.ts +103 -25
  284. package/lib/typescript/pid/sd-jwt/types.d.ts.map +1 -1
  285. package/lib/typescript/sd-jwt/index.d.ts +20 -72
  286. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  287. package/lib/typescript/sd-jwt/types.d.ts +24 -129
  288. package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
  289. package/lib/typescript/trust/chain.d.ts +23 -0
  290. package/lib/typescript/trust/chain.d.ts.map +1 -0
  291. package/lib/typescript/trust/errors.d.ts +102 -0
  292. package/lib/typescript/trust/errors.d.ts.map +1 -0
  293. package/lib/typescript/{entity/trust → trust}/index.d.ts +308 -281
  294. package/lib/typescript/trust/index.d.ts.map +1 -0
  295. package/lib/typescript/{entity/trust → trust}/types.d.ts +1714 -1301
  296. package/lib/typescript/{entity/trust → trust}/types.d.ts.map +1 -1
  297. package/lib/typescript/trust/utils.d.ts +22 -0
  298. package/lib/typescript/trust/utils.d.ts.map +1 -0
  299. package/lib/typescript/utils/crypto.d.ts +0 -32
  300. package/lib/typescript/utils/crypto.d.ts.map +1 -1
  301. package/lib/typescript/utils/decoder.d.ts.map +1 -1
  302. package/lib/typescript/utils/error-codes.d.ts +20 -0
  303. package/lib/typescript/utils/error-codes.d.ts.map +1 -1
  304. package/lib/typescript/utils/errors.d.ts +55 -10
  305. package/lib/typescript/utils/errors.d.ts.map +1 -1
  306. package/lib/typescript/utils/logging.d.ts +35 -0
  307. package/lib/typescript/utils/logging.d.ts.map +1 -0
  308. package/lib/typescript/utils/misc.d.ts.map +1 -1
  309. package/lib/typescript/utils/par.d.ts +8 -1
  310. package/lib/typescript/utils/par.d.ts.map +1 -1
  311. package/lib/typescript/utils/string.d.ts +0 -7
  312. package/lib/typescript/utils/string.d.ts.map +1 -1
  313. package/lib/typescript/wallet-instance/index.d.ts +8 -0
  314. package/lib/typescript/wallet-instance/index.d.ts.map +1 -1
  315. package/lib/typescript/wallet-instance-attestation/index.d.ts +1 -2
  316. package/lib/typescript/wallet-instance-attestation/index.d.ts.map +1 -1
  317. package/lib/typescript/wallet-instance-attestation/issuing.d.ts +4 -2
  318. package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
  319. package/lib/typescript/wallet-instance-attestation/types.d.ts +60 -102
  320. package/lib/typescript/wallet-instance-attestation/types.d.ts.map +1 -1
  321. package/package.json +9 -10
  322. package/src/client/generated/wallet-provider.ts +52 -17
  323. package/src/credential/index.ts +4 -1
  324. package/src/credential/issuance/01-start-flow.ts +1 -1
  325. package/src/credential/issuance/02-evaluate-issuer-trust.ts +32 -0
  326. package/src/credential/issuance/03-start-user-authorization.ts +48 -22
  327. package/src/credential/issuance/04-complete-user-authorization.ts +74 -18
  328. package/src/credential/issuance/05-authorize-access.ts +29 -11
  329. package/src/credential/issuance/06-obtain-credential.ts +61 -36
  330. package/src/credential/issuance/07-verify-and-parse-credential.ts +37 -264
  331. package/src/credential/issuance/README.md +23 -20
  332. package/src/credential/issuance/const.ts +1 -1
  333. package/src/credential/issuance/index.ts +6 -3
  334. package/src/credential/presentation/01-start-flow.ts +19 -22
  335. package/src/credential/presentation/02-evaluate-rp-trust.ts +5 -4
  336. package/src/credential/presentation/03-get-request-object.ts +36 -8
  337. package/src/credential/presentation/04-retrieve-rp-jwks.ts +6 -148
  338. package/src/credential/presentation/05-verify-request-object.ts +115 -30
  339. package/src/credential/presentation/06-fetch-presentation-definition.ts +5 -35
  340. package/src/credential/presentation/07-evaluate-dcql-query.ts +132 -161
  341. package/src/credential/presentation/07-evaluate-input-descriptor.ts +136 -254
  342. package/src/credential/presentation/08-send-authorization-response.ts +178 -260
  343. package/src/credential/presentation/README.md +74 -79
  344. package/src/credential/presentation/errors.ts +38 -15
  345. package/src/credential/presentation/index.ts +18 -19
  346. package/src/credential/presentation/types.ts +67 -64
  347. package/src/credential/status/01-start-flow.ts +9 -0
  348. package/src/credential/status/02-status-attestation.ts +105 -0
  349. package/src/credential/status/03-verify-and-parse-status-attestation.ts +70 -0
  350. package/src/credential/status/README.md +67 -0
  351. package/src/credential/status/index.ts +22 -0
  352. package/src/credential/status/types.ts +43 -0
  353. package/src/credential/trustmark/README.md +62 -0
  354. package/src/credential/trustmark/get-credential-trustmark.ts +139 -0
  355. package/src/credential/trustmark/index.ts +8 -0
  356. package/src/index.ts +4 -0
  357. package/src/pid/sd-jwt/types.ts +18 -1
  358. package/src/sd-jwt/__test__/index.test.ts +36 -55
  359. package/src/sd-jwt/__test__/types.test.ts +16 -29
  360. package/src/sd-jwt/index.ts +1 -5
  361. package/src/sd-jwt/types.ts +2 -19
  362. package/src/trust/README.md +147 -0
  363. package/src/trust/chain.ts +227 -0
  364. package/src/trust/errors.ts +136 -0
  365. package/src/{entity/trust → trust}/index.ts +207 -25
  366. package/src/{entity/trust → trust}/types.ts +24 -37
  367. package/src/trust/utils.ts +70 -0
  368. package/src/utils/crypto.ts +4 -106
  369. package/src/utils/decoder.ts +6 -1
  370. package/src/utils/error-codes.ts +23 -0
  371. package/src/utils/errors.ts +119 -15
  372. package/src/utils/logging.ts +68 -0
  373. package/src/utils/misc.ts +5 -0
  374. package/src/utils/par.ts +19 -6
  375. package/src/utils/string.ts +0 -10
  376. package/src/wallet-instance/index.ts +30 -1
  377. package/src/wallet-instance-attestation/README.md +8 -3
  378. package/src/wallet-instance-attestation/index.ts +2 -2
  379. package/src/wallet-instance-attestation/issuing.ts +33 -12
  380. package/src/wallet-instance-attestation/types.ts +18 -22
  381. package/lib/commonjs/credential/issuance/02-get-issuer-config.js +0 -48
  382. package/lib/commonjs/credential/issuance/02-get-issuer-config.js.map +0 -1
  383. package/lib/commonjs/entity/openid-connect/issuer/index.js +0 -25
  384. package/lib/commonjs/entity/openid-connect/issuer/index.js.map +0 -1
  385. package/lib/commonjs/entity/openid-connect/issuer/types.js +0 -64
  386. package/lib/commonjs/entity/openid-connect/issuer/types.js.map +0 -1
  387. package/lib/commonjs/entity/trust/chain.js +0 -122
  388. package/lib/commonjs/entity/trust/chain.js.map +0 -1
  389. package/lib/commonjs/entity/trust/index.js +0 -148
  390. package/lib/commonjs/entity/trust/index.js.map +0 -1
  391. package/lib/commonjs/entity/trust/types.js.map +0 -1
  392. package/lib/commonjs/mdoc/converters.js +0 -26
  393. package/lib/commonjs/mdoc/converters.js.map +0 -1
  394. package/lib/commonjs/mdoc/index.js +0 -68
  395. package/lib/commonjs/mdoc/index.js.map +0 -1
  396. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js +0 -469
  397. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js.map +0 -1
  398. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-utils.js +0 -90
  399. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-utils.js.map +0 -1
  400. package/lib/module/credential/issuance/02-get-issuer-config.js +0 -42
  401. package/lib/module/credential/issuance/02-get-issuer-config.js.map +0 -1
  402. package/lib/module/entity/openid-connect/issuer/index.js +0 -20
  403. package/lib/module/entity/openid-connect/issuer/index.js.map +0 -1
  404. package/lib/module/entity/openid-connect/issuer/types.js +0 -48
  405. package/lib/module/entity/openid-connect/issuer/types.js.map +0 -1
  406. package/lib/module/entity/trust/chain.js +0 -113
  407. package/lib/module/entity/trust/chain.js.map +0 -1
  408. package/lib/module/entity/trust/index.js +0 -131
  409. package/lib/module/entity/trust/index.js.map +0 -1
  410. package/lib/module/entity/trust/types.js.map +0 -1
  411. package/lib/module/mdoc/converters.js +0 -20
  412. package/lib/module/mdoc/converters.js.map +0 -1
  413. package/lib/module/mdoc/index.js +0 -60
  414. package/lib/module/mdoc/index.js.map +0 -1
  415. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js +0 -462
  416. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js.map +0 -1
  417. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-utils.js +0 -83
  418. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-utils.js.map +0 -1
  419. package/lib/typescript/credential/issuance/02-get-issuer-config.d.ts +0 -32
  420. package/lib/typescript/credential/issuance/02-get-issuer-config.d.ts.map +0 -1
  421. package/lib/typescript/entity/openid-connect/issuer/index.d.ts +0 -12
  422. package/lib/typescript/entity/openid-connect/issuer/index.d.ts.map +0 -1
  423. package/lib/typescript/entity/openid-connect/issuer/types.d.ts +0 -777
  424. package/lib/typescript/entity/openid-connect/issuer/types.d.ts.map +0 -1
  425. package/lib/typescript/entity/trust/chain.d.ts +0 -26
  426. package/lib/typescript/entity/trust/chain.d.ts.map +0 -1
  427. package/lib/typescript/entity/trust/index.d.ts.map +0 -1
  428. package/lib/typescript/mdoc/converters.d.ts +0 -8
  429. package/lib/typescript/mdoc/converters.d.ts.map +0 -1
  430. package/lib/typescript/mdoc/index.d.ts +0 -10
  431. package/lib/typescript/mdoc/index.d.ts.map +0 -1
  432. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-inputs.d.ts +0 -3
  433. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-inputs.d.ts.map +0 -1
  434. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-utils.d.ts +0 -42
  435. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-utils.d.ts.map +0 -1
  436. package/src/credential/issuance/02-get-issuer-config.ts +0 -67
  437. package/src/entity/openid-connect/issuer/index.ts +0 -27
  438. package/src/entity/openid-connect/issuer/types.ts +0 -76
  439. package/src/entity/trust/chain.ts +0 -154
  440. package/src/mdoc/converters.ts +0 -26
  441. package/src/mdoc/index.ts +0 -95
  442. package/src/utils/credential/issuance/07-verify-and-parse-credentials-inputs.ts +0 -615
  443. package/src/utils/credential/issuance/07-verify-and-parse-credentials-utils.ts +0 -171
@@ -20,20 +20,19 @@ import { type Presentation } from "../credential/presentation/types";
20
20
  export declare const decode: <S extends z.ZodType<{
21
21
  header: {
22
22
  alg: string;
23
- typ: "vc+sd-jwt" | "mso_mdoc";
23
+ typ: "vc+sd-jwt";
24
24
  kid?: string | undefined;
25
- x5c?: string | undefined;
26
- vctm?: string[] | undefined;
27
25
  };
28
26
  payload: {
29
27
  iss: string;
30
28
  status: {
31
- status_assertion: {
29
+ status_attestation: {
32
30
  credential_hash_alg: "sha-256";
33
31
  };
34
32
  };
35
- vct: string;
33
+ sub: string;
36
34
  exp: number;
35
+ _sd_alg: "sha-256";
37
36
  cnf: {
38
37
  jwk: {
39
38
  kty: "RSA" | "EC";
@@ -60,40 +59,27 @@ export declare const decode: <S extends z.ZodType<{
60
59
  x5u?: string | undefined;
61
60
  };
62
61
  };
63
- sub: string;
64
- _sd_alg: "sha-256";
65
- expiry_date: string;
66
- issuing_authority: string;
67
- issuing_country: string;
62
+ vct: string;
68
63
  iat?: number | undefined;
69
- "vct#integrity"?: string | undefined;
70
- verification?: {
71
- trust_framework: "eidas";
72
- assurance_level: string;
73
- evidence: {
74
- method: string;
75
- };
76
- } | undefined;
77
64
  } & {
78
65
  _sd: string[];
79
66
  };
80
67
  }, z.ZodTypeDef, {
81
68
  header: {
82
69
  alg: string;
83
- typ: "vc+sd-jwt" | "mso_mdoc";
70
+ typ: "vc+sd-jwt";
84
71
  kid?: string | undefined;
85
- x5c?: string | undefined;
86
- vctm?: string[] | undefined;
87
72
  };
88
73
  payload: {
89
74
  iss: string;
90
75
  status: {
91
- status_assertion: {
76
+ status_attestation: {
92
77
  credential_hash_alg: "sha-256";
93
78
  };
94
79
  };
95
- vct: string;
80
+ sub: string;
96
81
  exp: number;
82
+ _sd_alg: "sha-256";
97
83
  cnf: {
98
84
  jwk: {
99
85
  kty: "RSA" | "EC";
@@ -120,20 +106,8 @@ export declare const decode: <S extends z.ZodType<{
120
106
  x5u?: string | undefined;
121
107
  };
122
108
  };
123
- sub: string;
124
- _sd_alg: "sha-256";
125
- expiry_date: string;
126
- issuing_authority: string;
127
- issuing_country: string;
109
+ vct: string;
128
110
  iat?: number | undefined;
129
- "vct#integrity"?: string | undefined;
130
- verification?: {
131
- trust_framework: "eidas";
132
- assurance_level: string;
133
- evidence: {
134
- method: string;
135
- };
136
- } | undefined;
137
111
  } & {
138
112
  _sd: string[];
139
113
  };
@@ -180,20 +154,19 @@ export declare const disclose: (token: string, claims: string[]) => Promise<{
180
154
  export declare const verify: <S extends z.ZodType<{
181
155
  header: {
182
156
  alg: string;
183
- typ: "vc+sd-jwt" | "mso_mdoc";
157
+ typ: "vc+sd-jwt";
184
158
  kid?: string | undefined;
185
- x5c?: string | undefined;
186
- vctm?: string[] | undefined;
187
159
  };
188
160
  payload: {
189
161
  iss: string;
190
162
  status: {
191
- status_assertion: {
163
+ status_attestation: {
192
164
  credential_hash_alg: "sha-256";
193
165
  };
194
166
  };
195
- vct: string;
167
+ sub: string;
196
168
  exp: number;
169
+ _sd_alg: "sha-256";
197
170
  cnf: {
198
171
  jwk: {
199
172
  kty: "RSA" | "EC";
@@ -220,40 +193,27 @@ export declare const verify: <S extends z.ZodType<{
220
193
  x5u?: string | undefined;
221
194
  };
222
195
  };
223
- sub: string;
224
- _sd_alg: "sha-256";
225
- expiry_date: string;
226
- issuing_authority: string;
227
- issuing_country: string;
196
+ vct: string;
228
197
  iat?: number | undefined;
229
- "vct#integrity"?: string | undefined;
230
- verification?: {
231
- trust_framework: "eidas";
232
- assurance_level: string;
233
- evidence: {
234
- method: string;
235
- };
236
- } | undefined;
237
198
  } & {
238
199
  _sd: string[];
239
200
  };
240
201
  }, z.ZodTypeDef, {
241
202
  header: {
242
203
  alg: string;
243
- typ: "vc+sd-jwt" | "mso_mdoc";
204
+ typ: "vc+sd-jwt";
244
205
  kid?: string | undefined;
245
- x5c?: string | undefined;
246
- vctm?: string[] | undefined;
247
206
  };
248
207
  payload: {
249
208
  iss: string;
250
209
  status: {
251
- status_assertion: {
210
+ status_attestation: {
252
211
  credential_hash_alg: "sha-256";
253
212
  };
254
213
  };
255
- vct: string;
214
+ sub: string;
256
215
  exp: number;
216
+ _sd_alg: "sha-256";
257
217
  cnf: {
258
218
  jwk: {
259
219
  kty: "RSA" | "EC";
@@ -280,20 +240,8 @@ export declare const verify: <S extends z.ZodType<{
280
240
  x5u?: string | undefined;
281
241
  };
282
242
  };
283
- sub: string;
284
- _sd_alg: "sha-256";
285
- expiry_date: string;
286
- issuing_authority: string;
287
- issuing_country: string;
243
+ vct: string;
288
244
  iat?: number | undefined;
289
- "vct#integrity"?: string | undefined;
290
- verification?: {
291
- trust_framework: "eidas";
292
- assurance_level: string;
293
- evidence: {
294
- method: string;
295
- };
296
- } | undefined;
297
245
  } & {
298
246
  _sd: string[];
299
247
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sd-jwt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAE3E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAQrE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WACV,MAAM;;iBAIA,qBAAqB,EAAE;CA0BrC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,UACZ,MAAM,UACL,MAAM,EAAE;WACE,MAAM;WAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE;EAwCnE,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;WACV,MAAM,aACF,GAAG,GAAG,GAAG,EAAE;;iBAEqB,UAAU,EAAE;EAqBxD,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,UAClB,MAAM,aACF,MAAM;cAGP,MAAM;EAyBjB,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC"}
@@ -29,50 +29,20 @@ export type DisclosureWithEncoded = {
29
29
  decoded: Disclosure;
30
30
  encoded: string;
31
31
  };
32
- export type Verification = z.infer<typeof Verification>;
33
- export declare const Verification: z.ZodObject<{
34
- trust_framework: z.ZodLiteral<"eidas">;
35
- assurance_level: z.ZodString;
36
- evidence: z.ZodObject<{
37
- method: z.ZodString;
38
- }, "strip", z.ZodTypeAny, {
39
- method: string;
40
- }, {
41
- method: string;
42
- }>;
43
- }, "strip", z.ZodTypeAny, {
44
- trust_framework: "eidas";
45
- assurance_level: string;
46
- evidence: {
47
- method: string;
48
- };
49
- }, {
50
- trust_framework: "eidas";
51
- assurance_level: string;
52
- evidence: {
53
- method: string;
54
- };
55
- }>;
56
32
  export type SdJwt4VC = z.infer<typeof SdJwt4VC>;
57
33
  export declare const SdJwt4VC: z.ZodObject<{
58
34
  header: z.ZodObject<{
59
- typ: z.ZodUnion<[z.ZodLiteral<"vc+sd-jwt">, z.ZodLiteral<"mso_mdoc">]>;
35
+ typ: z.ZodLiteral<"vc+sd-jwt">;
60
36
  alg: z.ZodString;
61
37
  kid: z.ZodOptional<z.ZodString>;
62
- x5c: z.ZodOptional<z.ZodString>;
63
- vctm: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
64
38
  }, "strip", z.ZodTypeAny, {
65
39
  alg: string;
66
- typ: "vc+sd-jwt" | "mso_mdoc";
40
+ typ: "vc+sd-jwt";
67
41
  kid?: string | undefined;
68
- x5c?: string | undefined;
69
- vctm?: string[] | undefined;
70
42
  }, {
71
43
  alg: string;
72
- typ: "vc+sd-jwt" | "mso_mdoc";
44
+ typ: "vc+sd-jwt";
73
45
  kid?: string | undefined;
74
- x5c?: string | undefined;
75
- vctm?: string[] | undefined;
76
46
  }>;
77
47
  payload: z.ZodIntersection<z.ZodObject<{
78
48
  iss: z.ZodString;
@@ -81,7 +51,7 @@ export declare const SdJwt4VC: z.ZodObject<{
81
51
  exp: z.ZodNumber;
82
52
  _sd_alg: z.ZodLiteral<"sha-256">;
83
53
  status: z.ZodObject<{
84
- status_assertion: z.ZodObject<{
54
+ status_attestation: z.ZodObject<{
85
55
  credential_hash_alg: z.ZodLiteral<"sha-256">;
86
56
  }, "strip", z.ZodTypeAny, {
87
57
  credential_hash_alg: "sha-256";
@@ -89,11 +59,11 @@ export declare const SdJwt4VC: z.ZodObject<{
89
59
  credential_hash_alg: "sha-256";
90
60
  }>;
91
61
  }, "strip", z.ZodTypeAny, {
92
- status_assertion: {
62
+ status_attestation: {
93
63
  credential_hash_alg: "sha-256";
94
64
  };
95
65
  }, {
96
- status_assertion: {
66
+ status_attestation: {
97
67
  credential_hash_alg: "sha-256";
98
68
  };
99
69
  }>;
@@ -220,42 +190,16 @@ export declare const SdJwt4VC: z.ZodObject<{
220
190
  };
221
191
  }>;
222
192
  vct: z.ZodString;
223
- "vct#integrity": z.ZodOptional<z.ZodString>;
224
- verification: z.ZodOptional<z.ZodObject<{
225
- trust_framework: z.ZodLiteral<"eidas">;
226
- assurance_level: z.ZodString;
227
- evidence: z.ZodObject<{
228
- method: z.ZodString;
229
- }, "strip", z.ZodTypeAny, {
230
- method: string;
231
- }, {
232
- method: string;
233
- }>;
234
- }, "strip", z.ZodTypeAny, {
235
- trust_framework: "eidas";
236
- assurance_level: string;
237
- evidence: {
238
- method: string;
239
- };
240
- }, {
241
- trust_framework: "eidas";
242
- assurance_level: string;
243
- evidence: {
244
- method: string;
245
- };
246
- }>>;
247
- expiry_date: z.ZodEffects<z.ZodString, string, string>;
248
- issuing_authority: z.ZodString;
249
- issuing_country: z.ZodString;
250
193
  }, "strip", z.ZodTypeAny, {
251
194
  iss: string;
252
195
  status: {
253
- status_assertion: {
196
+ status_attestation: {
254
197
  credential_hash_alg: "sha-256";
255
198
  };
256
199
  };
257
- vct: string;
200
+ sub: string;
258
201
  exp: number;
202
+ _sd_alg: "sha-256";
259
203
  cnf: {
260
204
  jwk: {
261
205
  kty: "RSA" | "EC";
@@ -282,29 +226,18 @@ export declare const SdJwt4VC: z.ZodObject<{
282
226
  x5u?: string | undefined;
283
227
  };
284
228
  };
285
- sub: string;
286
- _sd_alg: "sha-256";
287
- expiry_date: string;
288
- issuing_authority: string;
289
- issuing_country: string;
229
+ vct: string;
290
230
  iat?: number | undefined;
291
- "vct#integrity"?: string | undefined;
292
- verification?: {
293
- trust_framework: "eidas";
294
- assurance_level: string;
295
- evidence: {
296
- method: string;
297
- };
298
- } | undefined;
299
231
  }, {
300
232
  iss: string;
301
233
  status: {
302
- status_assertion: {
234
+ status_attestation: {
303
235
  credential_hash_alg: "sha-256";
304
236
  };
305
237
  };
306
- vct: string;
238
+ sub: string;
307
239
  exp: number;
240
+ _sd_alg: "sha-256";
308
241
  cnf: {
309
242
  jwk: {
310
243
  kty: "RSA" | "EC";
@@ -331,20 +264,8 @@ export declare const SdJwt4VC: z.ZodObject<{
331
264
  x5u?: string | undefined;
332
265
  };
333
266
  };
334
- sub: string;
335
- _sd_alg: "sha-256";
336
- expiry_date: string;
337
- issuing_authority: string;
338
- issuing_country: string;
267
+ vct: string;
339
268
  iat?: number | undefined;
340
- "vct#integrity"?: string | undefined;
341
- verification?: {
342
- trust_framework: "eidas";
343
- assurance_level: string;
344
- evidence: {
345
- method: string;
346
- };
347
- } | undefined;
348
269
  }>, z.ZodObject<{
349
270
  _sd: z.ZodArray<z.ZodString, "many">;
350
271
  }, "strip", z.ZodTypeAny, {
@@ -355,20 +276,19 @@ export declare const SdJwt4VC: z.ZodObject<{
355
276
  }, "strip", z.ZodTypeAny, {
356
277
  header: {
357
278
  alg: string;
358
- typ: "vc+sd-jwt" | "mso_mdoc";
279
+ typ: "vc+sd-jwt";
359
280
  kid?: string | undefined;
360
- x5c?: string | undefined;
361
- vctm?: string[] | undefined;
362
281
  };
363
282
  payload: {
364
283
  iss: string;
365
284
  status: {
366
- status_assertion: {
285
+ status_attestation: {
367
286
  credential_hash_alg: "sha-256";
368
287
  };
369
288
  };
370
- vct: string;
289
+ sub: string;
371
290
  exp: number;
291
+ _sd_alg: "sha-256";
372
292
  cnf: {
373
293
  jwk: {
374
294
  kty: "RSA" | "EC";
@@ -395,40 +315,27 @@ export declare const SdJwt4VC: z.ZodObject<{
395
315
  x5u?: string | undefined;
396
316
  };
397
317
  };
398
- sub: string;
399
- _sd_alg: "sha-256";
400
- expiry_date: string;
401
- issuing_authority: string;
402
- issuing_country: string;
318
+ vct: string;
403
319
  iat?: number | undefined;
404
- "vct#integrity"?: string | undefined;
405
- verification?: {
406
- trust_framework: "eidas";
407
- assurance_level: string;
408
- evidence: {
409
- method: string;
410
- };
411
- } | undefined;
412
320
  } & {
413
321
  _sd: string[];
414
322
  };
415
323
  }, {
416
324
  header: {
417
325
  alg: string;
418
- typ: "vc+sd-jwt" | "mso_mdoc";
326
+ typ: "vc+sd-jwt";
419
327
  kid?: string | undefined;
420
- x5c?: string | undefined;
421
- vctm?: string[] | undefined;
422
328
  };
423
329
  payload: {
424
330
  iss: string;
425
331
  status: {
426
- status_assertion: {
332
+ status_attestation: {
427
333
  credential_hash_alg: "sha-256";
428
334
  };
429
335
  };
430
- vct: string;
336
+ sub: string;
431
337
  exp: number;
338
+ _sd_alg: "sha-256";
432
339
  cnf: {
433
340
  jwk: {
434
341
  kty: "RSA" | "EC";
@@ -455,20 +362,8 @@ export declare const SdJwt4VC: z.ZodObject<{
455
362
  x5u?: string | undefined;
456
363
  };
457
364
  };
458
- sub: string;
459
- _sd_alg: "sha-256";
460
- expiry_date: string;
461
- issuing_authority: string;
462
- issuing_country: string;
365
+ vct: string;
463
366
  iat?: number | undefined;
464
- "vct#integrity"?: string | undefined;
465
- verification?: {
466
- trust_framework: "eidas";
467
- assurance_level: string;
468
- evidence: {
469
- method: string;
470
- };
471
- } | undefined;
472
367
  } & {
473
368
  _sd: string[];
474
369
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sd-jwt/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,QAAQ,aAAuC,CAAC;AAC7D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC1E,eAAO,MAAM,qBAAqB;;;;;;EAAyC,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,eAAO,MAAM,UAAU,4DAIrB,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;EAMvB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBnB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { TrustAnchorEntityConfiguration } from "./types";
2
+ import { type ParsedToken } from "./utils";
3
+ import { type X509CertificateOptions } from "@pagopa/io-react-native-crypto";
4
+ /**
5
+ * Validates a provided trust chain against a known trust anchor, including X.509 certificate checks.
6
+ *
7
+ * @param trustAnchorEntity The entity configuration of the known trust anchor (for JWT validation).
8
+ * @param chain The chain of statements to be validated.
9
+ * @param x509Options Options for X.509 certificate validation.
10
+ * @returns The list of parsed tokens representing the chain.
11
+ * @throws {FederationError} If the chain is not valid (JWT or X.509). Specific errors like TrustChainEmptyError, X509ValidationError may be thrown.
12
+ */
13
+ export declare function validateTrustChain(trustAnchorEntity: TrustAnchorEntityConfiguration, chain: string[], x509Options: X509CertificateOptions): Promise<ParsedToken[]>;
14
+ /**
15
+ * Given a trust chain, obtain a new trust chain by fetching each element's fresh version
16
+ *
17
+ * @param chain The original chain
18
+ * @param appFetch (optional) fetch api implementation
19
+ * @returns A list of signed token that represent the trust chain, in the same order of the provided chain
20
+ * @throws {FederationError} If the chain is not valid
21
+ */
22
+ export declare function renewTrustChain(chain: string[], appFetch?: GlobalFetch["fetch"]): Promise<string[]>;
23
+ //# sourceMappingURL=chain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../src/trust/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,8BAA8B,EAC/B,MAAM,SAAS,CAAC;AAIjB,OAAO,EAGL,KAAK,WAAW,EAEjB,MAAM,SAAS,CAAC;AAUjB,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,gCAAgC,CAAC;AAaxC;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,iBAAiB,EAAE,8BAA8B,EACjD,KAAK,EAAE,MAAM,EAAE,EACf,WAAW,EAAE,sBAAsB,GAClC,OAAO,CAAC,WAAW,EAAE,CAAC,CAkHxB;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,GAAE,WAAW,CAAC,OAAO,CAAS,GACrC,OAAO,CAAC,MAAM,EAAE,CAAC,CA8CnB"}
@@ -0,0 +1,102 @@
1
+ import { IoWalletError } from "../utils/errors";
2
+ import type { CertificateValidationStatus } from "@pagopa/io-react-native-crypto";
3
+ /**
4
+ * Base class for all federation-specific errors.
5
+ */
6
+ export declare class FederationError extends IoWalletError {
7
+ constructor(message: string, details?: Record<string, unknown>);
8
+ }
9
+ /**
10
+ * Error thrown when a trust chain is unexpectedly empty.
11
+ */
12
+ export declare class TrustChainEmptyError extends FederationError {
13
+ code: string;
14
+ constructor(message?: string);
15
+ }
16
+ /**
17
+ * Error thrown when a token is unexpectedly missing from a trust chain during processing.
18
+ */
19
+ export declare class TrustChainTokenMissingError extends FederationError {
20
+ code: string;
21
+ constructor(message: string, details?: {
22
+ index?: number;
23
+ });
24
+ }
25
+ /**
26
+ * Error thrown when renewing a trust chain fails.
27
+ * This class itself might be used or could be considered a more general renewal error.
28
+ */
29
+ export declare class TrustChainRenewalError extends FederationError {
30
+ code: string;
31
+ constructor(message: string, details?: {
32
+ originalChain?: string[];
33
+ [key: string]: unknown;
34
+ });
35
+ }
36
+ export declare class FederationListParseError extends FederationError {
37
+ code: string;
38
+ constructor(message: string, details: {
39
+ url: string;
40
+ parseError?: string;
41
+ });
42
+ }
43
+ /**
44
+ * General error thrown during the trust chain building process.
45
+ */
46
+ export declare class BuildTrustChainError extends FederationError {
47
+ code: string;
48
+ constructor(message: string, details?: {
49
+ relyingPartyUrl?: string;
50
+ trustAnchorKid?: string;
51
+ [key: string]: unknown;
52
+ });
53
+ }
54
+ /**
55
+ * Error thrown when the Trust Anchor's key is missing a 'kid'.
56
+ */
57
+ export declare class TrustAnchorKidMissingError extends FederationError {
58
+ code: string;
59
+ constructor(message?: string);
60
+ }
61
+ /**
62
+ * Error thrown if the Relying Party is not found in the Trust Anchor's federation list.
63
+ */
64
+ export declare class RelyingPartyNotAuthorizedError extends FederationError {
65
+ code: string;
66
+ constructor(message: string, details: {
67
+ relyingPartyUrl: string;
68
+ federationListEndpoint?: string;
69
+ });
70
+ }
71
+ /**
72
+ * Error thrown when a 'federation_fetch_endpoint' is missing in an entity's configuration.
73
+ */
74
+ export declare class MissingFederationFetchEndpointError extends FederationError {
75
+ code: string;
76
+ constructor(message: string, details: {
77
+ entityBaseUrl: string;
78
+ missingInEntityUrl: string;
79
+ });
80
+ }
81
+ /**
82
+ * Error thrown when the X.509 certificate chain is missing in an entity's configuration.
83
+ */
84
+ export declare class MissingX509CertsError extends FederationError {
85
+ code: string;
86
+ constructor(message: string);
87
+ }
88
+ /**
89
+ * Error thrown when an X.509 certificate validation fails.
90
+ * This is used to indicate issues with the certificate chain or signature verification.
91
+ */
92
+ export declare class X509ValidationError extends FederationError {
93
+ code: string;
94
+ constructor(message: string, details?: {
95
+ tokenIndex?: number;
96
+ kid?: string;
97
+ x509ValidationStatus?: CertificateValidationStatus;
98
+ x509ErrorMessage?: string;
99
+ [key: string]: unknown;
100
+ });
101
+ }
102
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/trust/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAElF;;GAEG;AACH,qBAAa,eAAgB,SAAQ,aAAa;gBACpC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EA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