@pagopa/io-react-native-wallet 0.27.0 → 0.28.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 (90) hide show
  1. package/lib/commonjs/client/generated/wallet-provider.js +27 -19
  2. package/lib/commonjs/client/generated/wallet-provider.js.map +1 -1
  3. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +5 -5
  4. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
  5. package/lib/commonjs/credential/issuance/05-authorize-access.js +3 -4
  6. package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
  7. package/lib/commonjs/credential/issuance/06-obtain-credential.js +2 -3
  8. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  9. package/lib/commonjs/credential/issuance/README.md +2 -2
  10. package/lib/commonjs/credential/presentation/03-get-request-object.js +2 -3
  11. package/lib/commonjs/credential/presentation/03-get-request-object.js.map +1 -1
  12. package/lib/commonjs/credential/presentation/04-send-authorization-response.js +4 -5
  13. package/lib/commonjs/credential/presentation/04-send-authorization-response.js.map +1 -1
  14. package/lib/commonjs/credential/status/02-status-attestation.js +2 -3
  15. package/lib/commonjs/credential/status/02-status-attestation.js.map +1 -1
  16. package/lib/commonjs/trust/chain.js +35 -50
  17. package/lib/commonjs/trust/chain.js.map +1 -1
  18. package/lib/commonjs/trust/index.js +139 -16
  19. package/lib/commonjs/trust/index.js.map +1 -1
  20. package/lib/commonjs/trust/types.js +13 -37
  21. package/lib/commonjs/trust/types.js.map +1 -1
  22. package/lib/commonjs/trust/utils.js +36 -0
  23. package/lib/commonjs/trust/utils.js.map +1 -0
  24. package/lib/commonjs/utils/crypto.js +2 -3
  25. package/lib/commonjs/utils/crypto.js.map +1 -1
  26. package/lib/commonjs/utils/par.js +3 -4
  27. package/lib/commonjs/utils/par.js.map +1 -1
  28. package/lib/commonjs/wallet-instance/index.js +10 -0
  29. package/lib/commonjs/wallet-instance/index.js.map +1 -1
  30. package/lib/module/client/generated/wallet-provider.js +22 -15
  31. package/lib/module/client/generated/wallet-provider.js.map +1 -1
  32. package/lib/module/credential/issuance/04-complete-user-authorization.js +5 -5
  33. package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
  34. package/lib/module/credential/issuance/05-authorize-access.js +3 -3
  35. package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
  36. package/lib/module/credential/issuance/06-obtain-credential.js +2 -2
  37. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  38. package/lib/module/credential/issuance/README.md +2 -2
  39. package/lib/module/credential/presentation/03-get-request-object.js +2 -2
  40. package/lib/module/credential/presentation/03-get-request-object.js.map +1 -1
  41. package/lib/module/credential/presentation/04-send-authorization-response.js +4 -4
  42. package/lib/module/credential/presentation/04-send-authorization-response.js.map +1 -1
  43. package/lib/module/credential/status/02-status-attestation.js +2 -2
  44. package/lib/module/credential/status/02-status-attestation.js.map +1 -1
  45. package/lib/module/trust/chain.js +32 -46
  46. package/lib/module/trust/chain.js.map +1 -1
  47. package/lib/module/trust/index.js +139 -18
  48. package/lib/module/trust/index.js.map +1 -1
  49. package/lib/module/trust/types.js +11 -36
  50. package/lib/module/trust/types.js.map +1 -1
  51. package/lib/module/trust/utils.js +28 -0
  52. package/lib/module/trust/utils.js.map +1 -0
  53. package/lib/module/utils/crypto.js +2 -2
  54. package/lib/module/utils/crypto.js.map +1 -1
  55. package/lib/module/utils/par.js +3 -3
  56. package/lib/module/utils/par.js.map +1 -1
  57. package/lib/module/wallet-instance/index.js +9 -0
  58. package/lib/module/wallet-instance/index.js.map +1 -1
  59. package/lib/typescript/client/generated/wallet-provider.d.ts +91 -54
  60. package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -1
  61. package/lib/typescript/credential/status/types.d.ts +6 -6
  62. package/lib/typescript/sd-jwt/index.d.ts +12 -12
  63. package/lib/typescript/sd-jwt/types.d.ts +6 -6
  64. package/lib/typescript/trust/chain.d.ts +4 -9
  65. package/lib/typescript/trust/chain.d.ts.map +1 -1
  66. package/lib/typescript/trust/index.d.ts +109 -95
  67. package/lib/typescript/trust/index.d.ts.map +1 -1
  68. package/lib/typescript/trust/types.d.ts +845 -542
  69. package/lib/typescript/trust/types.d.ts.map +1 -1
  70. package/lib/typescript/trust/utils.d.ts +12 -0
  71. package/lib/typescript/trust/utils.d.ts.map +1 -0
  72. package/lib/typescript/wallet-instance/index.d.ts +8 -0
  73. package/lib/typescript/wallet-instance/index.d.ts.map +1 -1
  74. package/lib/typescript/wallet-instance-attestation/types.d.ts +24 -24
  75. package/package.json +9 -3
  76. package/src/client/generated/wallet-provider.ts +28 -19
  77. package/src/credential/issuance/04-complete-user-authorization.ts +5 -5
  78. package/src/credential/issuance/05-authorize-access.ts +3 -3
  79. package/src/credential/issuance/06-obtain-credential.ts +2 -2
  80. package/src/credential/issuance/README.md +2 -2
  81. package/src/credential/presentation/03-get-request-object.ts +2 -2
  82. package/src/credential/presentation/04-send-authorization-response.ts +4 -4
  83. package/src/credential/status/02-status-attestation.ts +2 -2
  84. package/src/trust/chain.ts +46 -62
  85. package/src/trust/index.ts +185 -20
  86. package/src/trust/types.ts +10 -27
  87. package/src/trust/utils.ts +32 -0
  88. package/src/utils/crypto.ts +2 -2
  89. package/src/utils/par.ts +3 -3
  90. package/src/wallet-instance/index.ts +13 -0
