@pagopa/io-react-native-wallet 0.2.1 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. package/lib/commonjs/index.js +9 -1
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/pid/issuing.js +28 -0
  4. package/lib/commonjs/pid/issuing.js.map +1 -1
  5. package/lib/commonjs/pid/metadata.js +51 -0
  6. package/lib/commonjs/pid/metadata.js.map +1 -0
  7. package/lib/commonjs/pid/sd-jwt/index.js +2 -1
  8. package/lib/commonjs/pid/sd-jwt/index.js.map +1 -1
  9. package/lib/commonjs/rp/__test__/index.test.js +3 -5
  10. package/lib/commonjs/rp/__test__/index.test.js.map +1 -1
  11. package/lib/commonjs/rp/index.js +165 -15
  12. package/lib/commonjs/rp/index.js.map +1 -1
  13. package/lib/commonjs/rp/types.js +13 -1
  14. package/lib/commonjs/rp/types.js.map +1 -1
  15. package/lib/commonjs/sd-jwt/__test__/index.test.js +119 -0
  16. package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -0
  17. package/lib/commonjs/sd-jwt/index.js +84 -4
  18. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  19. package/lib/commonjs/sd-jwt/types.js +9 -0
  20. package/lib/commonjs/sd-jwt/types.js.map +1 -1
  21. package/lib/commonjs/sd-jwt/verifier.js +7 -5
  22. package/lib/commonjs/sd-jwt/verifier.js.map +1 -1
  23. package/lib/commonjs/utils/errors.js +76 -1
  24. package/lib/commonjs/utils/errors.js.map +1 -1
  25. package/lib/module/index.js +5 -1
  26. package/lib/module/index.js.map +1 -1
  27. package/lib/module/pid/issuing.js +30 -2
  28. package/lib/module/pid/issuing.js.map +1 -1
  29. package/lib/module/pid/metadata.js +43 -0
  30. package/lib/module/pid/metadata.js.map +1 -0
  31. package/lib/module/pid/sd-jwt/index.js +3 -3
  32. package/lib/module/pid/sd-jwt/index.js.map +1 -1
  33. package/lib/module/rp/__test__/index.test.js +3 -5
  34. package/lib/module/rp/__test__/index.test.js.map +1 -1
  35. package/lib/module/rp/index.js +168 -18
  36. package/lib/module/rp/index.js.map +1 -1
  37. package/lib/module/rp/types.js +11 -0
  38. package/lib/module/rp/types.js.map +1 -1
  39. package/lib/module/sd-jwt/__test__/index.test.js +118 -0
  40. package/lib/module/sd-jwt/__test__/index.test.js.map +1 -0
  41. package/lib/module/sd-jwt/index.js +83 -3
  42. package/lib/module/sd-jwt/index.js.map +1 -1
  43. package/lib/module/sd-jwt/types.js +10 -0
  44. package/lib/module/sd-jwt/types.js.map +1 -1
  45. package/lib/module/sd-jwt/verifier.js +8 -6
  46. package/lib/module/sd-jwt/verifier.js.map +1 -1
  47. package/lib/module/utils/errors.js +71 -0
  48. package/lib/module/utils/errors.js.map +1 -1
  49. package/lib/typescript/{index.d.ts → src/index.d.ts} +3 -1
  50. package/lib/typescript/src/index.d.ts.map +1 -0
  51. package/lib/typescript/src/pid/index.d.ts.map +1 -0
  52. package/lib/typescript/{pid → src/pid}/issuing.d.ts +9 -0
  53. package/lib/typescript/src/pid/issuing.d.ts.map +1 -0
  54. package/lib/typescript/src/pid/metadata.d.ts +528 -0
  55. package/lib/typescript/src/pid/metadata.d.ts.map +1 -0
  56. package/lib/typescript/src/pid/sd-jwt/converters.d.ts.map +1 -0
  57. package/lib/typescript/{pid → src/pid}/sd-jwt/index.d.ts +1 -1
  58. package/lib/typescript/src/pid/sd-jwt/index.d.ts.map +1 -0
  59. package/lib/typescript/src/pid/sd-jwt/types.d.ts.map +1 -0
  60. package/lib/typescript/src/rp/__test__/index.test.d.ts.map +1 -0
  61. package/lib/typescript/src/rp/index.d.ts +89 -0
  62. package/lib/typescript/src/rp/index.d.ts.map +1 -0
  63. package/lib/typescript/{rp → src/rp}/types.d.ts +71 -47
  64. package/lib/typescript/{rp → src/rp}/types.d.ts.map +1 -1
  65. package/lib/typescript/src/sd-jwt/__test__/converters.test.d.ts.map +1 -0
  66. package/lib/typescript/src/sd-jwt/__test__/index.test.d.ts +2 -0
  67. package/lib/typescript/src/sd-jwt/__test__/index.test.d.ts.map +1 -0
  68. package/lib/typescript/src/sd-jwt/__test__/types.test.d.ts.map +1 -0
  69. package/lib/typescript/src/sd-jwt/converters.d.ts.map +1 -0
  70. package/lib/typescript/{sd-jwt → src/sd-jwt}/index.d.ts +22 -2
  71. package/lib/typescript/src/sd-jwt/index.d.ts.map +1 -0
  72. package/lib/typescript/{sd-jwt → src/sd-jwt}/types.d.ts +12 -0
  73. package/lib/typescript/src/sd-jwt/types.d.ts.map +1 -0
  74. package/lib/typescript/src/sd-jwt/verifier.d.ts +3 -0
  75. package/lib/typescript/src/sd-jwt/verifier.d.ts.map +1 -0
  76. package/lib/typescript/src/utils/dpop.d.ts.map +1 -0
  77. package/lib/typescript/{utils → src/utils}/errors.d.ts +41 -0
  78. package/lib/typescript/src/utils/errors.d.ts.map +1 -0
  79. package/lib/typescript/src/utils/jwk.d.ts.map +1 -0
  80. package/lib/typescript/src/wallet-instance-attestation/index.d.ts.map +1 -0
  81. package/lib/typescript/src/wallet-instance-attestation/issuing.d.ts.map +1 -0
  82. package/lib/typescript/{wallet-instance-attestation → src/wallet-instance-attestation}/types.d.ts +8 -8
  83. package/lib/typescript/{wallet-instance-attestation → src/wallet-instance-attestation}/types.d.ts.map +1 -1
  84. package/package.json +7 -5
  85. package/src/index.ts +13 -1
  86. package/src/pid/issuing.ts +38 -1
  87. package/src/pid/metadata.ts +46 -0
  88. package/src/pid/sd-jwt/index.ts +7 -4
  89. package/src/rp/__test__/index.test.ts +5 -9
  90. package/src/rp/index.ts +208 -24
  91. package/src/rp/types.ts +16 -0
  92. package/src/sd-jwt/__test__/index.test.ts +171 -0
  93. package/src/sd-jwt/index.ts +84 -7
  94. package/src/sd-jwt/types.ts +13 -0
  95. package/src/sd-jwt/verifier.ts +5 -7
  96. package/src/utils/errors.ts +81 -0
  97. package/lib/typescript/index.d.ts.map +0 -1
  98. package/lib/typescript/pid/index.d.ts.map +0 -1
  99. package/lib/typescript/pid/issuing.d.ts.map +0 -1
  100. package/lib/typescript/pid/sd-jwt/converters.d.ts.map +0 -1
  101. package/lib/typescript/pid/sd-jwt/index.d.ts.map +0 -1
  102. package/lib/typescript/pid/sd-jwt/types.d.ts.map +0 -1
  103. package/lib/typescript/rp/__test__/index.test.d.ts.map +0 -1
  104. package/lib/typescript/rp/index.d.ts +0 -43
  105. package/lib/typescript/rp/index.d.ts.map +0 -1
  106. package/lib/typescript/sd-jwt/__test__/converters.test.d.ts.map +0 -1
  107. package/lib/typescript/sd-jwt/__test__/types.test.d.ts.map +0 -1
  108. package/lib/typescript/sd-jwt/converters.d.ts.map +0 -1
  109. package/lib/typescript/sd-jwt/index.d.ts.map +0 -1
  110. package/lib/typescript/sd-jwt/types.d.ts.map +0 -1
  111. package/lib/typescript/sd-jwt/verifier.d.ts +0 -3
  112. package/lib/typescript/sd-jwt/verifier.d.ts.map +0 -1
  113. package/lib/typescript/utils/dpop.d.ts.map +0 -1
  114. package/lib/typescript/utils/errors.d.ts.map +0 -1
  115. package/lib/typescript/utils/jwk.d.ts.map +0 -1
  116. package/lib/typescript/wallet-instance-attestation/index.d.ts.map +0 -1
  117. package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +0 -1
  118. /package/lib/typescript/{pid → src/pid}/index.d.ts +0 -0
  119. /package/lib/typescript/{pid → src/pid}/sd-jwt/converters.d.ts +0 -0
  120. /package/lib/typescript/{pid → src/pid}/sd-jwt/types.d.ts +0 -0
  121. /package/lib/typescript/{rp → src/rp}/__test__/index.test.d.ts +0 -0
  122. /package/lib/typescript/{sd-jwt → src/sd-jwt}/__test__/converters.test.d.ts +0 -0
  123. /package/lib/typescript/{sd-jwt → src/sd-jwt}/__test__/types.test.d.ts +0 -0
  124. /package/lib/typescript/{sd-jwt → src/sd-jwt}/converters.d.ts +0 -0
  125. /package/lib/typescript/{utils → src/utils}/dpop.d.ts +0 -0
  126. /package/lib/typescript/{utils → src/utils}/jwk.d.ts +0 -0
  127. /package/lib/typescript/{wallet-instance-attestation → src/wallet-instance-attestation}/index.d.ts +0 -0
  128. /package/lib/typescript/{wallet-instance-attestation → src/wallet-instance-attestation}/issuing.d.ts +0 -0
