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

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 (131) hide show
  1. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +75 -57
  2. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
  3. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  4. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +3 -3
  5. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  6. package/lib/commonjs/credential/issuance/README.md +45 -34
  7. package/lib/commonjs/credential/issuance/types.js +1 -0
  8. package/lib/commonjs/credential/issuance/types.js.map +1 -1
  9. package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +6 -13
  10. package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
  11. package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js +7 -8
  12. package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
  13. package/lib/commonjs/credential/presentation/types.js +1 -1
  14. package/lib/commonjs/credential/presentation/types.js.map +1 -1
  15. package/lib/commonjs/credential/status/{02-status-attestation.js → 02-status-assertion.js} +28 -22
  16. package/lib/commonjs/credential/status/02-status-assertion.js.map +1 -0
  17. package/lib/commonjs/credential/status/03-verify-and-parse-status-assertion.js +85 -0
  18. package/lib/commonjs/credential/status/03-verify-and-parse-status-assertion.js.map +1 -0
  19. package/lib/commonjs/credential/status/README.md +22 -20
  20. package/lib/commonjs/credential/status/index.js +6 -6
  21. package/lib/commonjs/credential/status/index.js.map +1 -1
  22. package/lib/commonjs/credential/status/types.js +48 -15
  23. package/lib/commonjs/credential/status/types.js.map +1 -1
  24. package/lib/commonjs/sd-jwt/index.js +6 -1
  25. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  26. package/lib/commonjs/sd-jwt/types.js +25 -9
  27. package/lib/commonjs/sd-jwt/types.js.map +1 -1
  28. package/lib/commonjs/utils/credentials.js +33 -0
  29. package/lib/commonjs/utils/credentials.js.map +1 -0
  30. package/lib/commonjs/utils/crypto.js +1 -7
  31. package/lib/commonjs/utils/crypto.js.map +1 -1
  32. package/lib/commonjs/utils/jwk.js +12 -0
  33. package/lib/commonjs/utils/jwk.js.map +1 -1
  34. package/lib/commonjs/wallet-instance-attestation/types.js +1 -2
  35. package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
  36. package/lib/module/credential/issuance/04-complete-user-authorization.js +76 -58
  37. package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
  38. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  39. package/lib/module/credential/issuance/07-verify-and-parse-credential.js +4 -4
  40. package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  41. package/lib/module/credential/issuance/README.md +45 -34
  42. package/lib/module/credential/issuance/types.js +1 -0
  43. package/lib/module/credential/issuance/types.js.map +1 -1
  44. package/lib/module/credential/presentation/07-evaluate-dcql-query.js +6 -13
  45. package/lib/module/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
  46. package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +7 -8
  47. package/lib/module/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
  48. package/lib/module/credential/presentation/types.js +1 -1
  49. package/lib/module/credential/presentation/types.js.map +1 -1
  50. package/lib/module/credential/status/{02-status-attestation.js → 02-status-assertion.js} +28 -22
  51. package/lib/module/credential/status/02-status-assertion.js.map +1 -0
  52. package/lib/module/credential/status/03-verify-and-parse-status-assertion.js +78 -0
  53. package/lib/module/credential/status/03-verify-and-parse-status-assertion.js.map +1 -0
  54. package/lib/module/credential/status/README.md +22 -20
  55. package/lib/module/credential/status/index.js +3 -3
  56. package/lib/module/credential/status/index.js.map +1 -1
  57. package/lib/module/credential/status/types.js +43 -12
  58. package/lib/module/credential/status/types.js.map +1 -1
  59. package/lib/module/sd-jwt/index.js +6 -1
  60. package/lib/module/sd-jwt/index.js.map +1 -1
  61. package/lib/module/sd-jwt/types.js +25 -9
  62. package/lib/module/sd-jwt/types.js.map +1 -1
  63. package/lib/module/utils/credentials.js +26 -0
  64. package/lib/module/utils/credentials.js.map +1 -0
  65. package/lib/module/utils/crypto.js +2 -8
  66. package/lib/module/utils/crypto.js.map +1 -1
  67. package/lib/module/utils/jwk.js +11 -1
  68. package/lib/module/utils/jwk.js.map +1 -1
  69. package/lib/module/wallet-instance-attestation/types.js +1 -2
  70. package/lib/module/wallet-instance-attestation/types.js.map +1 -1
  71. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +7 -14
  72. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
  73. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  74. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
  75. package/lib/typescript/credential/issuance/types.d.ts +3 -0
  76. package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
  77. package/lib/typescript/credential/presentation/01-start-flow.d.ts +2 -2
  78. package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts +4 -3
  79. package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts.map +1 -1
  80. package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts +9 -5
  81. package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts.map +1 -1
  82. package/lib/typescript/credential/presentation/types.d.ts +3 -4
  83. package/lib/typescript/credential/presentation/types.d.ts.map +1 -1
  84. package/lib/typescript/credential/status/02-status-assertion.d.ts +23 -0
  85. package/lib/typescript/credential/status/02-status-assertion.d.ts.map +1 -0
  86. package/lib/typescript/credential/status/03-verify-and-parse-status-assertion.d.ts +21 -0
  87. package/lib/typescript/credential/status/03-verify-and-parse-status-assertion.d.ts.map +1 -0
  88. package/lib/typescript/credential/status/index.d.ts +4 -4
  89. package/lib/typescript/credential/status/index.d.ts.map +1 -1
  90. package/lib/typescript/credential/status/types.d.ts +499 -22
  91. package/lib/typescript/credential/status/types.d.ts.map +1 -1
  92. package/lib/typescript/sd-jwt/index.d.ts +68 -40
  93. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  94. package/lib/typescript/sd-jwt/types.d.ts +97 -46
  95. package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
  96. package/lib/typescript/utils/credentials.d.ts +11 -0
  97. package/lib/typescript/utils/credentials.d.ts.map +1 -0
  98. package/lib/typescript/utils/crypto.d.ts.map +1 -1
  99. package/lib/typescript/utils/jwk.d.ts +7 -0
  100. package/lib/typescript/utils/jwk.d.ts.map +1 -1
  101. package/package.json +1 -1
  102. package/src/credential/issuance/04-complete-user-authorization.ts +79 -85
  103. package/src/credential/issuance/06-obtain-credential.ts +4 -1
  104. package/src/credential/issuance/07-verify-and-parse-credential.ts +4 -6
  105. package/src/credential/issuance/README.md +45 -34
  106. package/src/credential/issuance/types.ts +1 -0
  107. package/src/credential/presentation/07-evaluate-dcql-query.ts +16 -17
  108. package/src/credential/presentation/07-evaluate-input-descriptor.ts +16 -13
  109. package/src/credential/presentation/types.ts +1 -2
  110. package/src/credential/status/{02-status-attestation.ts → 02-status-assertion.ts} +37 -28
  111. package/src/credential/status/03-verify-and-parse-status-assertion.ts +109 -0
  112. package/src/credential/status/README.md +22 -20
  113. package/src/credential/status/index.ts +7 -14
  114. package/src/credential/status/types.ts +62 -15
  115. package/src/sd-jwt/index.ts +5 -1
  116. package/src/sd-jwt/types.ts +24 -10
  117. package/src/utils/credentials.ts +29 -0
  118. package/src/utils/crypto.ts +12 -20
  119. package/src/utils/jwk.ts +15 -1
  120. package/src/wallet-instance-attestation/types.ts +1 -1
  121. package/lib/commonjs/credential/status/02-status-attestation.js.map +0 -1
  122. package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js +0 -55
  123. package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js.map +0 -1
  124. package/lib/module/credential/status/02-status-attestation.js.map +0 -1
  125. package/lib/module/credential/status/03-verify-and-parse-status-attestation.js +0 -49
  126. package/lib/module/credential/status/03-verify-and-parse-status-attestation.js.map +0 -1
  127. package/lib/typescript/credential/status/02-status-attestation.d.ts +0 -19
  128. package/lib/typescript/credential/status/02-status-attestation.d.ts.map +0 -1
  129. package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts +0 -24
  130. package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts.map +0 -1
  131. package/src/credential/status/03-verify-and-parse-status-attestation.ts +0 -70
