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

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 (174) hide show
  1. package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js +2 -2
  2. package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js.map +1 -1
  3. package/lib/commonjs/credential/issuance/03-start-user-authorization.js +38 -24
  4. package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
  5. package/lib/commonjs/credential/issuance/05-authorize-access.js +6 -10
  6. package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
  7. package/lib/commonjs/credential/issuance/06-obtain-credential.js +43 -11
  8. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  9. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +51 -48
  10. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  11. package/lib/commonjs/credential/issuance/README.md +34 -13
  12. package/lib/commonjs/credential/issuance/const.js +1 -1
  13. package/lib/commonjs/credential/issuance/types.js +16 -10
  14. package/lib/commonjs/credential/issuance/types.js.map +1 -1
  15. package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js +2 -2
  16. package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
  17. package/lib/commonjs/credential/presentation/05-verify-request-object.js.map +1 -1
  18. package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +4 -4
  19. package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js +3 -3
  20. package/lib/commonjs/credential/presentation/08-send-authorization-response.js.map +1 -1
  21. package/lib/commonjs/credential/status/README.md +0 -1
  22. package/lib/commonjs/sd-jwt/__test__/index.test.js +11 -15
  23. package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -1
  24. package/lib/commonjs/sd-jwt/__test__/types.test.js +5 -2
  25. package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -1
  26. package/lib/commonjs/sd-jwt/__test__/utils.test.js +37 -0
  27. package/lib/commonjs/sd-jwt/__test__/utils.test.js.map +1 -0
  28. package/lib/commonjs/sd-jwt/index.js +20 -0
  29. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  30. package/lib/commonjs/sd-jwt/types.js +51 -4
  31. package/lib/commonjs/sd-jwt/types.js.map +1 -1
  32. package/lib/commonjs/sd-jwt/utils.js +64 -0
  33. package/lib/commonjs/sd-jwt/utils.js.map +1 -0
  34. package/lib/commonjs/trust/build-chain.js +252 -0
  35. package/lib/commonjs/trust/build-chain.js.map +1 -0
  36. package/lib/commonjs/trust/index.js +11 -282
  37. package/lib/commonjs/trust/index.js.map +1 -1
  38. package/lib/commonjs/trust/types.js +18 -13
  39. package/lib/commonjs/trust/types.js.map +1 -1
  40. package/lib/commonjs/trust/{chain.js → verify-chain.js} +40 -5
  41. package/lib/commonjs/trust/verify-chain.js.map +1 -0
  42. package/lib/commonjs/utils/errors.js.map +1 -1
  43. package/lib/commonjs/utils/par.js +32 -22
  44. package/lib/commonjs/utils/par.js.map +1 -1
  45. package/lib/commonjs/utils/pop.js +1 -1
  46. package/lib/commonjs/utils/pop.js.map +1 -1
  47. package/lib/commonjs/wallet-instance-attestation/types.js +5 -1
  48. package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
  49. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js +1 -1
  50. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js.map +1 -1
  51. package/lib/module/credential/issuance/03-start-user-authorization.js +38 -24
  52. package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
  53. package/lib/module/credential/issuance/05-authorize-access.js +6 -10
  54. package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
  55. package/lib/module/credential/issuance/06-obtain-credential.js +44 -12
  56. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  57. package/lib/module/credential/issuance/07-verify-and-parse-credential.js +51 -48
  58. package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  59. package/lib/module/credential/issuance/README.md +34 -13
  60. package/lib/module/credential/issuance/const.js +1 -1
  61. package/lib/module/credential/issuance/types.js +12 -8
  62. package/lib/module/credential/issuance/types.js.map +1 -1
  63. package/lib/module/credential/presentation/02-evaluate-rp-trust.js +1 -1
  64. package/lib/module/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
  65. package/lib/module/credential/presentation/05-verify-request-object.js.map +1 -1
  66. package/lib/module/credential/presentation/07-evaluate-dcql-query.js +4 -4
  67. package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +3 -3
  68. package/lib/module/credential/presentation/08-send-authorization-response.js +1 -1
  69. package/lib/module/credential/presentation/08-send-authorization-response.js.map +1 -1
  70. package/lib/module/credential/status/README.md +0 -1
  71. package/lib/module/sd-jwt/__test__/index.test.js +11 -16
  72. package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
  73. package/lib/module/sd-jwt/__test__/types.test.js +5 -2
  74. package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
  75. package/lib/module/sd-jwt/__test__/utils.test.js +35 -0
  76. package/lib/module/sd-jwt/__test__/utils.test.js.map +1 -0
  77. package/lib/module/sd-jwt/index.js +1 -0
  78. package/lib/module/sd-jwt/index.js.map +1 -1
  79. package/lib/module/sd-jwt/types.js +50 -3
  80. package/lib/module/sd-jwt/types.js.map +1 -1
  81. package/lib/module/sd-jwt/utils.js +57 -0
  82. package/lib/module/sd-jwt/utils.js.map +1 -0
  83. package/lib/module/trust/build-chain.js +235 -0
  84. package/lib/module/trust/build-chain.js.map +1 -0
  85. package/lib/module/trust/index.js +5 -268
  86. package/lib/module/trust/index.js.map +1 -1
  87. package/lib/module/trust/types.js +18 -13
  88. package/lib/module/trust/types.js.map +1 -1
  89. package/lib/module/trust/{chain.js → verify-chain.js} +36 -2
  90. package/lib/module/trust/verify-chain.js.map +1 -0
  91. package/lib/module/utils/errors.js +1 -1
  92. package/lib/module/utils/errors.js.map +1 -1
  93. package/lib/module/utils/par.js +29 -20
  94. package/lib/module/utils/par.js.map +1 -1
  95. package/lib/module/utils/pop.js +1 -1
  96. package/lib/module/utils/pop.js.map +1 -1
  97. package/lib/module/wallet-instance-attestation/types.js +5 -1
  98. package/lib/module/wallet-instance-attestation/types.js.map +1 -1
  99. package/lib/typescript/client/generated/wallet-provider.d.ts +12 -12
  100. package/lib/typescript/credential/issuance/01-start-flow.d.ts +2 -2
  101. package/lib/typescript/credential/issuance/01-start-flow.d.ts.map +1 -1
  102. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts.map +1 -1
  103. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +7 -6
  104. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -1
  105. package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
  106. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +10 -5
  107. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  108. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts +3 -2
  109. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
  110. package/lib/typescript/credential/issuance/const.d.ts +1 -1
  111. package/lib/typescript/credential/issuance/types.d.ts +46 -26
  112. package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
  113. package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts.map +1 -1
  114. package/lib/typescript/credential/presentation/05-verify-request-object.d.ts +1 -1
  115. package/lib/typescript/credential/presentation/05-verify-request-object.d.ts.map +1 -1
  116. package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts +2 -2
  117. package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts.map +1 -1
  118. package/lib/typescript/credential/presentation/types.d.ts +4 -4
  119. package/lib/typescript/pid/sd-jwt/types.d.ts +7 -7
  120. package/lib/typescript/sd-jwt/__test__/utils.test.d.ts +2 -0
  121. package/lib/typescript/sd-jwt/__test__/utils.test.d.ts.map +1 -0
  122. package/lib/typescript/sd-jwt/index.d.ts +21 -8
  123. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  124. package/lib/typescript/sd-jwt/types.d.ts +194 -12
  125. package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
  126. package/lib/typescript/sd-jwt/utils.d.ts +18 -0
  127. package/lib/typescript/sd-jwt/utils.d.ts.map +1 -0
  128. package/lib/typescript/trust/build-chain.d.ts +1300 -0
  129. package/lib/typescript/trust/build-chain.d.ts.map +1 -0
  130. package/lib/typescript/trust/index.d.ts +5 -1301
  131. package/lib/typescript/trust/index.d.ts.map +1 -1
  132. package/lib/typescript/trust/types.d.ts +788 -624
  133. package/lib/typescript/trust/types.d.ts.map +1 -1
  134. package/lib/typescript/trust/{chain.d.ts → verify-chain.d.ts} +17 -1
  135. package/lib/typescript/trust/verify-chain.d.ts.map +1 -0
  136. package/lib/typescript/utils/errors.d.ts +2 -2
  137. package/lib/typescript/utils/errors.d.ts.map +1 -1
  138. package/lib/typescript/utils/par.d.ts +29 -13
  139. package/lib/typescript/utils/par.d.ts.map +1 -1
  140. package/lib/typescript/wallet-instance-attestation/types.d.ts +9 -9
  141. package/lib/typescript/wallet-instance-attestation/types.d.ts.map +1 -1
  142. package/package.json +1 -1
  143. package/src/credential/issuance/01-start-flow.ts +2 -2
  144. package/src/credential/issuance/02-evaluate-issuer-trust.ts +1 -1
  145. package/src/credential/issuance/03-start-user-authorization.ts +57 -38
  146. package/src/credential/issuance/05-authorize-access.ts +5 -11
  147. package/src/credential/issuance/06-obtain-credential.ts +53 -23
  148. package/src/credential/issuance/07-verify-and-parse-credential.ts +54 -62
  149. package/src/credential/issuance/README.md +34 -13
  150. package/src/credential/issuance/const.ts +1 -1
  151. package/src/credential/issuance/types.ts +18 -8
  152. package/src/credential/presentation/02-evaluate-rp-trust.ts +1 -1
  153. package/src/credential/presentation/05-verify-request-object.ts +1 -1
  154. package/src/credential/presentation/07-evaluate-dcql-query.ts +4 -4
  155. package/src/credential/presentation/07-evaluate-input-descriptor.ts +3 -3
  156. package/src/credential/presentation/08-send-authorization-response.ts +4 -4
  157. package/src/credential/status/README.md +0 -1
  158. package/src/sd-jwt/__test__/index.test.ts +8 -29
  159. package/src/sd-jwt/__test__/types.test.ts +6 -2
  160. package/src/sd-jwt/__test__/utils.test.ts +37 -0
  161. package/src/sd-jwt/index.ts +2 -0
  162. package/src/sd-jwt/types.ts +49 -2
  163. package/src/sd-jwt/utils.ts +73 -0
  164. package/src/trust/build-chain.ts +395 -0
  165. package/src/trust/index.ts +5 -442
  166. package/src/trust/types.ts +23 -17
  167. package/src/trust/{chain.ts → verify-chain.ts} +41 -1
  168. package/src/utils/errors.ts +4 -4
  169. package/src/utils/par.ts +37 -21
  170. package/src/utils/pop.ts +1 -1
  171. package/src/wallet-instance-attestation/types.ts +3 -1
  172. package/lib/commonjs/trust/chain.js.map +0 -1
  173. package/lib/module/trust/chain.js.map +0 -1
  174. package/lib/typescript/trust/chain.d.ts.map +0 -1