@@ -0,0 +1,528 @@
1
+ import { z } from "zod";
2
+ export type PidDisplayMetadata = z.infer<typeof PidDisplayMetadata>;
3
+ export declare const PidDisplayMetadata: z.ZodObject<{
4
+ name: z.ZodString;
5
+ locale: z.ZodString;
6
+ logo: z.ZodObject<{
7
+ url: z.ZodString;
8
+ alt_text: z.ZodString;
9
+ }, "strip", z.ZodTypeAny, {
10
+ url: string;
11
+ alt_text: string;
12
+ }, {
13
+ url: string;
14
+ alt_text: string;
15
+ }>;
16
+ background_color: z.ZodString;
17
+ text_color: z.ZodString;
18
+ }, "strip", z.ZodTypeAny, {
19
+ name: string;
20
+ locale: string;
21
+ logo: {
22
+ url: string;
23
+ alt_text: string;
24
+ };
25
+ background_color: string;
26
+ text_color: string;
27
+ }, {
28
+ name: string;
29
+ locale: string;
30
+ logo: {
31
+ url: string;
32
+ alt_text: string;
33
+ };
34
+ background_color: string;
35
+ text_color: string;
36
+ }>;
37
+ export type PidIssuerEntityConfiguration = z.infer<typeof PidIssuerEntityConfiguration>;
38
+ export declare const PidIssuerEntityConfiguration: z.ZodObject<{
39
+ jwks: z.ZodObject<{
40
+ keys: z.ZodArray<z.ZodObject<{
41
+ alg: z.ZodOptional<z.ZodString>;
42
+ crv: z.ZodOptional<z.ZodString>;
43
+ d: z.ZodOptional<z.ZodString>;
44
+ dp: z.ZodOptional<z.ZodString>;
45
+ dq: z.ZodOptional<z.ZodString>;
46
+ e: z.ZodOptional<z.ZodString>;
47
+ ext: z.ZodOptional<z.ZodBoolean>;
48
+ k: z.ZodOptional<z.ZodString>;
49
+ key_ops: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
50
+ kid: z.ZodOptional<z.ZodString>;
51
+ kty: z.ZodUnion<[z.ZodLiteral<"RSA">, z.ZodLiteral<"EC">]>;
52
+ n: z.ZodOptional<z.ZodString>;
53
+ p: z.ZodOptional<z.ZodString>;
54
+ q: z.ZodOptional<z.ZodString>;
55
+ qi: z.ZodOptional<z.ZodString>;
56
+ use: z.ZodOptional<z.ZodString>;
57
+ x: z.ZodOptional<z.ZodString>;
58
+ y: z.ZodOptional<z.ZodString>;
59
+ x5c: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
60
+ x5t: z.ZodOptional<z.ZodString>;
61
+ "x5t#S256": z.ZodOptional<z.ZodString>;
62
+ x5u: z.ZodOptional<z.ZodString>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ kty: "RSA" | "EC";
65
+ alg?: string | undefined;
66
+ crv?: string | undefined;
67
+ d?: string | undefined;
68
+ dp?: string | undefined;
69
+ dq?: string | undefined;
70
+ e?: string | undefined;
71
+ ext?: boolean | undefined;
72
+ k?: string | undefined;
73
+ key_ops?: string[] | undefined;
74
+ kid?: string | undefined;
75
+ n?: string | undefined;
76
+ p?: string | undefined;
77
+ q?: string | undefined;
78
+ qi?: string | undefined;
79
+ use?: string | undefined;
80
+ x?: string | undefined;
81
+ y?: string | undefined;
82
+ x5c?: string[] | undefined;
83
+ x5t?: string | undefined;
84
+ "x5t#S256"?: string | undefined;
85
+ x5u?: string | undefined;
86
+ }, {
87
+ kty: "RSA" | "EC";
88
+ alg?: string | undefined;
89
+ crv?: string | undefined;
90
+ d?: string | undefined;
91
+ dp?: string | undefined;
92
+ dq?: string | undefined;
93
+ e?: string | undefined;
94
+ ext?: boolean | undefined;
95
+ k?: string | undefined;
96
+ key_ops?: string[] | undefined;
97
+ kid?: string | undefined;
98
+ n?: string | undefined;
99
+ p?: string | undefined;
100
+ q?: string | undefined;
101
+ qi?: string | undefined;
102
+ use?: string | undefined;
103
+ x?: string | undefined;
104
+ y?: string | undefined;
105
+ x5c?: string[] | undefined;
106
+ x5t?: string | undefined;
107
+ "x5t#S256"?: string | undefined;
108
+ x5u?: string | undefined;
109
+ }>, "many">;
110
+ }, "strip", z.ZodTypeAny, {
111
+ keys: {
112
+ kty: "RSA" | "EC";
113
+ alg?: string | undefined;
114
+ crv?: string | undefined;
115
+ d?: string | undefined;
116
+ dp?: string | undefined;
117
+ dq?: string | undefined;
118
+ e?: string | undefined;
119
+ ext?: boolean | undefined;
120
+ k?: string | undefined;
121
+ key_ops?: string[] | undefined;
122
+ kid?: string | undefined;
123
+ n?: string | undefined;
124
+ p?: string | undefined;
125
+ q?: string | undefined;
126
+ qi?: string | undefined;
127
+ use?: string | undefined;
128
+ x?: string | undefined;
129
+ y?: string | undefined;
130
+ x5c?: string[] | undefined;
131
+ x5t?: string | undefined;
132
+ "x5t#S256"?: string | undefined;
133
+ x5u?: string | undefined;
134
+ }[];
135
+ }, {
136
+ keys: {
137
+ kty: "RSA" | "EC";
138
+ alg?: string | undefined;
139
+ crv?: string | undefined;
140
+ d?: string | undefined;
141
+ dp?: string | undefined;
142
+ dq?: string | undefined;
143
+ e?: string | undefined;
144
+ ext?: boolean | undefined;
145
+ k?: string | undefined;
146
+ key_ops?: string[] | undefined;
147
+ kid?: string | undefined;
148
+ n?: string | undefined;
149
+ p?: string | undefined;
150
+ q?: string | undefined;
151
+ qi?: string | undefined;
152
+ use?: string | undefined;
153
+ x?: string | undefined;
154
+ y?: string | undefined;
155
+ x5c?: string[] | undefined;
156
+ x5t?: string | undefined;
157
+ "x5t#S256"?: string | undefined;
158
+ x5u?: string | undefined;
159
+ }[];
160
+ }>;
161
+ metadata: z.ZodObject<{
162
+ openid_credential_issuer: z.ZodObject<{
163
+ credential_issuer: z.ZodString;
164
+ authorization_endpoint: z.ZodString;
165
+ token_endpoint: z.ZodString;
166
+ pushed_authorization_request_endpoint: z.ZodString;
167
+ dpop_signing_alg_values_supported: z.ZodArray<z.ZodString, "many">;
168
+ credential_endpoint: z.ZodString;
169
+ credentials_supported: z.ZodObject<{
170
+ "eu.eudiw.pid.it": z.ZodObject<{
171
+ format: z.ZodLiteral<"vc+sd-jwt">;
172
+ cryptographic_binding_methods_supported: z.ZodArray<z.ZodString, "many">;
173
+ cryptographic_suites_supported: z.ZodArray<z.ZodString, "many">;
174
+ display: z.ZodArray<z.ZodObject<{
175
+ name: z.ZodString;
176
+ locale: z.ZodString;
177
+ logo: z.ZodObject<{
178
+ url: z.ZodString;
179
+ alt_text: z.ZodString;
180
+ }, "strip", z.ZodTypeAny, {
181
+ url: string;
182
+ alt_text: string;
183
+ }, {
184
+ url: string;
185
+ alt_text: string;
186
+ }>;
187
+ background_color: z.ZodString;
188
+ text_color: z.ZodString;
189
+ }, "strip", z.ZodTypeAny, {
190
+ name: string;
191
+ locale: string;
192
+ logo: {
193
+ url: string;
194
+ alt_text: string;
195
+ };
196
+ background_color: string;
197
+ text_color: string;
198
+ }, {
199
+ name: string;
200
+ locale: string;
201
+ logo: {
202
+ url: string;
203
+ alt_text: string;
204
+ };
205
+ background_color: string;
206
+ text_color: string;
207
+ }>, "many">;
208
+ }, "strip", z.ZodTypeAny, {
209
+ format: "vc+sd-jwt";
210
+ cryptographic_binding_methods_supported: string[];
211
+ cryptographic_suites_supported: string[];
212
+ display: {
213
+ name: string;
214
+ locale: string;
215
+ logo: {
216
+ url: string;
217
+ alt_text: string;
218
+ };
219
+ background_color: string;
220
+ text_color: string;
221
+ }[];
222
+ }, {
223
+ format: "vc+sd-jwt";
224
+ cryptographic_binding_methods_supported: string[];
225
+ cryptographic_suites_supported: string[];
226
+ display: {
227
+ name: string;
228
+ locale: string;
229
+ logo: {
230
+ url: string;
231
+ alt_text: string;
232
+ };
233
+ background_color: string;
234
+ text_color: string;
235
+ }[];
236
+ }>;
237
+ }, "strip", z.ZodTypeAny, {
238
+ "eu.eudiw.pid.it": {
239
+ format: "vc+sd-jwt";
240
+ cryptographic_binding_methods_supported: string[];
241
+ cryptographic_suites_supported: string[];
242
+ display: {
243
+ name: string;
244
+ locale: string;
245
+ logo: {
246
+ url: string;
247
+ alt_text: string;
248
+ };
249
+ background_color: string;
250
+ text_color: string;
251
+ }[];
252
+ };
253
+ }, {
254
+ "eu.eudiw.pid.it": {
255
+ format: "vc+sd-jwt";
256
+ cryptographic_binding_methods_supported: string[];
257
+ cryptographic_suites_supported: string[];
258
+ display: {
259
+ name: string;
260
+ locale: string;
261
+ logo: {
262
+ url: string;
263
+ alt_text: string;
264
+ };
265
+ background_color: string;
266
+ text_color: string;
267
+ }[];
268
+ };
269
+ }>;
270
+ }, "strip", z.ZodTypeAny, {
271
+ credential_issuer: string;
272
+ authorization_endpoint: string;
273
+ token_endpoint: string;
274
+ pushed_authorization_request_endpoint: string;
275
+ dpop_signing_alg_values_supported: string[];
276
+ credential_endpoint: string;
277
+ credentials_supported: {
278
+ "eu.eudiw.pid.it": {
279
+ format: "vc+sd-jwt";
280
+ cryptographic_binding_methods_supported: string[];
281
+ cryptographic_suites_supported: string[];
282
+ display: {
283
+ name: string;
284
+ locale: string;
285
+ logo: {
286
+ url: string;
287
+ alt_text: string;
288
+ };
289
+ background_color: string;
290
+ text_color: string;
291
+ }[];
292
+ };
293
+ };
294
+ }, {
295
+ credential_issuer: string;
296
+ authorization_endpoint: string;
297
+ token_endpoint: string;
298
+ pushed_authorization_request_endpoint: string;
299
+ dpop_signing_alg_values_supported: string[];
300
+ credential_endpoint: string;
301
+ credentials_supported: {
302
+ "eu.eudiw.pid.it": {
303
+ format: "vc+sd-jwt";
304
+ cryptographic_binding_methods_supported: string[];
305
+ cryptographic_suites_supported: string[];
306
+ display: {
307
+ name: string;
308
+ locale: string;
309
+ logo: {
310
+ url: string;
311
+ alt_text: string;
312
+ };
313
+ background_color: string;
314
+ text_color: string;
315
+ }[];
316
+ };
317
+ };
318
+ }>;
319
+ federation_entity: z.ZodObject<{
320
+ organization_name: z.ZodString;
321
+ homepage_uri: z.ZodString;
322
+ policy_uri: z.ZodString;
323
+ tos_uri: z.ZodString;
324
+ logo_uri: z.ZodString;
325
+ }, "strip", z.ZodTypeAny, {
326
+ organization_name: string;
327
+ homepage_uri: string;
328
+ policy_uri: string;
329
+ tos_uri: string;
330
+ logo_uri: string;
331
+ }, {
332
+ organization_name: string;
333
+ homepage_uri: string;
334
+ policy_uri: string;
335
+ tos_uri: string;
336
+ logo_uri: string;
337
+ }>;
338
+ }, "strip", z.ZodTypeAny, {
339
+ openid_credential_issuer: {
340
+ credential_issuer: string;
341
+ authorization_endpoint: string;
342
+ token_endpoint: string;
343
+ pushed_authorization_request_endpoint: string;
344
+ dpop_signing_alg_values_supported: string[];
345
+ credential_endpoint: string;
346
+ credentials_supported: {
347
+ "eu.eudiw.pid.it": {
348
+ format: "vc+sd-jwt";
349
+ cryptographic_binding_methods_supported: string[];
350
+ cryptographic_suites_supported: string[];
351
+ display: {
352
+ name: string;
353
+ locale: string;
354
+ logo: {
355
+ url: string;
356
+ alt_text: string;
357
+ };
358
+ background_color: string;
359
+ text_color: string;
360
+ }[];
361
+ };
362
+ };
363
+ };
364
+ federation_entity: {
365
+ organization_name: string;
366
+ homepage_uri: string;
367
+ policy_uri: string;
368
+ tos_uri: string;
369
+ logo_uri: string;
370
+ };
371
+ }, {
372
+ openid_credential_issuer: {
373
+ credential_issuer: string;
374
+ authorization_endpoint: string;
375
+ token_endpoint: string;
376
+ pushed_authorization_request_endpoint: string;
377
+ dpop_signing_alg_values_supported: string[];
378
+ credential_endpoint: string;
379
+ credentials_supported: {
380
+ "eu.eudiw.pid.it": {
381
+ format: "vc+sd-jwt";
382
+ cryptographic_binding_methods_supported: string[];
383
+ cryptographic_suites_supported: string[];
384
+ display: {
385
+ name: string;
386
+ locale: string;
387
+ logo: {
388
+ url: string;
389
+ alt_text: string;
390
+ };
391
+ background_color: string;
392
+ text_color: string;
393
+ }[];
394
+ };
395
+ };
396
+ };
397
+ federation_entity: {
398
+ organization_name: string;
399
+ homepage_uri: string;
400
+ policy_uri: string;
401
+ tos_uri: string;
402
+ logo_uri: string;
403
+ };
404
+ }>;
405
+ }, "strip", z.ZodTypeAny, {
406
+ jwks: {
407
+ keys: {
408
+ kty: "RSA" | "EC";
409
+ alg?: string | undefined;
410
+ crv?: string | undefined;
411
+ d?: string | undefined;
412
+ dp?: string | undefined;
413
+ dq?: string | undefined;
414
+ e?: string | undefined;
415
+ ext?: boolean | undefined;
416
+ k?: string | undefined;
417
+ key_ops?: string[] | undefined;
418
+ kid?: string | undefined;
419
+ n?: string | undefined;
420
+ p?: string | undefined;
421
+ q?: string | undefined;
422
+ qi?: string | undefined;
423
+ use?: string | undefined;
424
+ x?: string | undefined;
425
+ y?: string | undefined;
426
+ x5c?: string[] | undefined;
427
+ x5t?: string | undefined;
428
+ "x5t#S256"?: string | undefined;
429
+ x5u?: string | undefined;
430
+ }[];
431
+ };
432
+ metadata: {
433
+ openid_credential_issuer: {
434
+ credential_issuer: string;
435
+ authorization_endpoint: string;
436
+ token_endpoint: string;
437
+ pushed_authorization_request_endpoint: string;
438
+ dpop_signing_alg_values_supported: string[];
439
+ credential_endpoint: string;
440
+ credentials_supported: {
441
+ "eu.eudiw.pid.it": {
442
+ format: "vc+sd-jwt";
443
+ cryptographic_binding_methods_supported: string[];
444
+ cryptographic_suites_supported: string[];
445
+ display: {
446
+ name: string;
447
+ locale: string;
448
+ logo: {
449
+ url: string;
450
+ alt_text: string;
451
+ };
452
+ background_color: string;
453
+ text_color: string;
454
+ }[];
455
+ };
456
+ };
457
+ };
458
+ federation_entity: {
459
+ organization_name: string;
460
+ homepage_uri: string;
461
+ policy_uri: string;
462
+ tos_uri: string;
463
+ logo_uri: string;
464
+ };
465
+ };
466
+ }, {
467
+ jwks: {
468
+ keys: {
469
+ kty: "RSA" | "EC";
470
+ alg?: string | undefined;
471
+ crv?: string | undefined;
472
+ d?: string | undefined;
473
+ dp?: string | undefined;
474
+ dq?: string | undefined;
475
+ e?: string | undefined;
476
+ ext?: boolean | undefined;
477
+ k?: string | undefined;
478
+ key_ops?: string[] | undefined;
479
+ kid?: string | undefined;
480
+ n?: string | undefined;
481
+ p?: string | undefined;
482
+ q?: string | undefined;
483
+ qi?: string | undefined;
484
+ use?: string | undefined;
485
+ x?: string | undefined;
486
+ y?: string | undefined;
487
+ x5c?: string[] | undefined;
488
+ x5t?: string | undefined;
489
+ "x5t#S256"?: string | undefined;
490
+ x5u?: string | undefined;
491
+ }[];
492
+ };
493
+ metadata: {
494
+ openid_credential_issuer: {
495
+ credential_issuer: string;
496
+ authorization_endpoint: string;
497
+ token_endpoint: string;
498
+ pushed_authorization_request_endpoint: string;
499
+ dpop_signing_alg_values_supported: string[];
500
+ credential_endpoint: string;
501
+ credentials_supported: {
502
+ "eu.eudiw.pid.it": {
503
+ format: "vc+sd-jwt";
504
+ cryptographic_binding_methods_supported: string[];
505
+ cryptographic_suites_supported: string[];
506
+ display: {
507
+ name: string;
508
+ locale: string;
509
+ logo: {
510
+ url: string;
511
+ alt_text: string;
512
+ };
513
+ background_color: string;
514
+ text_color: string;
515
+ }[];
516
+ };
517
+ };
518
+ };
519
+ federation_entity: {
520
+ organization_name: string;
521
+ homepage_uri: string;
522
+ policy_uri: string;
523
+ tos_uri: string;
524
+ logo_uri: string;
525
+ };
526
+ };
527
+ }>;
528
+ //# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../src/pid/metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACpE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS7B,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,4BAA4B,CACpC,CAAC;AACF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BvC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"converters.d.ts","sourceRoot":"","sources":["../../../../../src/pid/sd-jwt/converters.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAE9B,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,GAAG,CAqB5E"}
@@ -37,7 +37,7 @@ export declare function decode(token: string): PidWithToken;
37
37
  *