@@ -21,16 +21,14 @@ export * from "./utils";
21
21
  export declare const decode: <S extends z.ZodType<{
22
22
  header: {
23
23
  alg: string;
24
- typ: "dc+sd-jwt";
25
- kid?: string | undefined;
24
+ kid: string;
25
+ typ: "vc+sd-jwt" | "dc+sd-jwt";
26
+ trust_chain?: string[] | undefined;
27
+ x5c?: string[] | undefined;
28
+ vctm?: string[] | undefined;
26
29
  };
27
30
  payload: {
28
31
  iss: string;
29
- status: {
30
- status_assertion: {
31
- credential_hash_alg: "sha-256";
32
- };
33
- };
34
32
  sub: string;
35
33
  exp: number;
36
34
  _sd_alg: "sha-256";
@@ -61,26 +59,33 @@ export declare const decode: <S extends z.ZodType<{
61
59
  };
62
60
  };
63
61
  vct: string;
64
- "vct#integrity": string;
65
- issuing_authority: string;
66
- issuing_country: string;
67
62
  iat?: number | undefined;
63
+ status?: {
64
+ status_assertion: {
65
+ credential_hash_alg: "sha-256";
66
+ };
67
+ } | {
68
+ status_attestation: {
69
+ credential_hash_alg: "sha-256";
70
+ };
71
+ } | undefined;
72
+ "vct#integrity"?: string | undefined;
73
+ issuing_authority?: string | undefined;
74
+ issuing_country?: string | undefined;
68
75
  } & {
69
76
  _sd: string[];
70
77
  };