@@ -3,6 +3,7 @@ import { Disclosure, SdJwt4VC, type DisclosureWithEncoded } from "./types";
3
3
  import type { JWK } from "../utils/jwk";
4
4
  import * as Errors from "./errors";
5
5
  import { type Presentation } from "../credential/presentation/types";
6
+ export * from "./utils";
6
7
  /**
7
8
  * Decode a given SD-JWT with Disclosures to get the parsed SD-JWT object they define.
8
9
  * It ensures provided data is in a valid shape.
@@ -20,13 +21,13 @@ import { type Presentation } from "../credential/presentation/types";
20
21
  export declare const decode: <S extends z.ZodType<{
21
22
  header: {
22
23
  alg: string;
23
- typ: "vc+sd-jwt";
24
+ typ: "dc+sd-jwt";
24
25
  kid?: string | undefined;
25
26
  };
26
27
  payload: {
27
28
  iss: string;
28
29
  status: {
29
- status_attestation: {
30
+ status_assertion: {
30
31
  credential_hash_alg: "sha-256";
31
32
  };
32
33
  };
@@ -60,6 +61,9 @@ export declare const decode: <S extends z.ZodType<{
60
61
  };
61
62
  };
62
63
  vct: string;
64
+ "vct#integrity": string;
65
+ issuing_authority: string;
66
+ issuing_country: string;
63
67
  iat?: number | undefined;
64
68
  } & {
65
69
  _sd: string[];
@@ -67,13 +71,13 @@ export declare const decode: <S extends z.ZodType<{
67
71
  }, z.ZodTypeDef, {
68
72
  header: {
69
73
  alg: string;
70
- typ: "vc+sd-jwt";
74
+ typ: "dc+sd-jwt";
71
75
  kid?: string | undefined;
72
76
  };
73
77
  payload: {
74
78
  iss: string;
75
79
  status: {
76
- status_attestation: {
80
+ status_assertion: {
77
81
  credential_hash_alg: "sha-256";
78
82
  };
79
83
  };
@@ -107,6 +111,9 @@ export declare const decode: <S extends z.ZodType<{
107
111
  };
108
112
  };
109
113
  vct: string;
114
+ "vct#integrity": string;
115
+ issuing_authority: string;
116
+ issuing_country: string;
110
117
  iat?: number | undefined;
111
118
  } & {
112
119
  _sd: string[];
@@ -154,13 +161,13 @@ export declare const disclose: (token: string, claims: string[]) => Promise<{
154
161
  export declare const verify: <S extends z.ZodType<{
155
162
  header: {
156
163
  alg: string;
157
- typ: "vc+sd-jwt";
164
+ typ: "dc+sd-jwt";
158
165
  kid?: string | undefined;
159
166
  };
160
167
  payload: {
161
168
  iss: string;
162
169
  status: {
163
- status_attestation: {
170
+ status_assertion: {
164
171
  credential_hash_alg: "sha-256";
165
172
  };
166
173
  };
@@ -194,6 +201,9 @@ export declare const verify: <S extends z.ZodType<{
194
201
  };
195
202
  };
196
203
  vct: string;
204
+ "vct#integrity": string;
205
+ issuing_authority: string;
206
+ issuing_country: string;
197
207
  iat?: number | undefined;
198
208
  } & {
199
209
  _sd: string[];
@@ -201,13 +211,13 @@ export declare const verify: <S extends z.ZodType<{
201
211
  }, z.ZodTypeDef, {
202
212
  header: {
203
213
  alg: string;
204
- typ: "vc+sd-jwt";
214
+ typ: "dc+sd-jwt";
205
215
  kid?: string | undefined;
206
216
  };
207
217
  payload: {
208
218
  iss: string;
209
219
  status: {
210
- status_attestation: {
220
+ status_assertion: {
211
221
  credential_hash_alg: "sha-256";
212
222
  };
213
223
  };
@@ -241,6 +251,9 @@ export declare const verify: <S extends z.ZodType<{
241
251
  };
242
252
  };
243
253
  vct: string;
254
+ "vct#integrity": string;
255
+ issuing_authority: string;
256
+ issuing_country: string;
244
257
  iat?: number | undefined;
245
258
  } & {
246
259
  _sd: string[];
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WACV,MAAM,aACF,GAAG,GAAG,GAAG,EAAE;;iBAEqB,UAAU,EAAE;EAqBxD,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAA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;EAyBjB,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC"}
@@ -32,16 +32,16 @@ export type DisclosureWithEncoded = {
32
32
  export type SdJwt4VC = z.infer<typeof SdJwt4VC>;
33
33
  export declare const SdJwt4VC: z.ZodObject<{
34
34
  header: z.ZodObject<{
35
- typ: z.ZodLiteral<"vc+sd-jwt">;
35
+ typ: z.ZodLiteral<"dc+sd-jwt">;
36
36
  alg: z.ZodString;
37
37
  kid: z.ZodOptional<z.ZodString>;
38
38
  }, "strip", z.ZodTypeAny, {
39
39
  alg: string;
40
- typ: "vc+sd-jwt";
40
+ typ: "dc+sd-jwt";
41
41
  kid?: string | undefined;
42
42
  }, {
43
43
  alg: string;
44
- typ: "vc+sd-jwt";
44
+ typ: "dc+sd-jwt";
45
45
  kid?: string | undefined;
46
46
  }>;
47
47
  payload: z.ZodIntersection<z.ZodObject<{
@@ -51,7 +51,7 @@ export declare const SdJwt4VC: z.ZodObject<{
51
51
  exp: z.ZodNumber;
52
52
  _sd_alg: z.ZodLiteral<"sha-256">;
53
53
  status: z.ZodObject<{
54
- status_attestation: z.ZodObject<{
54
+ status_assertion: z.ZodObject<{
55
55
  credential_hash_alg: z.ZodLiteral<"sha-256">;
56
56
  }, "strip", z.ZodTypeAny, {
57
57
  credential_hash_alg: "sha-256";
@@ -59,11 +59,11 @@ export declare const SdJwt4VC: z.ZodObject<{
59
59
  credential_hash_alg: "sha-256";
60
60
  }>;
61
61
  }, "strip", z.ZodTypeAny, {
62
- status_attestation: {
62
+ status_assertion: {
63
63
  credential_hash_alg: "sha-256";
64
64
  };
65
65
  }, {
66
- status_attestation: {
66
+ status_assertion: {
67
67
  credential_hash_alg: "sha-256";
68
68
  };
69
69
  }>;
@@ -190,10 +190,13 @@ export declare const SdJwt4VC: z.ZodObject<{
190
190
  };
191
191
  }>;
192
192
  vct: z.ZodString;
193
+ "vct#integrity": z.ZodString;
194
+ issuing_authority: z.ZodString;
195
+ issuing_country: z.ZodString;
193
196
  }, "strip", z.ZodTypeAny, {
194
197
  iss: string;
195
198
  status: {
196
- status_attestation: {
199
+ status_assertion: {
197
200
  credential_hash_alg: "sha-256";
198
201
  };
199
202
  };
@@ -227,11 +230,14 @@ export declare const SdJwt4VC: z.ZodObject<{
227
230
  };
228
231
  };
229
232
  vct: string;
233
+ "vct#integrity": string;
234
+ issuing_authority: string;
235
+ issuing_country: string;
230
236
  iat?: number | undefined;
231
237
  }, {
232
238
  iss: string;
233
239
  status: {
234
- status_attestation: {
240
+ status_assertion: {
235
241
  credential_hash_alg: "sha-256";
236
242
  };
237
243
  };
@@ -265,6 +271,9 @@ export declare const SdJwt4VC: z.ZodObject<{
265
271
  };
266
272
  };
267
273
  vct: string;
274
+ "vct#integrity": string;
275
+ issuing_authority: string;
276
+ issuing_country: string;
268
277
  iat?: number | undefined;
269
278
  }>, z.ZodObject<{
270
279
  _sd: z.ZodArray<z.ZodString, "many">;
@@ -276,13 +285,13 @@ export declare const SdJwt4VC: z.ZodObject<{
276
285
  }, "strip", z.ZodTypeAny, {
277
286
  header: {
278
287
  alg: string;
279
- typ: "vc+sd-jwt";
288
+ typ: "dc+sd-jwt";
280
289
  kid?: string | undefined;
281
290
  };
282
291
  payload: {
283
292
  iss: string;
284
293
  status: {
285
- status_attestation: {
294
+ status_assertion: {
286
295
  credential_hash_alg: "sha-256";
287
296
  };
288
297
  };
@@ -316,6 +325,9 @@ export declare const SdJwt4VC: z.ZodObject<{
316
325
  };
317
326
  };
318
327
  vct: string;
328
+ "vct#integrity": string;
329
+ issuing_authority: string;
330
+ issuing_country: string;
319
331
  iat?: number | undefined;
320
332
  } & {
321
333
  _sd: string[];
@@ -323,13 +335,13 @@ export declare const SdJwt4VC: z.ZodObject<{
323
335
  }, {
324
336
  header: {
325
337
  alg: string;
326
- typ: "vc+sd-jwt";
338
+ typ: "dc+sd-jwt";
327
339
  kid?: string | undefined;
328
340
  };
329
341
  payload: {
330
342
  iss: string;
331
343
  status: {
332
- status_attestation: {
344
+ status_assertion: {
333
345
  credential_hash_alg: "sha-256";
334
346
  };
335
347
  };
@@ -363,9 +375,179 @@ export declare const SdJwt4VC: z.ZodObject<{
363
375
  };
364
376
  };
365
377
  vct: string;
378
+ "vct#integrity": string;
379
+ issuing_authority: string;
380
+ issuing_country: string;
366
381
  iat?: number | undefined;
367
382
  } & {
368
383
  _sd: string[];
369
384
  };
370
385
  }>;
386
+ /**
387
+ * Object containing User authentication and User data verification information.
388
+ * Useful to extract the assurance level to determine L2/L3 authentication.
389
+ */
390
+ export type Verification = z.infer<typeof Verification>;
391
+ export declare const Verification: z.ZodObject<{
392
+ trust_framework: z.ZodString;
393
+ assurance_level: z.ZodString;
394
+ evidence: z.ZodArray<z.ZodObject<{
395
+ type: z.ZodLiteral<"vouch">;
396
+ time: z.ZodString;
397
+ attestation: z.ZodObject<{
398
+ type: z.ZodLiteral<"digital_attestation">;
399
+ reference_number: z.ZodString;
400
+ date_of_issuance: z.ZodString;
401
+ voucher: z.ZodObject<{
402
+ organization: z.ZodString;
403
+ }, "strip", z.ZodTypeAny, {
404
+ organization: string;
405
+ }, {
406
+ organization: string;
407
+ }>;
408
+ }, "strip", z.ZodTypeAny, {
409
+ type: "digital_attestation";
410
+ reference_number: string;
411
+ date_of_issuance: string;
412
+ voucher: {
413
+ organization: string;
414
+ };
415
+ }, {
416
+ type: "digital_attestation";
417
+ reference_number: string;
418
+ date_of_issuance: string;
419
+ voucher: {
420
+ organization: string;
421
+ };
422
+ }>;
423
+ }, "strip", z.ZodTypeAny, {
424
+ type: "vouch";
425
+ time: string;
426
+ attestation: {
427
+ type: "digital_attestation";
428
+ reference_number: string;
429
+ date_of_issuance: string;
430
+ voucher: {
431
+ organization: string;
432
+ };
433
+ };
434
+ }, {
435
+ type: "vouch";
436
+ time: string;
437
+ attestation: {
438
+ type: "digital_attestation";
439
+ reference_number: string;
440
+ date_of_issuance: string;
441
+ voucher: {
442
+ organization: string;
443
+ };
444
+ };
445
+ }>, "many">;
446
+ }, "strip", z.ZodTypeAny, {
447
+ trust_framework: string;
448
+ assurance_level: string;
449
+ evidence: {
450
+ type: "vouch";
451
+ time: string;
452
+ attestation: {
453
+ type: "digital_attestation";
454
+ reference_number: string;
455
+ date_of_issuance: string;
456
+ voucher: {
457
+ organization: string;
458
+ };
459
+ };
460
+ }[];
461
+ }, {
462
+ trust_framework: string;
463
+ assurance_level: string;
464
+ evidence: {
465
+ type: "vouch";
466
+ time: string;
467
+ attestation: {
468
+ type: "digital_attestation";
469
+ reference_number: string;
470
+ date_of_issuance: string;
471
+ voucher: {
472
+ organization: string;
473
+ };
474
+ };
475
+ }[];
476
+ }>;
477
+ /**
478
+ * Metadata for a digital credential. This information is retrieved from the URL defined in the `vct` claim.
479
+ *
480
+ * @see https://italia.github.io/eid-wallet-it-docs/v0.9.1/en/pid-eaa-data-model.html#digital-credential-metadata-type
481
+ */
482
+ export type TypeMetadata = z.infer<typeof TypeMetadata>;
483
+ export declare const TypeMetadata: z.ZodObject<{
484
+ name: z.ZodString;
485
+ description: z.ZodString;
486
+ data_source: z.ZodObject<{
487
+ trust_framework: z.ZodString;
488
+ authentic_source: z.ZodObject<{
489
+ organization_name: z.ZodString;
490
+ organization_code: z.ZodString;
491
+ contacts: z.ZodArray<z.ZodString, "many">;
492
+ homepage_uri: z.ZodString;
493
+ logo_uri: z.ZodString;
494
+ }, "strip", z.ZodTypeAny, {
495
+ organization_name: string;
496
+ organization_code: string;
497
+ contacts: string[];
498
+ homepage_uri: string;
499
+ logo_uri: string;
500
+ }, {
501
+ organization_name: string;
502
+ organization_code: string;
503
+ contacts: string[];
504
+ homepage_uri: string;
505
+ logo_uri: string;
506
+ }>;
507
+ }, "strip", z.ZodTypeAny, {
508
+ trust_framework: string;
509
+ authentic_source: {
510
+ organization_name: string;
511
+ organization_code: string;
512
+ contacts: string[];
513
+ homepage_uri: string;
514
+ logo_uri: string;
515
+ };
516
+ }, {
517
+ trust_framework: string;
518
+ authentic_source: {
519
+ organization_name: string;
520
+ organization_code: string;
521
+ contacts: string[];
522
+ homepage_uri: string;
523
+ logo_uri: string;
524
+ };
525
+ }>;
526
+ }, "strip", z.ZodTypeAny, {
527
+ name: string;
528
+ description: string;
529
+ data_source: {
530
+ trust_framework: string;
531
+ authentic_source: {
532
+ organization_name: string;
533
+ organization_code: string;
534
+ contacts: string[];
535
+ homepage_uri: string;
536
+ logo_uri: string;
537
+ };
538
+ };
539
+ }, {
540
+ name: string;
541
+ description: string;
542
+ data_source: {
543
+ trust_framework: string;
544
+ authentic_source: {
545
+ organization_name: string;
546
+ organization_code: string;
547
+ contacts: string[];
548
+ homepage_uri: string;
549
+ logo_uri: string;
550
+ };
551
+ };
552
+ }>;
371
553
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sd-jwt/types.ts"],"names":[],"mappings":"AACA,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,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BnB,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAevB,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcvB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { TypeMetadata, Verification } from "./types";
2
+ /**
3
+ * Retrieve the Type Metadata for a credential and verify its integrity.
4
+ * @param vct The VCT as a valid HTTPS url
5
+ * @param vctIntegrity The integrity hash
6
+ * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
7
+ * @returns The credential metadata {@link TypeMetadata}
8
+ */
9
+ export declare const fetchTypeMetadata: (vct: string, vctIntegrity: string, context?: {
10
+ appFetch?: GlobalFetch["fetch"];
11
+ }) => Promise<TypeMetadata>;
12
+ /**
13
+ * Extract and validate the `verification` claim from disclosures.
14
+ * @param credentialSdJwt The raw credential SD-JWT
15
+ * @returns The verification claim or undefined if it wasn't found
16
+ */
17
+ export declare const getVerification: (credentialSdJwt: string) => Verification | undefined;
18
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/sd-jwt/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AASrD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,QACvB,MAAM,gBACG,MAAM,YACX;IACP,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACA,QAAQ,YAAY,CA8BtB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,oBACT,MAAM,KACtB,YAAY,GAAG,SASjB,CAAC"}