@@ -1,14 +1,15 @@
1
- import { WalletProviderEntityConfiguration, TrustAnchorEntityConfiguration, CredentialIssuerEntityConfiguration, RelyingPartyEntityConfiguration, EntityConfiguration, EntityStatement } from "./types";
1
+ import { CredentialIssuerEntityConfiguration, EntityConfiguration, EntityStatement, RelyingPartyEntityConfiguration, TrustAnchorEntityConfiguration, WalletProviderEntityConfiguration } from "./types";
2
2
  import { validateTrustChain } from "./chain";
3
+ import type { JWK } from "../utils/jwk";
3
4
  export type { WalletProviderEntityConfiguration, TrustAnchorEntityConfiguration, CredentialIssuerEntityConfiguration, RelyingPartyEntityConfiguration, EntityConfiguration, EntityStatement, };
4
5
  /**
5
6
  * Verify a given trust chain is actually valid.
6
7
  * It can handle fast chain renewal, which means we try to fetch a fresh version of each statement.
7
8
  *
8
9
  * @param trustAnchorEntity The entity configuration of the known trust anchor
9
- * @param chain The chain of statements to be validate
10
- * @param options.renewOnFail Whether to renew the provided chain if the validation fails at first. Default: true
11
- * @param options.appFetch Fetch api implementation. Default: the built-in implementation
10
+ * @param chain The chain of statements to be validated
11
+ * @param renewOnFail Whether to renew the provided chain if the validation fails at first. Default: true
12
+ * @param appFetch Fetch api implementation. Default: the built-in implementation
12
13
  * @returns The result of the chain validation
13
14
  * @throws {IoWalletError} When either validation or renewal fail
14
15
  */