71
78
  }, z.ZodTypeDef, {
72
79
  header: {
73
80
  alg: string;
74
- typ: "dc+sd-jwt";
75
- kid?: string | undefined;
81
+ kid: string;
82
+ typ: "vc+sd-jwt" | "dc+sd-jwt";
83
+ trust_chain?: string[] | undefined;
84
+ x5c?: string[] | undefined;
85
+ vctm?: string[] | undefined;
76
86
  };
77
87
  payload: {
78
88
  iss: string;
79
- status: {
80
- status_assertion: {
81
- credential_hash_alg: "sha-256";
82
- };
83
- };
84
89
  sub: string;
85
90
  exp: number;
86
91
  _sd_alg: "sha-256";
@@ -111,10 +116,19 @@ export declare const decode: <S extends z.ZodType<{
111
116
  };
112
117
  };
113
118
  vct: string;
114
- "vct#integrity": string;
115
- issuing_authority: string;
116
- issuing_country: string;
117
119
  iat?: number | undefined;
120
+ status?: {
121
+ status_assertion: {
122
+ credential_hash_alg: "sha-256";
123
+ };
124
+ } | {
125
+ status_attestation: {
126
+ credential_hash_alg: "sha-256";
127
+ };
128
+ } | undefined;
129
+ "vct#integrity"?: string | undefined;
130
+ issuing_authority?: string | undefined;
131
+ issuing_country?: string | undefined;
118
132
  } & {
119
133
  _sd: string[];
120
134
  };
@@ -161,16 +175,14 @@ export declare const disclose: (token: string, claims: string[]) => Promise<{
161
175
  export declare const verify: <S extends z.ZodType<{
162
176
  header: {
163
177
  alg: string;
164
- typ: "dc+sd-jwt";
165
- kid?: string | undefined;
178
+ kid: string;
179
+ typ: "vc+sd-jwt" | "dc+sd-jwt";
180
+ trust_chain?: string[] | undefined;
181
+ x5c?: string[] | undefined;
182
+ vctm?: string[] | undefined;
166
183
  };
167
184
  payload: {
168
185
  iss: string;
169
- status: {
170
- status_assertion: {
171
- credential_hash_alg: "sha-256";
172
- };
173
- };
174
186
  sub: string;
175
187
  exp: number;
176
188
  _sd_alg: "sha-256";
@@ -201,26 +213,33 @@ export declare const verify: <S extends z.ZodType<{
201
213
  };
202
214
  };
203
215
  vct: string;
204
- "vct#integrity": string;
205
- issuing_authority: string;
206
- issuing_country: string;
207
216
  iat?: number | undefined;
217
+ status?: {
218
+ status_assertion: {
219
+ credential_hash_alg: "sha-256";
220
+ };
221
+ } | {
222
+ status_attestation: {
223
+ credential_hash_alg: "sha-256";
224
+ };
225
+ } | undefined;
226
+ "vct#integrity"?: string | undefined;
227
+ issuing_authority?: string | undefined;
228
+ issuing_country?: string | undefined;
208
229
  } & {
209
230
  _sd: string[];
210
231
  };
211
232
  }, z.ZodTypeDef, {
212
233
  header: {
213
234
  alg: string;
214
- typ: "dc+sd-jwt";
215
- kid?: string | undefined;
235
+ kid: string;
236
+ typ: "vc+sd-jwt" | "dc+sd-jwt";
237
+ trust_chain?: string[] | undefined;
238
+ x5c?: string[] | undefined;
239
+ vctm?: string[] | undefined;
216
240
  };
217
241
  payload: {
218
242
  iss: string;
219
- status: {
220
- status_assertion: {
221
- credential_hash_alg: "sha-256";
222
- };
223
- };
224
243
  sub: string;
225
244
  exp: number;
226
245
  _sd_alg: "sha-256";
@@ -251,10 +270,19 @@ export declare const verify: <S extends z.ZodType<{
251
270
  };
252
271
  };
253
272
  vct: string;
254
- "vct#integrity": string;
255
- issuing_authority: string;
256
- issuing_country: string;
257
273
  iat?: number | undefined;
274
+ status?: {
275
+ status_assertion: {
276
+ credential_hash_alg: "sha-256";
277
+ };
278
+ } | {
279
+ status_attestation: {
280
+ credential_hash_alg: "sha-256";
281
+ };
282
+ } | undefined;
283
+ "vct#integrity"?: string | undefined;
284
+ issuing_authority?: string | undefined;
285
+ issuing_country?: string | undefined;
258
286
  } & {
259
287
  _sd: string[];
260
288
  };
