@pagopa/io-react-native-wallet 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/README.md +91 -0
  2. package/lib/commonjs/index.js +17 -0
  3. package/lib/commonjs/index.js.map +1 -0
  4. package/lib/commonjs/pid/index.js +11 -0
  5. package/lib/commonjs/pid/index.js.map +1 -0
  6. package/lib/commonjs/pid/sd-jwt/converters.js +29 -0
  7. package/lib/commonjs/pid/sd-jwt/converters.js.map +1 -0
  8. package/lib/commonjs/pid/sd-jwt/index.js +76 -0
  9. package/lib/commonjs/pid/sd-jwt/index.js.map +1 -0
  10. package/lib/commonjs/pid/sd-jwt/types.js +50 -0
  11. package/lib/commonjs/pid/sd-jwt/types.js.map +1 -0
  12. package/lib/commonjs/sd-jwt/__test__/converters.test.js +25 -0
  13. package/lib/commonjs/sd-jwt/__test__/converters.test.js.map +1 -0
  14. package/lib/commonjs/sd-jwt/__test__/types.test.js +70 -0
  15. package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -0
  16. package/lib/commonjs/sd-jwt/converters.js +30 -0
  17. package/lib/commonjs/sd-jwt/converters.js.map +1 -0
  18. package/lib/commonjs/sd-jwt/index.js +77 -0
  19. package/lib/commonjs/sd-jwt/index.js.map +1 -0
  20. package/lib/commonjs/sd-jwt/types.js +53 -0
  21. package/lib/commonjs/sd-jwt/types.js.map +1 -0
  22. package/lib/commonjs/sd-jwt/verifier.js +18 -0
  23. package/lib/commonjs/sd-jwt/verifier.js.map +1 -0
  24. package/lib/commonjs/utils/errors.js +82 -0
  25. package/lib/commonjs/utils/errors.js.map +1 -0
  26. package/lib/commonjs/utils/jwk.js +45 -0
  27. package/lib/commonjs/utils/jwk.js.map +1 -0
  28. package/lib/commonjs/wallet-instance-attestation/index.js +63 -0
  29. package/lib/commonjs/wallet-instance-attestation/index.js.map +1 -0
  30. package/lib/commonjs/wallet-instance-attestation/issuing.js +96 -0
  31. package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -0
  32. package/lib/commonjs/wallet-instance-attestation/types.js +65 -0
  33. package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -0
  34. package/lib/module/index.js +7 -0
  35. package/lib/module/index.js.map +1 -0
  36. package/lib/module/pid/index.js +3 -0
  37. package/lib/module/pid/index.js.map +1 -0
  38. package/lib/module/pid/sd-jwt/converters.js +23 -0
  39. package/lib/module/pid/sd-jwt/converters.js.map +1 -0
  40. package/lib/module/pid/sd-jwt/index.js +66 -0
  41. package/lib/module/pid/sd-jwt/index.js.map +1 -0
  42. package/lib/module/pid/sd-jwt/types.js +43 -0
  43. package/lib/module/pid/sd-jwt/types.js.map +1 -0
  44. package/lib/module/sd-jwt/__test__/converters.test.js +23 -0
  45. package/lib/module/sd-jwt/__test__/converters.test.js.map +1 -0
  46. package/lib/module/sd-jwt/__test__/types.test.js +68 -0
  47. package/lib/module/sd-jwt/__test__/types.test.js.map +1 -0
  48. package/lib/module/sd-jwt/converters.js +24 -0
  49. package/lib/module/sd-jwt/converters.js.map +1 -0
  50. package/lib/module/sd-jwt/index.js +71 -0
  51. package/lib/module/sd-jwt/index.js.map +1 -0
  52. package/lib/module/sd-jwt/types.js +44 -0
  53. package/lib/module/sd-jwt/types.js.map +1 -0
  54. package/lib/module/sd-jwt/verifier.js +11 -0
  55. package/lib/module/sd-jwt/verifier.js.map +1 -0
  56. package/lib/module/utils/errors.js +73 -0
  57. package/lib/module/utils/errors.js.map +1 -0
  58. package/lib/module/utils/jwk.js +38 -0
  59. package/lib/module/utils/jwk.js.map +1 -0
  60. package/lib/module/wallet-instance-attestation/index.js +52 -0
  61. package/lib/module/wallet-instance-attestation/index.js.map +1 -0
  62. package/lib/module/wallet-instance-attestation/issuing.js +90 -0
  63. package/lib/module/wallet-instance-attestation/issuing.js.map +1 -0
  64. package/lib/module/wallet-instance-attestation/types.js +55 -0
  65. package/lib/module/wallet-instance-attestation/types.js.map +1 -0
  66. package/lib/typescript/index.d.ts +5 -0
  67. package/lib/typescript/index.d.ts.map +1 -0
  68. package/lib/typescript/pid/index.d.ts +3 -0
  69. package/lib/typescript/pid/index.d.ts.map +1 -0
  70. package/lib/typescript/pid/sd-jwt/converters.d.ts +4 -0
  71. package/lib/typescript/pid/sd-jwt/converters.d.ts.map +1 -0
  72. package/lib/typescript/pid/sd-jwt/index.d.ts +50 -0
  73. package/lib/typescript/pid/sd-jwt/index.d.ts.map +1 -0
  74. package/lib/typescript/pid/sd-jwt/types.d.ts +196 -0
  75. package/lib/typescript/pid/sd-jwt/types.d.ts.map +1 -0
  76. package/lib/typescript/sd-jwt/__test__/converters.test.d.ts +2 -0
  77. package/lib/typescript/sd-jwt/__test__/converters.test.d.ts.map +1 -0
  78. package/lib/typescript/sd-jwt/__test__/types.test.d.ts +2 -0
  79. package/lib/typescript/sd-jwt/__test__/types.test.d.ts.map +1 -0
  80. package/lib/typescript/sd-jwt/converters.d.ts +3 -0
  81. package/lib/typescript/sd-jwt/converters.d.ts.map +1 -0
  82. package/lib/typescript/sd-jwt/index.d.ts +42 -0
  83. package/lib/typescript/sd-jwt/index.d.ts.map +1 -0
  84. package/lib/typescript/sd-jwt/types.d.ts +416 -0
  85. package/lib/typescript/sd-jwt/types.d.ts.map +1 -0
  86. package/lib/typescript/sd-jwt/verifier.d.ts +3 -0
  87. package/lib/typescript/sd-jwt/verifier.d.ts.map +1 -0
  88. package/lib/typescript/utils/errors.d.ts +45 -0
  89. package/lib/typescript/utils/errors.d.ts.map +1 -0
  90. package/lib/typescript/utils/jwk.d.ts +85 -0
  91. package/lib/typescript/utils/jwk.d.ts.map +1 -0
  92. package/lib/typescript/wallet-instance-attestation/index.d.ts +36 -0
  93. package/lib/typescript/wallet-instance-attestation/index.d.ts.map +1 -0
  94. package/lib/typescript/wallet-instance-attestation/issuing.d.ts +32 -0
  95. package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -0
  96. package/lib/typescript/wallet-instance-attestation/types.d.ts +733 -0
  97. package/lib/typescript/wallet-instance-attestation/types.d.ts.map +1 -0
  98. package/package.json +108 -0
  99. package/src/index.ts +8 -0
  100. package/src/pid/index.ts +2 -0
  101. package/src/pid/sd-jwt/converters.ts +26 -0
  102. package/src/pid/sd-jwt/index.ts +71 -0
  103. package/src/pid/sd-jwt/types.ts +44 -0
  104. package/src/sd-jwt/__test__/converters.test.ts +27 -0
  105. package/src/sd-jwt/__test__/types.test.ts +85 -0
  106. package/src/sd-jwt/converters.ts +24 -0
  107. package/src/sd-jwt/index.ts +92 -0
  108. package/src/sd-jwt/types.ts +54 -0
  109. package/src/sd-jwt/verifier.ts +20 -0
  110. package/src/utils/errors.ts +74 -0
  111. package/src/utils/jwk.ts +39 -0
  112. package/src/wallet-instance-attestation/index.ts +56 -0
  113. package/src/wallet-instance-attestation/issuing.ts +107 -0
  114. package/src/wallet-instance-attestation/types.ts +77 -0