@@ -20,7 +21,7 @@ export declare function verifyTrustChain(trustAnchorEntity: TrustAnchorEntityCon
20
21
  * Fetch the signed entity configuration token for an entity
21
22
  *
22
23
  * @param entityBaseUrl The url of the entity to fetch
23
- * @param param.appFetch (optional) fetch api implemention
24
+ * @param appFetch (optional) fetch api implementation
24
25
  * @returns The signed Entity Configuration token
25
26
  */
26
27
  export declare function getSignedEntityConfiguration(entityBaseUrl: string, { appFetch, }?: {
@@ -38,6 +39,7 @@ export declare function getSignedEntityConfiguration(entityBaseUrl: string, { ap
38
39
  *
39
40
  * @param entityBaseUrl The base url of the entity.
40
41
  * @param schema The expected schema of the entity configuration, according to the kind of entity we are fetching from.
42
+ * @param options An optional object with additional options.
41
43
  * @param options.appFetch An optional instance of the http client to be used.
42
44
  * @returns The parsed entity configuration object
43
45
  * @throws {IoWalletError} If the http request fails
@@ -59,11 +61,6 @@ declare function fetchAndParseEntityConfiguration(entityBaseUrl: string, schema:
59
61
  appFetch?: GlobalFetch["fetch"];
60
62
  }): Promise<EntityConfiguration>;
61
63
  export declare const getWalletProviderEntityConfiguration: (entityBaseUrl: Parameters<typeof fetchAndParseEntityConfiguration>[0], options?: Parameters<typeof fetchAndParseEntityConfiguration>[2]) => Promise<{
62
- header: {
63
- alg: string;
64
- kid: string;
65
- typ: "entity-statement+jwt";
66
- };
67
64
  payload: {
68
65
  iss: string;
69
66
  sub: string;
@@ -102,6 +99,9 @@ export declare const getWalletProviderEntityConfiguration: (entityBaseUrl: Param
102
99
  federation_resolve_endpoint?: string | undefined;
103
100
  federation_trust_mark_status_endpoint?: string | undefined;
104
101
  federation_trust_mark_list_endpoint?: string | undefined;
102
+ federation_trust_mark_endpoint?: string | undefined;
103
+ federation_historical_keys_endpoint?: string | undefined;
104
+ endpoint_auth_signing_alg_values_supported?: string | undefined;
105
105
  organization_name?: string | undefined;
106
106
  homepage_uri?: string | undefined;
107
107
  policy_uri?: string | undefined;
@@ -117,6 +117,11 @@ export declare const getWalletProviderEntityConfiguration: (entityBaseUrl: Param
117
117
  } & {
118
118
  [k: string]: unknown;
119
119
  };
120
+ header: {
121
+ alg: string;
122
+ kid: string;
123
+ typ: "entity-statement+jwt";
124
+ };
120
125
  } & {
121
126
  payload: {
122
127
  metadata: {
@@ -159,11 +164,6 @@ export declare const getWalletProviderEntityConfiguration: (entityBaseUrl: Param
159
164
  };
160
165
  }>;
161
166
  export declare const getCredentialIssuerEntityConfiguration: (entityBaseUrl: Parameters<typeof fetchAndParseEntityConfiguration>[0], options?: Parameters<typeof fetchAndParseEntityConfiguration>[2]) => Promise<{
162
- header: {
163
- alg: string;
164
- kid: string;
165
- typ: "entity-statement+jwt";
166
- };
167
167
  payload: {
168
168
  iss: string;
169
169
  sub: string;
@@ -202,6 +202,9 @@ export declare const getCredentialIssuerEntityConfiguration: (entityBaseUrl: Par
202
202
  federation_resolve_endpoint?: string | undefined;
203
203
  federation_trust_mark_status_endpoint?: string | undefined;
204
204
  federation_trust_mark_list_endpoint?: string | undefined;
205
+ federation_trust_mark_endpoint?: string | undefined;
206
+ federation_historical_keys_endpoint?: string | undefined;
207
+ endpoint_auth_signing_alg_values_supported?: string | undefined;
205
208
  organization_name?: string | undefined;
206
209
  homepage_uri?: string | undefined;
207
210
  policy_uri?: string | undefined;
@@ -217,6 +220,11 @@ export declare const getCredentialIssuerEntityConfiguration: (entityBaseUrl: Par
217
220
  } & {
218
221
  [k: string]: unknown;
219
222
  };
223
+ header: {
224
+ alg: string;
225
+ kid: string;
226
+ typ: "entity-statement+jwt";
227
+ };
220
228
  } & {
221
229
  payload: {
222
230
  jwks: {
@@ -276,10 +284,6 @@ export declare const getCredentialIssuerEntityConfiguration: (entityBaseUrl: Par
276
284
  display: {
277
285
  name: string;
278
286
  locale: string;
279
- logo?: {
280
- url: string;
281
- alt_text: string;
282
- } | undefined;
283
287
  }[];
284
288
  credential_issuer: string;
285
289
  credential_endpoint: string;
@@ -289,24 +293,18 @@ export declare const getCredentialIssuerEntityConfiguration: (entityBaseUrl: Par
289
293
  display: {
290
294
  name: string;
291
295
  locale: string;
292
- logo?: {
293
- url: string;
294
- alt_text: string;
295
- } | undefined;
296
- background_color?: string | undefined;
297
- text_color?: string | undefined;
298
296
  }[];
299
297
  format: "vc+sd-jwt" | "vc+mdoc-cbor";
300
298
  scope: string;
301
- cryptographic_binding_methods_supported: string[];
302
- credential_signing_alg_values_supported: string[];
303
- claims?: Record<string, {
299
+ claims: Record<string, {
304
300
  value_type: string;
305
301
  display: {
306
302
  name: string;
307
303
  locale: string;
308
304
  }[];
309
- }> | undefined;
305
+ }>;
306
+ cryptographic_binding_methods_supported: string[];
307
+ credential_signing_alg_values_supported: string[];
310
308
  authentic_source?: string | undefined;
311
309
  issuance_errors_supported?: Record<string, {
312
310
  display: {
@@ -357,13 +355,6 @@ export declare const getCredentialIssuerEntityConfiguration: (entityBaseUrl: Par
357
355
  token_endpoint_auth_methods_supported: string[];
358
356
  token_endpoint_auth_signing_alg_values_supported: string[];
359
357
  request_object_signing_alg_values_supported: string[];
360
- dpop_signing_alg_values_supported?: string[] | undefined;
361
- introspection_endpoint?: string | undefined;
362
- authorization_details_types_supported?: string[] | undefined;
363
- request_parameter_supported?: boolean | undefined;
364
- request_uri_parameter_supported?: boolean | undefined;
365
- response_types_supported?: string[] | undefined;
366
- subject_types_supported?: string[] | undefined;
367
358
  };
368
359
  wallet_relying_party?: {
369
360
  jwks: {
@@ -401,11 +392,6 @@ export declare const getCredentialIssuerEntityConfiguration: (entityBaseUrl: Par
401
392
  };
402
393
  }>;
403
394
  export declare const getTrustAnchorEntityConfiguration: (entityBaseUrl: Parameters<typeof fetchAndParseEntityConfiguration>[0], options?: Parameters<typeof fetchAndParseEntityConfiguration>[2]) => Promise<{
404
- header: {
405
- alg: string;
406
- kid: string;
407
- typ: "entity-statement+jwt";
408
- };
409
395
  payload: {
410
396
  iss: string;
411
397
  sub: string;
@@ -444,6 +430,9 @@ export declare const getTrustAnchorEntityConfiguration: (entityBaseUrl: Paramete
444
430
  federation_resolve_endpoint?: string | undefined;
445
431
  federation_trust_mark_status_endpoint?: string | undefined;
446
432
  federation_trust_mark_list_endpoint?: string | undefined;
433
+ federation_trust_mark_endpoint?: string | undefined;
434
+ federation_historical_keys_endpoint?: string | undefined;
435
+ endpoint_auth_signing_alg_values_supported?: string | undefined;
447
436
  organization_name?: string | undefined;
448
437
  homepage_uri?: string | undefined;
449
438
  policy_uri?: string | undefined;
@@ -459,13 +448,13 @@ export declare const getTrustAnchorEntityConfiguration: (entityBaseUrl: Paramete
459
448
  } & {
460
449
  [k: string]: unknown;
461
450
  };
462
- }>;
463
- export declare const getRelyingPartyEntityConfiguration: (entityBaseUrl: Parameters<typeof fetchAndParseEntityConfiguration>[0], options?: Parameters<typeof fetchAndParseEntityConfiguration>[2]) => Promise<{
464
451
  header: {
465
452
  alg: string;
466
453
  kid: string;
467
454
  typ: "entity-statement+jwt";
468
455
  };
456
+ }>;
457
+ export declare const getRelyingPartyEntityConfiguration: (entityBaseUrl: Parameters<typeof fetchAndParseEntityConfiguration>[0], options?: Parameters<typeof fetchAndParseEntityConfiguration>[2]) => Promise<{
469
458
  payload: {
470
459
  iss: string;
471
460
  sub: string;
@@ -504,6 +493,9 @@ export declare const getRelyingPartyEntityConfiguration: (entityBaseUrl: Paramet
504
493
  federation_resolve_endpoint?: string | undefined;
505
494
  federation_trust_mark_status_endpoint?: string | undefined;
506
495
  federation_trust_mark_list_endpoint?: string | undefined;
496
+ federation_trust_mark_endpoint?: string | undefined;
497
+ federation_historical_keys_endpoint?: string | undefined;
498
+ endpoint_auth_signing_alg_values_supported?: string | undefined;
507
499
  organization_name?: string | undefined;
508
500
  homepage_uri?: string | undefined;
509
501
  policy_uri?: string | undefined;
@@ -519,6 +511,11 @@ export declare const getRelyingPartyEntityConfiguration: (entityBaseUrl: Paramet
519
511
  } & {
520
512
  [k: string]: unknown;
521
513
  };
514
+ header: {
515
+ alg: string;
516
+ kid: string;
517
+ typ: "entity-statement+jwt";
518
+ };
522
519
  } & {
523
520
  payload: {
524
521
  metadata: {
@@ -558,11 +555,6 @@ export declare const getRelyingPartyEntityConfiguration: (entityBaseUrl: Paramet
558
555
  };
559
556
  }>;
560
557
  export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof fetchAndParseEntityConfiguration>[0], options?: Parameters<typeof fetchAndParseEntityConfiguration>[2]) => Promise<{
561
- header: {
562
- alg: string;
563
- kid: string;
564
- typ: "entity-statement+jwt";
565
- };
566
558
  payload: {
567
559
  iss: string;
568
560
  sub: string;
@@ -601,6 +593,9 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
601
593
  federation_resolve_endpoint?: string | undefined;
602
594
  federation_trust_mark_status_endpoint?: string | undefined;
603
595
  federation_trust_mark_list_endpoint?: string | undefined;
596
+ federation_trust_mark_endpoint?: string | undefined;
597
+ federation_historical_keys_endpoint?: string | undefined;
598
+ endpoint_auth_signing_alg_values_supported?: string | undefined;
604
599
  organization_name?: string | undefined;
605
600
  homepage_uri?: string | undefined;
606
601
  policy_uri?: string | undefined;
@@ -616,12 +611,12 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
616
611
  } & {
617
612
  [k: string]: unknown;
618
613
  };
619
- } | ({
620
614
  header: {
621
615
  alg: string;
622
616
  kid: string;
623
617
  typ: "entity-statement+jwt";
624
618
  };
619
+ } | ({
625
620
  payload: {
626
621
  iss: string;
627
622
  sub: string;
@@ -660,6 +655,9 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
660
655
  federation_resolve_endpoint?: string | undefined;
661
656
  federation_trust_mark_status_endpoint?: string | undefined;
662
657
  federation_trust_mark_list_endpoint?: string | undefined;
658
+ federation_trust_mark_endpoint?: string | undefined;
659
+ federation_historical_keys_endpoint?: string | undefined;
660
+ endpoint_auth_signing_alg_values_supported?: string | undefined;
663
661
  organization_name?: string | undefined;
664
662
  homepage_uri?: string | undefined;
665
663
  policy_uri?: string | undefined;
@@ -675,6 +673,11 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
675
673
  } & {
676
674
  [k: string]: unknown;
677
675
  };
676
+ header: {
677
+ alg: string;
678
+ kid: string;
679
+ typ: "entity-statement+jwt";
680
+ };
678
681
  } & {
679
682
  payload: {
680
683
  jwks: {
@@ -734,10 +737,6 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
734
737
  display: {
735
738
  name: string;
736
739
  locale: string;
737
- logo?: {
738
- url: string;
739
- alt_text: string;
740
- } | undefined;
741
740
  }[];
742
741
  credential_issuer: string;
743
742
  credential_endpoint: string;
@@ -747,24 +746,18 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
747
746
  display: {
748
747
  name: string;
749
748
  locale: string;
750
- logo?: {
751
- url: string;
752
- alt_text: string;
753
- } | undefined;
754
- background_color?: string | undefined;
755
- text_color?: string | undefined;
756
749
  }[];
757
750
  format: "vc+sd-jwt" | "vc+mdoc-cbor";
758
751
  scope: string;
759
- cryptographic_binding_methods_supported: string[];
760
- credential_signing_alg_values_supported: string[];
761
- claims?: Record<string, {
752
+ claims: Record<string, {
762
753
  value_type: string;
763
754
  display: {
764
755
  name: string;
765
756
  locale: string;
766
757
  }[];
767
- }> | undefined;
758
+ }>;
759
+ cryptographic_binding_methods_supported: string[];
760
+ credential_signing_alg_values_supported: string[];
768
761
  authentic_source?: string | undefined;
769
762
  issuance_errors_supported?: Record<string, {
770
763
  display: {
@@ -815,13 +808,6 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
815
808
  token_endpoint_auth_methods_supported: string[];
816
809
  token_endpoint_auth_signing_alg_values_supported: string[];
817
810
  request_object_signing_alg_values_supported: string[];
818
- dpop_signing_alg_values_supported?: string[] | undefined;
819
- introspection_endpoint?: string | undefined;
820
- authorization_details_types_supported?: string[] | undefined;
821
- request_parameter_supported?: boolean | undefined;
822
- request_uri_parameter_supported?: boolean | undefined;
823
- response_types_supported?: string[] | undefined;
824
- subject_types_supported?: string[] | undefined;
825
811
  };
826
812
  wallet_relying_party?: {
827
813
  jwks: {
@@ -858,11 +844,6 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
858
844
  };
859
845
  };
860
846
  }) | ({
861
- header: {
862
- alg: string;
863
- kid: string;
864
- typ: "entity-statement+jwt";
865
- };
866
847
  payload: {
867
848
  iss: string;
868
849
  sub: string;
@@ -901,6 +882,9 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
901
882
  federation_resolve_endpoint?: string | undefined;
902
883
  federation_trust_mark_status_endpoint?: string | undefined;
903
884
  federation_trust_mark_list_endpoint?: string | undefined;
885
+ federation_trust_mark_endpoint?: string | undefined;
886
+ federation_historical_keys_endpoint?: string | undefined;
887
+ endpoint_auth_signing_alg_values_supported?: string | undefined;
904
888
  organization_name?: string | undefined;
905
889
  homepage_uri?: string | undefined;
906
890
  policy_uri?: string | undefined;
@@ -916,6 +900,11 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
916
900
  } & {
917
901
  [k: string]: unknown;
918
902
  };
903
+ header: {
904
+ alg: string;
905
+ kid: string;
906
+ typ: "entity-statement+jwt";
907
+ };
919
908
  } & {
920
909
  payload: {
921
910
  metadata: {
@@ -954,11 +943,6 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
954
943
  };
955
944
  };
956
945
  }) | ({
957
- header: {
958
- alg: string;
959
- kid: string;
960
- typ: "entity-statement+jwt";
961
- };
962
946
  payload: {
963
947
  iss: string;
964
948
  sub: string;
@@ -997,6 +981,9 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
997
981
  federation_resolve_endpoint?: string | undefined;
998
982
  federation_trust_mark_status_endpoint?: string | undefined;
999
983
  federation_trust_mark_list_endpoint?: string | undefined;
984
+ federation_trust_mark_endpoint?: string | undefined;
985
+ federation_historical_keys_endpoint?: string | undefined;
986
+ endpoint_auth_signing_alg_values_supported?: string | undefined;
1000
987
  organization_name?: string | undefined;
1001
988
  homepage_uri?: string | undefined;
1002
989
  policy_uri?: string | undefined;
@@ -1012,6 +999,11 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
1012
999
  } & {
1013
1000
  [k: string]: unknown;
1014
1001
  };
1002
+ header: {
1003
+ alg: string;
1004
+ kid: string;
1005
+ typ: "entity-statement+jwt";
1006
+ };
1015
1007
  } & {
1016
1008
  payload: {
1017
1009
  metadata: {
@@ -1056,9 +1048,9 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
1056
1048
  /**
1057
1049
  * Fetch and parse the entity statement document for a given federation entity.
1058
1050
  *
1059
- * @param accreditationBodyBaseUrl The base url of the accreditaion body which holds and signs the required entity statement
1051
+ * @param accreditationBodyBaseUrl The base url of the accreditation body which holds and signs the required entity statement
1060
1052
  * @param subordinatedEntityBaseUrl The url that identifies the subordinate entity
1061
- * @param options.appFetch An optional instance of the http client to be used.
1053
+ * @param appFetch An optional instance of the http client to be used.
1062
1054
  * @returns The parsed entity configuration object
1063
1055
  * @throws {IoWalletError} If the http request fails
1064
1056
  * @throws Parse error if the document is not in the expected shape.
@@ -1066,11 +1058,6 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
1066
1058
  export declare function getEntityStatement(accreditationBodyBaseUrl: string, subordinatedEntityBaseUrl: string, { appFetch, }?: {
1067
1059
  appFetch?: GlobalFetch["fetch"];
1068
1060
  }): Promise<{
1069
- header: {
1070
- alg: string;
1071
- kid: string;
1072
- typ: "entity-statement+jwt";
1073
- };
1074
1061
  payload: {
1075
1062
  iss: string;
1076
1063
  sub: string;
@@ -1102,22 +1089,49 @@ export declare function getEntityStatement(accreditationBodyBaseUrl: string, sub
1102
1089
  x5u?: string | undefined;
1103
1090
  }[];
1104
1091
  };
1105
- trust_marks: {
1092
+ trust_marks?: {
1106
1093
  id: string;
1107
1094
  trust_mark: string;
1108
- }[];
1095
+ }[] | undefined;
1096
+ };
1097
+ header: {
1098
+ alg: string;
1099
+ kid: string;
1100
+ typ: "entity-statement+jwt";
1109
1101
  };
1110
1102
  }>;
1111
1103
  /**
1112
1104
  * Fetch the entity statement document for a given federation entity.
1113
1105
  *
1114
- * @param accreditationBodyBaseUrl The base url of the accreditaion body which holds and signs the required entity statement
1115
- * @param subordinatedEntityBaseUrl The url that identifies the subordinate entity
1116
- * @param options.appFetch An optional instance of the http client to be used.
1117
- * @returns The signed entity statement token
1118
- * @throws {IoWalletError} If the http request fails
1106
+ * @param federationFetchEndpoint The exact endpoint provided by the parent EC's metadata.
1107
+ * @param subordinatedEntityBaseUrl The url that identifies the subordinate entity.
1108
+ * @param appFetch An optional instance of the http client to be used.
1109
+ * @returns The signed entity statement token.
1110
+ * @throws {IoWalletError} If the http request fails.
1119
1111
  */
1120
- export declare function getSignedEntityStatement(accreditationBodyBaseUrl: string, subordinatedEntityBaseUrl: string, { appFetch, }?: {
1112
+ export declare function getSignedEntityStatement(federationFetchEndpoint: string, subordinatedEntityBaseUrl: string, { appFetch, }?: {
1121
1113
  appFetch?: GlobalFetch["fetch"];
1122
1114
  }): Promise<string>;
1115
+ /**
1116
+ * Fetch the federation list document from a given endpoint.
1117
+ *
1118
+ * @param federationListEndpoint The URL of the federation list endpoint.
1119
+ * @param appFetch An optional instance of the http client to be used.
1120
+ * @returns The federation list as an array of strings.
1121
+ * @throws {IoWalletError} If the HTTP request fails or the response cannot be parsed.
1122
+ */
1123
+ export declare function getFederationList(federationListEndpoint: string, { appFetch, }?: {
1124
+ appFetch?: GlobalFetch["fetch"];
1125
+ }): Promise<string[]>;
1126
+ /**
1127
+ * Build a not-verified trust chain for a given Relying Party (RP) entity.
1128
+ *
1129
+ * @param relyingPartyEntityBaseUrl The base URL of the RP entity
1130
+ * @param trustAnchorKey The public key of the Trust Anchor (TA) entity
1131
+ * @param appFetch An optional instance of the http client to be used.
1132
+ * @returns A list of signed tokens that represent the trust chain, in the order of the chain (from the RP to the Trust Anchor)
1133
+ * @throws {IoWalletError} When an element of the chain fails to parse
1134
+ * The result of this function can be used to validate the trust chain with {@link verifyTrustChain}
1135
+ */
1136
+ export declare function buildTrustChain(relyingPartyEntityBaseUrl: string, trustAnchorKey: JWK, appFetch?: GlobalFetch["fetch"]): Promise<string[]>;
1123
1137
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/trust/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iCAAiC,EACjC,8BAA8B,EAC9B,mCAAmC,EACnC,+BAA+B,EAC/B,mBAAmB,EACnB,eAAe,EAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,kBAAkB,EAAmB,MAAM,SAAS,CAAC;AAG9D,YAAY,EACV,iCAAiC,EACjC,8BAA8B,EAC9B,mCAAmC,EACnC,+BAA+B,EAC/B,mBAAmB,EACnB,eAAe,GAChB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CACpC,iBAAiB,EAAE,8BAA8B,EACjD,KAAK,EAAE,MAAM,EAAE,EACf,EACE,QAAgB,EAChB,WAAkB,GACnB,GAAE;IAAE,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GACjE,OAAO,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CA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