@@ -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;AAErE,cAAc,SAAS,CAAC;AAQ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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;EA4CnE,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,20 +29,33 @@ export type DisclosureWithEncoded = {
29
29
  decoded: Disclosure;
30
30
  encoded: string;
31
31
  };
32
+ /**
33
+ * Type for a Verifiable Credential in SD-JWT format.
34
+ * It supports both the older and the new data model for backward compatibility.
35
+ */
32
36
  export type SdJwt4VC = z.infer<typeof SdJwt4VC>;
33
37
  export declare const SdJwt4VC: z.ZodObject<{
34
38
  header: z.ZodObject<{
35
- typ: z.ZodLiteral<"dc+sd-jwt">;
39
+ typ: z.ZodEnum<["vc+sd-jwt", "dc+sd-jwt"]>;
36
40
  alg: z.ZodString;
37
- kid: z.ZodOptional<z.ZodString>;
41
+ kid: z.ZodString;
42
+ trust_chain: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
43
+ x5c: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
44
+ vctm: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
38
45
  }, "strip", z.ZodTypeAny, {
39
46
  alg: string;
40
- typ: "dc+sd-jwt";
41
- kid?: string | undefined;
47
+ kid: string;
48
+ typ: "vc+sd-jwt" | "dc+sd-jwt";
49
+ trust_chain?: string[] | undefined;
50
+ x5c?: string[] | undefined;
51
+ vctm?: string[] | undefined;
42
52
  }, {
43
53
  alg: string;
44
- typ: "dc+sd-jwt";
45
- kid?: string | undefined;
54
+ kid: string;
55
+ typ: "vc+sd-jwt" | "dc+sd-jwt";
56
+ trust_chain?: string[] | undefined;
57
+ x5c?: string[] | undefined;
58
+ vctm?: string[] | undefined;
46
59
  }>;
47
60
  payload: z.ZodIntersection<z.ZodObject<{
48
61
  iss: z.ZodString;
@@ -50,7 +63,7 @@ export declare const SdJwt4VC: z.ZodObject<{
50
63
  iat: z.ZodOptional<z.ZodNumber>;
51
64
  exp: z.ZodNumber;
52
65
  _sd_alg: z.ZodLiteral<"sha-256">;
53
- status: z.ZodObject<{
66
+ status: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
54
67
  status_assertion: z.ZodObject<{
55
68
  credential_hash_alg: z.ZodLiteral<"sha-256">;
56
69
  }, "strip", z.ZodTypeAny, {
@@ -66,7 +79,23 @@ export declare const SdJwt4VC: z.ZodObject<{
66
79
  status_assertion: {
67
80
  credential_hash_alg: "sha-256";
68
81
  };
69
- }>;
82
+ }>, z.ZodObject<{
83
+ status_attestation: z.ZodObject<{
84
+ credential_hash_alg: z.ZodLiteral<"sha-256">;
85
+ }, "strip", z.ZodTypeAny, {
86
+ credential_hash_alg: "sha-256";
87
+ }, {
88
+ credential_hash_alg: "sha-256";
89
+ }>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ status_attestation: {
92
+ credential_hash_alg: "sha-256";
93
+ };
94
+ }, {
95
+ status_attestation: {
96
+ credential_hash_alg: "sha-256";
97
+ };
98
+ }>]>>;
70
99
  cnf: z.ZodObject<{
71
100
  jwk: z.ZodObject<{
72
101
  alg: z.ZodOptional<z.ZodString>;
@@ -190,16 +219,11 @@ export declare const SdJwt4VC: z.ZodObject<{
190
219
  };
191
220
  }>;
192
221
  vct: z.ZodString;
193
- "vct#integrity": z.ZodString;
194
- issuing_authority: z.ZodString;
195
- issuing_country: z.ZodString;
222
+ "vct#integrity": z.ZodOptional<z.ZodString>;
223
+ issuing_authority: z.ZodOptional<z.ZodString>;
224
+ issuing_country: z.ZodOptional<z.ZodString>;
196
225
  }, "strip", z.ZodTypeAny, {
197
226
  iss: string;
198
- status: {
199
- status_assertion: {
200
- credential_hash_alg: "sha-256";
201
- };
202
- };
203
227
  sub: string;
204
228
  exp: number;
205
229
  _sd_alg: "sha-256";
@@ -230,17 +254,21 @@ export declare const SdJwt4VC: z.ZodObject<{
230
254
  };
231
255
  };
232
256
  vct: string;
233
- "vct#integrity": string;
234
- issuing_authority: string;
235
- issuing_country: string;
236
257
  iat?: number | undefined;
237
- }, {
238
- iss: string;
239
- status: {
258
+ status?: {
240
259
  status_assertion: {
241
260
  credential_hash_alg: "sha-256";
242
261
  };
243
- };
262
+ } | {
263
+ status_attestation: {
264
+ credential_hash_alg: "sha-256";
265
+ };
266
+ } | undefined;
267
+ "vct#integrity"?: string | undefined;
268
+ issuing_authority?: string | undefined;
269
+ issuing_country?: string | undefined;
270
+ }, {
271
+ iss: string;
244
272
  sub: string;
245
273
  exp: number;
246
274
  _sd_alg: "sha-256";
@@ -271,10 +299,19 @@ export declare const SdJwt4VC: z.ZodObject<{
271
299
  };
272
300
  };
273
301
  vct: string;
274
- "vct#integrity": string;
275
- issuing_authority: string;
276
- issuing_country: string;
277
302
  iat?: number | undefined;
303
+ status?: {
304
+ status_assertion: {
305
+ credential_hash_alg: "sha-256";
306
+ };
307
+ } | {
308
+ status_attestation: {
309
+ credential_hash_alg: "sha-256";
310
+ };
311
+ } | undefined;
312
+ "vct#integrity"?: string | undefined;
313
+ issuing_authority?: string | undefined;
314
+ issuing_country?: string | undefined;
278
315
  }>, z.ZodObject<{
279
316
  _sd: z.ZodArray<z.ZodString, "many">;
280
317
  }, "strip", z.ZodTypeAny, {
@@ -285,16 +322,14 @@ export declare const SdJwt4VC: z.ZodObject<{
285
322
  }, "strip", z.ZodTypeAny, {
286
323
  header: {
287
324
  alg: string;
288
- typ: "dc+sd-jwt";
289
- kid?: string | undefined;
325
+ kid: string;
326
+ typ: "vc+sd-jwt" | "dc+sd-jwt";
327
+ trust_chain?: string[] | undefined;
328
+ x5c?: string[] | undefined;
329
+ vctm?: string[] | undefined;
290
330
  };
291
331
  payload: {
292
332
  iss: string;
293
- status: {
294
- status_assertion: {
295
- credential_hash_alg: "sha-256";
296
- };
297
- };
298
333
  sub: string;
299
334
  exp: number;
300
335
  _sd_alg: "sha-256";
@@ -325,26 +360,33 @@ export declare const SdJwt4VC: z.ZodObject<{
325
360
  };
326
361
  };
327
362
  vct: string;
328
- "vct#integrity": string;
329
- issuing_authority: string;
330
- issuing_country: string;
331
363
  iat?: number | undefined;
364
+ status?: {
365
+ status_assertion: {
366
+ credential_hash_alg: "sha-256";
367
+ };
368
+ } | {
369
+ status_attestation: {
370
+ credential_hash_alg: "sha-256";
371
+ };
372
+ } | undefined;
373
+ "vct#integrity"?: string | undefined;
374
+ issuing_authority?: string | undefined;
375
+ issuing_country?: string | undefined;
332
376
  } & {
333
377
  _sd: string[];
334
378
  };
335
379
  }, {
336
380
  header: {
337
381
  alg: string;
338
- typ: "dc+sd-jwt";
339
- kid?: string | undefined;
382
+ kid: string;
383
+ typ: "vc+sd-jwt" | "dc+sd-jwt";
384
+ trust_chain?: string[] | undefined;
385
+ x5c?: string[] | undefined;
386
+ vctm?: string[] | undefined;
340
387
  };
341
388
  payload: {
342
389
  iss: string;
343
- status: {
344
- status_assertion: {
345
- credential_hash_alg: "sha-256";
346
- };
347
- };
348
390
  sub: string;
349
391
  exp: number;
350
392
  _sd_alg: "sha-256";
@@ -375,10 +417,19 @@ export declare const SdJwt4VC: z.ZodObject<{
375
417
  };
376
418
  };
377
419
  vct: string;
378
- "vct#integrity": string;
379
- issuing_authority: string;
380
- issuing_country: string;
381
420
  iat?: number | undefined;
421
+ status?: {
422
+ status_assertion: {
423
+ credential_hash_alg: "sha-256";
424
+ };
425
+ } | {
426
+ status_attestation: {
427
+ credential_hash_alg: "sha-256";
428
+ };
429
+ } | undefined;
430
+ "vct#integrity"?: string | undefined;
431
+ issuing_authority?: string | undefined;
432
+ issuing_country?: string | undefined;
382
433
  } & {
383
434
  _sd: string[];
384
435
  };
@@ -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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 +1,11 @@
1
+ import type { Out } from "./misc";
2
+ import type { ObtainCredential } from "../credential/issuance";
3
+ import type { JWK } from "./jwk";
4
+ /**
5
+ * Extracts a JWK from a credential.
6
+ * @param credential - The credential string, which can be in SD-JWT or CBOR format.
7
+ * @param format - The format of the credential
8
+ * @return A Promise that resolves to a JWK object if the credential is in SD-JWT format and contains a JWK, or undefined otherwise.
9
+ */
10
+ export declare const extractJwkFromCredential: (credential: Out<ObtainCredential>["credential"], format: Out<ObtainCredential>["format"]) => Promise<JWK>;
11
+ //# sourceMappingURL=credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/utils/credentials.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,eACvB,IAAI,gBAAgB,CAAC,CAAC,YAAY,CAAC,UACvC,IAAI,gBAAgB,CAAC,CAAC,QAAQ,CAAC,KACtC,QAAQ,GAAG,CAUb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../src/utils/crypto.ts"],"names":[],"mappings":"AAOA,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG7E;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,WAAY,MAAM,KAAG,aA6BvD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,6BACJ,aAAa,8BAOrC,CAAC"}
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../src/utils/crypto.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,6BAA6B,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,WAAY,MAAM,KAAG,aAsBvD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,6BACJ,aAAa,8BAOrC,CAAC"}
@@ -228,4 +228,11 @@ export declare const JWKS: z.ZodObject<{
228
228
  }[];
229
229
  }>;