38
38
  */
39
39
  export declare function verify(token: string): Promise<VerifyResult>;
40
- type PidWithToken = {
40
+ export type PidWithToken = {
41
41
  pid: PID;
42
42
  sdJwt: SdJwt4VC;
43
43
  disclosures: Disclosure[];
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/pid/sd-jwt/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CASlD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAMjE;AAED,MAAM,MAAM,YAAY,GAAG;IAEzB,GAAG,EAAE,GAAG,CAAC;IAET,KAAK,EAAE,QAAQ,CAAC;IAEhB,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC;AAExC,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/pid/sd-jwt/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB;;;;;GAKG;AACH,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;AACtC,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBd,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../../src/rp/__test__/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,89 @@
1
+ import { QRCodePayload, RequestObject, RpEntityConfiguration, type Presentation } from "./types";
2
+ import type { JWK } from "@pagopa/io-react-native-jwt/lib/typescript/types";
3
+ export declare class RelyingPartySolution {
4
+ relyingPartyBaseUrl: string;
5
+ walletInstanceAttestation: string;
6
+ appFetch: GlobalFetch["fetch"];
7
+ constructor(relyingPartyBaseUrl: string, walletInstanceAttestation: string, appFetch?: GlobalFetch["fetch"]);
8
+ /**
9
+ * Decode a QR code content to an authentication request url.
10
+ * @function
11
+ * @param qrcode QR code content
12
+ *
13
+ * @returns The authentication request url
14
+ *
15
+ */
16
+ static decodeAuthRequestQR(qrcode: string): QRCodePayload;
17
+ /**
18
+ * Obtain the unsigned wallet instance DPoP for authentication request
19
+ *
20
+ * @function
21
+ * @param walletInstanceAttestationJwk JWT of the Wallet Instance Attestation
22
+ * @param authRequestUrl authentication request url
23
+ *
24
+ * @returns The unsigned wallet instance DPoP
25
+ *
26
+ */
27
+ getUnsignedWalletInstanceDPoP(walletInstanceAttestationJwk: JWK, authRequestUrl: string): Promise<string>;
28
+ /**
29
+ * Obtain the Request Object for RP authentication
30
+ * @see https://italia.github.io/eudi-wallet-it-docs/versione-corrente/en/relying-party-solution.html
31
+ *
32
+ * @async @function
33
+ * @param signedWalletInstanceDPoP JWT of the Wallet Instance Attestation DPoP
34
+ *
35
+ * @returns The Request Object JWT
36
+ * @throws {NoSuitableKeysFoundInEntityConfiguration} When the Request Object is signed with a key not listed in RP's entity configuration
37
+ *
38
+ */
39
+ getRequestObject(signedWalletInstanceDPoP: string, entity: RpEntityConfiguration): Promise<RequestObject>;
40
+ /**
41
+ * Prepare the Verified Presentation token for a received request object in the context of an authorization request flow.
42
+ * The presentation is prepared by disclosing data from provided credentials, according to requested claims
43
+ * Each Verified Credential come along with the claims the user accepts to disclose from it.
44
+ *
45
+ * The returned token is unsigned (sign should be apply by the caller).
46
+ *
47
+ * @todo accept more than a Verified Credential
48
+ *
49
+ * @param requestObj The incoming request object, which the requirements for the requested authorization
50
+ * @param presentation The Verified Credential containing user data along with the list of claims to be disclosed.
51
+ * @returns The unsigned Verified Presentation token
52
+ * @throws {ClaimsNotFoundBetweenDislosures} If the Verified Credential does not contain one or more requested claims.
53
+ *
54
+ */
55
+ prepareVpToken(requestObj: RequestObject, [vc, claims]: Presentation): Promise<{
56
+ vp_token: string;
57
+ presentation_submission: Record<string, unknown>;
58
+ }>;
59
+ /**
60
+ * Compose and send an Authorization Response in the context of an authorization request flow.
61
+ *
62
+ * @todo MUST add presentation_submission
63
+ *
64
+ * @param requestObj The incoming request object, which the requirements for the requested authorization
65
+ * @param vp_token The signed Verified Presentation token with data to send.
66
+ * @param presentation_submission
67
+ * @param entity The RP entity configuration
68
+ * @returns The response from the RP
69
+ * @throws {IoWalletError} if the submission fails.
70
+ * @throws {NoSuitableKeysFoundInEntityConfiguration} If entity do not contain any public key
71
+ *
72
+ */
73
+ sendAuthorizationResponse(requestObj: RequestObject, vp_token: string, presentation_submission: Record<string, unknown>, entity: RpEntityConfiguration): Promise<string>;
74
+ /**
75
+ * Select a public key from those provided by the RP.
76
+ * Keys with algorithm "RSA-OAEP-256" or "RSA-OAEP" are expected, the firsts to be preferred.
77
+ *
78
+ * @param entity The RP entity configuration
79
+ * @returns A suitable public key with its compatible encryption algorithm
80
+ * @throws {NoSuitableKeysFoundInEntityConfiguration} If entity do not contain any public key suitable for encrypting
81
+ */
82
+ private choosePublicKeyToEncrypt;
83
+ private getEncryptionAlgByJwk;
84
+ /**
85
+ * Obtain the relying party entity configuration.
86
+ */
87
+ getEntityConfiguration(): Promise<RpEntityConfiguration>;
88
+ }
89
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rp/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,KAAK,YAAY,EAClB,MAAM,SAAS,CAAC;AAGjB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kDAAkD,CAAC;AAG5E,qBAAa,oBAAoB;IAC/B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,yBAAyB,EAAE,MAAM,CAAC;IAClC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;gBAG7B,mBAAmB,EAAE,MAAM,EAC3B,yBAAyB,EAAE,MAAM,EACjC,QAAQ,GAAE,WAAW,CAAC,OAAO,CAAS;IAOxC;;;;;;;OAOG;IACH,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa;IAqBzD;;;;;;;;;OASG;IACG,6BAA6B,CACjC,4BAA4B,EAAE,GAAG,EACjC,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,MAAM,CAAC;IAiBlB;;;;;;;;;;OAUG;IACG,gBAAgB,CACpB,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,aAAa,CAAC;IA2CzB;;;;;;;;;;;;;;OAcG;IACG,cAAc,CAClB,UAAU,EAAE,aAAa,EACzB,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,YAAY,GACzB,OAAO,CAAC;QACT,QAAQ,EAAE,MAAM,CAAC;QACjB,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClD,CAAC;IA6BF;;;;;;;;;;;;;OAaG;IACG,yBAAyB,CAC7B,UAAU,EAAE,aAAa,EACzB,QAAQ,EAAE,MAAM,EAChB,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChD,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,MAAM,CAAC;IAkClB;;;;;;;OAOG;IACH,OAAO,CAAC,wBAAwB;IA6BhC,OAAO,CAAC,qBAAqB;IAY7B;;OAEG;IACG,sBAAsB,IAAI,OAAO,CAAC,qBAAqB,CAAC;CAuB/D"}