@@ -0,0 +1,416 @@
1
+ import { z } from "zod";
2
+ export declare const UnixTime: z.ZodNumber;
3
+ export type UnixTime = z.infer<typeof UnixTime>;
4
+ export type ObfuscatedDisclosures = z.infer<typeof ObfuscatedDisclosures>;
5
+ export declare const ObfuscatedDisclosures: z.ZodObject<{
6
+ _sd: z.ZodArray<z.ZodString, "many">;
7
+ }, "strip", z.ZodTypeAny, {
8
+ _sd: string[];
9
+ }, {
10
+ _sd: string[];
11
+ }>;
12
+ /**
13
+ * A triple of values in the form of {salt, claim name, claim value} that represent a parsed disclosure.
14
+ *
15
+ * @see https://datatracker.ietf.org/doc/html/draft-ietf-oauth-selective-disclosure-jwt-04
16
+ * @see https://vcstuff.github.io/draft-terbu-sd-jwt-vc/draft-terbu-oauth-sd-jwt-vc.html
17
+ */
18
+ export type Disclosure = z.infer<typeof Disclosure>;
19
+ export declare const Disclosure: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodUnknown], null>;
20
+ export type SdJwt4VC = z.infer<typeof SdJwt4VC>;
21
+ export declare const SdJwt4VC: z.ZodObject<{
22
+ header: z.ZodObject<{
23
+ typ: z.ZodLiteral<"vc+sd-jwt">;
24
+ alg: z.ZodString;
25
+ kid: z.ZodString;
26
+ trust_chain: z.ZodArray<z.ZodString, "many">;
27
+ }, "strip", z.ZodTypeAny, {
28
+ alg: string;
29
+ kid: string;
30
+ typ: "vc+sd-jwt";
31
+ trust_chain: string[];
32
+ }, {
33
+ alg: string;
34
+ kid: string;
35
+ typ: "vc+sd-jwt";
36
+ trust_chain: string[];
37
+ }>;
38
+ payload: z.ZodObject<{
39
+ iss: z.ZodString;
40
+ sub: z.ZodString;
41
+ jti: z.ZodString;
42
+ iat: z.ZodNumber;
43
+ exp: z.ZodNumber;
44
+ status: z.ZodString;
45
+ cnf: z.ZodObject<{
46
+ jwk: z.ZodObject<{
47
+ alg: z.ZodOptional<z.ZodString>;
48
+ crv: z.ZodOptional<z.ZodString>;
49
+ d: z.ZodOptional<z.ZodString>;
50
+ dp: z.ZodOptional<z.ZodString>;
51
+ dq: z.ZodOptional<z.ZodString>;
52
+ e: z.ZodOptional<z.ZodString>;
53
+ ext: z.ZodOptional<z.ZodBoolean>;
54
+ k: z.ZodOptional<z.ZodString>;
55
+ key_ops: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
56
+ kid: z.ZodOptional<z.ZodString>;
57
+ kty: z.ZodUnion<[z.ZodLiteral<"RSA">, z.ZodLiteral<"EC">]>;
58
+ n: z.ZodOptional<z.ZodString>;
59
+ p: z.ZodOptional<z.ZodString>;
60
+ q: z.ZodOptional<z.ZodString>;
61
+ qi: z.ZodOptional<z.ZodString>;
62
+ use: z.ZodOptional<z.ZodString>;
63
+ x: z.ZodOptional<z.ZodString>;
64
+ y: z.ZodOptional<z.ZodString>;
65
+ x5c: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
66
+ x5t: z.ZodOptional<z.ZodString>;
67
+ "x5t#S256": z.ZodOptional<z.ZodString>;
68
+ x5u: z.ZodOptional<z.ZodString>;
69
+ }, "strip", z.ZodTypeAny, {
70
+ kty: "RSA" | "EC";
71
+ alg?: string | undefined;
72
+ crv?: string | undefined;
73
+ d?: string | undefined;
74
+ dp?: string | undefined;
75
+ dq?: string | undefined;
76
+ e?: string | undefined;
77
+ ext?: boolean | undefined;
78
+ k?: string | undefined;
79
+ key_ops?: string[] | undefined;
80
+ kid?: string | undefined;
81
+ n?: string | undefined;
82
+ p?: string | undefined;
83
+ q?: string | undefined;
84
+ qi?: string | undefined;
85
+ use?: string | undefined;
86
+ x?: string | undefined;
87
+ y?: string | undefined;
88
+ x5c?: string[] | undefined;
89
+ x5t?: string | undefined;
90
+ "x5t#S256"?: string | undefined;
91
+ x5u?: string | undefined;
92
+ }, {
93
+ kty: "RSA" | "EC";
94
+ alg?: string | undefined;
95
+ crv?: string | undefined;
96
+ d?: string | undefined;
97
+ dp?: string | undefined;
98
+ dq?: string | undefined;
99
+ e?: string | undefined;
100
+ ext?: boolean | undefined;
101
+ k?: string | undefined;
102
+ key_ops?: string[] | undefined;
103
+ kid?: string | undefined;
104
+ n?: string | undefined;
105
+ p?: string | undefined;
106
+ q?: string | undefined;
107
+ qi?: string | undefined;
108
+ use?: string | undefined;
109
+ x?: string | undefined;
110
+ y?: string | undefined;
111
+ x5c?: string[] | undefined;
112
+ x5t?: string | undefined;
113
+ "x5t#S256"?: string | undefined;
114
+ x5u?: string | undefined;
115
+ }>;
116
+ }, "strip", z.ZodTypeAny, {
117
+ jwk: {
118
+ kty: "RSA" | "EC";
119
+ alg?: string | undefined;
120
+ crv?: string | undefined;
121
+ d?: string | undefined;
122
+ dp?: string | undefined;
123
+ dq?: string | undefined;
124
+ e?: string | undefined;
125
+ ext?: boolean | undefined;
126
+ k?: string | undefined;
127
+ key_ops?: string[] | undefined;
128
+ kid?: string | undefined;
129
+ n?: string | undefined;
130
+ p?: string | undefined;
131
+ q?: string | undefined;
132
+ qi?: string | undefined;
133
+ use?: string | undefined;
134
+ x?: string | undefined;
135
+ y?: string | undefined;
136
+ x5c?: string[] | undefined;
137
+ x5t?: string | undefined;
138
+ "x5t#S256"?: string | undefined;
139
+ x5u?: string | undefined;
140
+ };
141
+ }, {
142
+ jwk: {
143
+ kty: "RSA" | "EC";
144
+ alg?: string | undefined;
145
+ crv?: string | undefined;
146
+ d?: string | undefined;
147
+ dp?: string | undefined;
148
+ dq?: string | undefined;
149
+ e?: string | undefined;
150
+ ext?: boolean | undefined;
151
+ k?: string | undefined;
152
+ key_ops?: string[] | undefined;
153
+ kid?: string | undefined;
154
+ n?: string | undefined;
155
+ p?: string | undefined;
156
+ q?: string | undefined;
157
+ qi?: string | undefined;
158
+ use?: string | undefined;
159
+ x?: string | undefined;
160
+ y?: string | undefined;
161
+ x5c?: string[] | undefined;
162
+ x5t?: string | undefined;
163
+ "x5t#S256"?: string | undefined;
164
+ x5u?: string | undefined;
165
+ };
166
+ }>;
167
+ type: z.ZodLiteral<"PersonIdentificationData">;
168
+ verified_claims: z.ZodObject<{
169
+ verification: z.ZodIntersection<z.ZodObject<{
170
+ trust_framework: z.ZodLiteral<"eidas">;
171
+ assurance_level: z.ZodString;
172
+ }, "strip", z.ZodTypeAny, {
173
+ trust_framework: "eidas";
174
+ assurance_level: string;
175
+ }, {
176
+ trust_framework: "eidas";
177
+ assurance_level: string;
178
+ }>, z.ZodObject<{
179
+ _sd: z.ZodArray<z.ZodString, "many">;
180
+ }, "strip", z.ZodTypeAny, {
181
+ _sd: string[];
182
+ }, {
183
+ _sd: string[];
184
+ }>>;
185
+ claims: z.ZodObject<{
186
+ _sd: z.ZodArray<z.ZodString, "many">;
187
+ }, "strip", z.ZodTypeAny, {
188
+ _sd: string[];
189
+ }, {
190
+ _sd: string[];
191
+ }>;
192
+ }, "strip", z.ZodTypeAny, {
193
+ verification: {
194
+ trust_framework: "eidas";
195
+ assurance_level: string;
196
+ } & {
197
+ _sd: string[];
198
+ };
199
+ claims: {
200
+ _sd: string[];
201
+ };
202
+ }, {
203
+ verification: {
204
+ trust_framework: "eidas";
205
+ assurance_level: string;
206
+ } & {
207
+ _sd: string[];
208
+ };
209
+ claims: {
210
+ _sd: string[];
211
+ };
212
+ }>;
213
+ _sd_alg: z.ZodLiteral<"sha-256">;
214
+ }, "strip", z.ZodTypeAny, {
215
+ type: "PersonIdentificationData";
216
+ status: string;
217
+ iss: string;
218
+ sub: string;
219
+ jti: string;
220
+ iat: number;
221
+ exp: number;
222
+ cnf: {
223
+ jwk: {
224
+ kty: "RSA" | "EC";
225
+ alg?: string | undefined;
226
+ crv?: string | undefined;
227
+ d?: string | undefined;
228
+ dp?: string | undefined;
229
+ dq?: string | undefined;
230
+ e?: string | undefined;
231
+ ext?: boolean | undefined;
232
+ k?: string | undefined;
233
+ key_ops?: string[] | undefined;
234
+ kid?: string | undefined;
235
+ n?: string | undefined;
236
+ p?: string | undefined;
237
+ q?: string | undefined;
238
+ qi?: string | undefined;
239
+ use?: string | undefined;
240
+ x?: string | undefined;
241
+ y?: string | undefined;
242
+ x5c?: string[] | undefined;
243
+ x5t?: string | undefined;
244
+ "x5t#S256"?: string | undefined;
245
+ x5u?: string | undefined;
246
+ };
247
+ };
248
+ verified_claims: {
249
+ verification: {
250
+ trust_framework: "eidas";
251
+ assurance_level: string;
252
+ } & {
253
+ _sd: string[];
254
+ };
255
+ claims: {
256
+ _sd: string[];
257
+ };
258
+ };
259
+ _sd_alg: "sha-256";
260
+ }, {
261
+ type: "PersonIdentificationData";
262
+ status: string;
263
+ iss: string;
264
+ sub: string;
265
+ jti: string;
266
+ iat: number;
267
+ exp: number;
268
+ cnf: {
269
+ jwk: {
270
+ kty: "RSA" | "EC";
271
+ alg?: string | undefined;
272
+ crv?: string | undefined;
273
+ d?: string | undefined;
274
+ dp?: string | undefined;
275
+ dq?: string | undefined;
276
+ e?: string | undefined;
277
+ ext?: boolean | undefined;
278
+ k?: string | undefined;
279
+ key_ops?: string[] | undefined;
280
+ kid?: string | undefined;
281
+ n?: string | undefined;
282
+ p?: string | undefined;
283
+ q?: string | undefined;
284
+ qi?: string | undefined;
285
+ use?: string | undefined;
286
+ x?: string | undefined;
287
+ y?: string | undefined;
288
+ x5c?: string[] | undefined;
289
+ x5t?: string | undefined;
290
+ "x5t#S256"?: string | undefined;
291
+ x5u?: string | undefined;
292
+ };
293
+ };
294
+ verified_claims: {
295
+ verification: {
296
+ trust_framework: "eidas";
297
+ assurance_level: string;
298
+ } & {
299
+ _sd: string[];
300
+ };
301
+ claims: {
302
+ _sd: string[];
303
+ };
304
+ };
305
+ _sd_alg: "sha-256";
306
+ }>;
307
+ }, "strip", z.ZodTypeAny, {
308
+ header: {
309
+ alg: string;
310
+ kid: string;
311
+ typ: "vc+sd-jwt";
312
+ trust_chain: string[];
313
+ };
314
+ payload: {
315
+ type: "PersonIdentificationData";
316
+ status: string;
317
+ iss: string;
318
+ sub: string;
319
+ jti: string;
320
+ iat: number;
321
+ exp: number;
322
+ cnf: {
323
+ jwk: {
324
+ kty: "RSA" | "EC";
325
+ alg?: string | undefined;
326
+ crv?: string | undefined;
327
+ d?: string | undefined;
328
+ dp?: string | undefined;
329
+ dq?: string | undefined;
330
+ e?: string | undefined;
331
+ ext?: boolean | undefined;
332
+ k?: string | undefined;
333
+ key_ops?: string[] | undefined;
334
+ kid?: string | undefined;
335
+ n?: string | undefined;
336
+ p?: string | undefined;
337
+ q?: string | undefined;
338
+ qi?: string | undefined;
339
+ use?: string | undefined;
340
+ x?: string | undefined;
341
+ y?: string | undefined;
342
+ x5c?: string[] | undefined;
343
+ x5t?: string | undefined;
344
+ "x5t#S256"?: string | undefined;
345
+ x5u?: string | undefined;
346
+ };
347
+ };
348
+ verified_claims: {
349
+ verification: {
350
+ trust_framework: "eidas";
351
+ assurance_level: string;
352
+ } & {
353
+ _sd: string[];
354
+ };
355
+ claims: {
356
+ _sd: string[];
357
+ };
358
+ };
359
+ _sd_alg: "sha-256";
360
+ };
361
+ }, {
362
+ header: {
363
+ alg: string;
364
+ kid: string;
365
+ typ: "vc+sd-jwt";
366
+ trust_chain: string[];
367
+ };
368
+ payload: {
369
+ type: "PersonIdentificationData";
370
+ status: string;
371
+ iss: string;
372
+ sub: string;
373
+ jti: string;
374
+ iat: number;
375
+ exp: number;
376
+ cnf: {
377
+ jwk: {
378
+ kty: "RSA" | "EC";
379
+ alg?: string | undefined;
380
+ crv?: string | undefined;
381
+ d?: string | undefined;
382
+ dp?: string | undefined;
383
+ dq?: string | undefined;
384
+ e?: string | undefined;
385
+ ext?: boolean | undefined;
386
+ k?: string | undefined;
387
+ key_ops?: string[] | undefined;
388
+ kid?: string | undefined;
389
+ n?: string | undefined;
390
+ p?: string | undefined;
391
+ q?: string | undefined;
392
+ qi?: string | undefined;
393
+ use?: string | undefined;
394
+ x?: string | undefined;
395
+ y?: string | undefined;
396
+ x5c?: string[] | undefined;
397
+ x5t?: string | undefined;
398
+ "x5t#S256"?: string | undefined;
399
+ x5u?: string | undefined;
400
+ };
401
+ };
402
+ verified_claims: {
403
+ verification: {
404
+ trust_framework: "eidas";
405
+ assurance_level: string;
406
+ } & {
407
+ _sd: string[];
408
+ };
409
+ claims: {
410
+ _sd: string[];
411
+ };
412
+ };
413
+ _sd_alg: "sha-256";
414
+ };
415
+ }>;
416
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +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,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BnB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ObfuscatedDisclosures } from "./types";
2
+ export declare const verifyDisclosure: (disclosure: [string, string, unknown], claims: ObfuscatedDisclosures["_sd"]) => Promise<void>;
3
+ //# sourceMappingURL=verifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifier.d.ts","sourceRoot":"","sources":["../../../src/sd-jwt/verifier.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAc,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEjE,eAAO,MAAM,gBAAgB,kDAEnB,qBAAqB,CAAC,KAAK,CAAC,kBAYrC,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * A generic Error that all other io-wallet specific Error subclasses extend.
3
+ *
4
+ * @example Checking thrown error is a io-wallet one
5
+ *
6
+ * ```js
7
+ * if (err instanceof errors.IoWalletError) {
8
+ * // ...
9
+ * }
10
+ * ```
11
+ */
12
+ export declare class IoWalletError extends Error {
13
+ /** A unique error code for the particular error subclass. */
14
+ static get code(): string;
15
+ /** A unique error code for the particular error subclass. */
16
+ code: string;
17
+ constructor(message?: string);
18
+ }
19
+ /**
20
+ * An error subclass thrown when validation fail
21
+ *
22
+ */
23
+ export declare class ValidationFailed extends IoWalletError {
24
+ static get code(): "ERR_IO_WALLET_VALIDATION_FAILED";
25
+ code: string;
26
+ /** The Claim for which the validation failed. */
27
+ claim: string;
28
+ /** Reason code for the validation failure. */
29
+ reason: string;
30
+ constructor(message: string, claim?: string, reason?: string);
31
+ }
32
+ /**
33
+ * An error subclass thrown when validation fail
34
+ *
35
+ */
36
+ export declare class WalletInstanceAttestationIssuingError extends IoWalletError {
37
+ static get code(): "ERR_IO_WALLET_INSTANCE_ATTESTATION_ISSUING_FAILED";
38
+ code: string;
39
+ /** The Claim for which the validation failed. */
40
+ claim: string;
41
+ /** Reason code for the validation failure. */
42
+ reason: string;
43
+ constructor(message: string, claim?: string, reason?: string);
44
+ }
45
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,6DAA6D;IAC7D,MAAM,KAAK,IAAI,IAAI,MAAM,CAExB;IAED,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAA2B;gBAE3B,OAAO,CAAC,EAAE,MAAM;CAM7B;AACD;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,MAAM,KAAK,IAAI,IAAI,iCAAiC,CAEnD;IAED,IAAI,SAAqC;IAEzC,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,KAAK,SAAgB,EAAE,MAAM,SAAgB;CAK3E;AAED;;;GAGG;AACH,qBAAa,qCAAsC,SAAQ,aAAa;IACtE,MAAM,KAAK,IAAI,IAAI,mDAAmD,CAErE;IAED,IAAI,SAAuD;IAE3D,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,KAAK,SAAgB,EAAE,MAAM,SAAgB;CAK3E"}
@@ -0,0 +1,85 @@
1
+ import { z } from "zod";
2
+ export type JWK = z.infer<typeof JWK>;
3
+ export declare const JWK: z.ZodObject<{
4
+ /** JWK "alg" (Algorithm) Parameter. */
5
+ alg: z.ZodOptional<z.ZodString>;
6
+ crv: z.ZodOptional<z.ZodString>;
7
+ d: z.ZodOptional<z.ZodString>;
8
+ dp: z.ZodOptional<z.ZodString>;
9
+ dq: z.ZodOptional<z.ZodString>;
10
+ e: z.ZodOptional<z.ZodString>;
11
+ /** JWK "ext" (Extractable) Parameter. */
12
+ ext: z.ZodOptional<z.ZodBoolean>;
13
+ k: z.ZodOptional<z.ZodString>;
14
+ /** JWK "key_ops" (Key Operations) Parameter. */
15
+ key_ops: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
16
+ /** JWK "kid" (Key ID) Parameter. */
17
+ kid: z.ZodOptional<z.ZodString>;
18
+ /** JWK "kty" (Key Type) Parameter.
19
+ * This attribute is required to discriminate the
20
+ * type of EC/RSA algorithm */
21
+ kty: z.ZodUnion<[z.ZodLiteral<"RSA">, z.ZodLiteral<"EC">]>;
22
+ n: z.ZodOptional<z.ZodString>;
23
+ p: z.ZodOptional<z.ZodString>;
24
+ q: z.ZodOptional<z.ZodString>;
25
+ qi: z.ZodOptional<z.ZodString>;
26
+ /** JWK "use" (Public Key Use) Parameter. */
27
+ use: z.ZodOptional<z.ZodString>;
28
+ x: z.ZodOptional<z.ZodString>;
29
+ y: z.ZodOptional<z.ZodString>;
30
+ /** JWK "x5c" (X.509 Certificate Chain) Parameter. */
31
+ x5c: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
32
+ /** JWK "x5t" (X.509 Certificate SHA-1 Thumbprint) Parameter. */
33
+ x5t: z.ZodOptional<z.ZodString>;
34
+ /** "x5t#S256" (X.509 Certificate SHA-256 Thumbprint) Parameter. */
35
+ "x5t#S256": z.ZodOptional<z.ZodString>;
36
+ /** JWK "x5u" (X.509 URL) Parameter. */
37
+ x5u: z.ZodOptional<z.ZodString>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ kty: "RSA" | "EC";
40
+ alg?: string | undefined;
41
+ crv?: string | undefined;
42
+ d?: string | undefined;
43
+ dp?: string | undefined;
44
+ dq?: string | undefined;
45
+ e?: string | undefined;
46
+ ext?: boolean | undefined;
47
+ k?: string | undefined;
48
+ key_ops?: string[] | undefined;
49
+ kid?: string | undefined;
50
+ n?: string | undefined;
51
+ p?: string | undefined;
52
+ q?: string | undefined;
53
+ qi?: string | undefined;
54
+ use?: string | undefined;
55
+ x?: string | undefined;
56
+ y?: string | undefined;
57
+ x5c?: string[] | undefined;
58
+ x5t?: string | undefined;
59
+ "x5t#S256"?: string | undefined;
60
+ x5u?: string | undefined;
61
+ }, {
62
+ kty: "RSA" | "EC";
63
+ alg?: string | undefined;
64
+ crv?: string | undefined;
65
+ d?: string | undefined;
66
+ dp?: string | undefined;
67
+ dq?: string | undefined;
68
+ e?: string | undefined;
69
+ ext?: boolean | undefined;
70
+ k?: string | undefined;
71
+ key_ops?: string[] | undefined;
72
+ kid?: string | undefined;
73
+ n?: string | undefined;
74
+ p?: string | undefined;
75
+ q?: string | undefined;
76
+ qi?: string | undefined;
77
+ use?: string | undefined;
78
+ x?: string | undefined;
79
+ y?: string | undefined;
80
+ x5c?: string[] | undefined;
81
+ x5t?: string | undefined;
82
+ "x5t#S256"?: string | undefined;
83
+ x5u?: string | undefined;
84
+ }>;
85
+ //# sourceMappingURL=jwk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwk.d.ts","sourceRoot":"","sources":["../../../src/utils/jwk.ts"],"names":[],"mappings":"AAAA,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"}
@@ -0,0 +1,36 @@
1
+ import { WalletInstanceAttestationJwt } from "./types";
2
+ import { Issuing } from "./issuing";
3
+ export { Issuing };
4
+ /**
5
+ * Decode a given JWT to get the parsed Wallet Instance Attestation object they define.
6
+ * It ensures provided data is in a valid shape.
7
+ *
8
+ * It DOES NOT verify token signature nor check disclosures are correctly referenced by the JWT.
9
+ * Use {@link verify} instead
10
+ *
11
+ * @function
12
+ * @param token The encoded token that represents a valid jwt for Wallet Instance Attestation
13
+ *
14
+ * @returns The validated Wallet Instance Attestation object
15
+ * @throws A decoding error if the token doesn't resolve in a valid JWT
16
+ * @throws A validation error if the provided data doesn't result in a valid Wallet Instance Attestation
17
+ *
18
+ */
19
+ export declare function decode(token: string): WalletInstanceAttestationJwt;
20
+ /**
21
+ * Verify a given JWT to get the parsed Wallet Instance Attestation object they define.
22
+ * Same as {@link decode} plus token signature verification
23
+ *
24
+ * @async @function
25
+ *
26
+ *
27
+ * @param token The encoded token that represents a valid jwt
28
+ *
29
+ * @returns {WalletInstanceAttestationJwt} The validated Wallet Instance Attestation object
30
+ * @throws A decoding error if the token doesn't resolve in a valid JWT
31
+ * @throws A validation error if the provided data doesn't result in a valid Wallet Instance Attestation
32
+ * @throws Invalid signature error if the token signature is not valid
33
+ *
34
+ */
35
+ export declare function verify(token: string): Promise<WalletInstanceAttestationJwt>;
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wallet-instance-attestation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAIvD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,4BAA4B,CAQlE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,4BAA4B,CAAC,CAOvC"}
@@ -0,0 +1,32 @@
1
+ import { JWK } from "../utils/jwk";
2
+ export declare class Issuing {
3
+ walletProviderBaseUrl: string;
4
+ constructor(walletProviderBaseUrl: string);
5
+ /**
6
+ * Get the Wallet Instance Attestation Request to sign
7
+ *
8
+ * @async @function
9
+ *
10
+ * @param jwk Public key of the wallet instance
11
+ *
12
+ * @returns {string} Wallet Instance Attestation Request to sign
13
+ *
14
+ */
15
+ getAttestationRequestToSign(jwk: JWK): Promise<string>;
16
+ /**
17
+ * Get the Wallet Instance Attestation given a
18
+ * Wallet Instance Attestation Request and signature
19
+ *
20
+ * @async @function
21
+ *
22
+ * @param attestationRequest Wallet Instance Attestaion Request
23
+ * obtained with {@link getAttestationRequestToSign}
24
+ * @param signature Signature of the Wallet Instance Attestaion Request
25
+ * @param appFetch Optional object with fetch function to use
26
+ *
27
+ * @returns {string} Wallet Instance Attestation
28
+ *
29
+ */
30
+ getAttestation(attestationRequest: string, signature: string, appFetch?: GlobalFetch): Promise<String>;
31
+ }
32
+ //# sourceMappingURL=issuing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issuing.d.ts","sourceRoot":"","sources":["../../../src/wallet-instance-attestation/issuing.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAKnC,qBAAa,OAAO;IAClB,qBAAqB,EAAE,MAAM,CAAC;gBAElB,qBAAqB,EAAE,MAAM;IAIzC;;;;;;;;;OASG;IACG,2BAA2B,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IA0B5D;;;;;;;;;;;;;OAaG;IACG,cAAc,CAClB,kBAAkB,EAAE,MAAM,EAC1B,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,WAAuB,GAChC,OAAO,CAAC,MAAM,CAAC;CAqCnB"}