230
230
  export type JWTDecodeResult = ReturnType<typeof decode>;
231
+ /**
232
+ * Utility function that checks if two JWKs have the same thumbprint.
233
+ * @param jwkA The first JWK
234
+ * @param jwkB The second JWK
235
+ * @returns Whether the thumbprints match
236
+ */
237
+ export declare const isSameThumbprint: (jwkA: JWK, jwkB: JWK) => Promise<boolean>;
231
238
  //# sourceMappingURL=jwk.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jwk.d.ts","sourceRoot":"","sources":["../../../src/utils/jwk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;AACtC,eAAO,MAAM,GAAG;IACd,uCAAuC;;;;;;;IAOvC,yCAAyC;;;IAGzC,gDAAgD;;IAEhD,oCAAoC;;IAEpC;;kCAE8B;;;;;;IAM9B,4CAA4C;;;;IAI5C,qDAAqD;;IAErD,gEAAgE;;IAEhE,mEAAmE;;IAEnE,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEvC,CAAC;AAEH;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAUpD;AAED,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACxC,eAAO,MAAM,IAAI;;QAzDf,uCAAuC;;;;;;;QAOvC,yCAAyC;;;QAGzC,gDAAgD;;QAEhD,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BvC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AAExD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,SAAgB,GAAG,QAAQ,GAAG,qBAM1D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagopa/io-react-native-wallet",
3
- "version": "2.0.0-next.3",
3
+ "version": "2.0.0-next.5",
4
4
  "description": "Provide data structures, helpers and API for IO Wallet",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",