@pagopa/io-react-native-wallet 0.7.4 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (217) hide show
  1. package/README.md +49 -31
  2. package/lib/commonjs/credential/index.js +13 -0
  3. package/lib/commonjs/credential/index.js.map +1 -0
  4. package/lib/commonjs/credential/issuance/01-start-flow.js +2 -0
  5. package/lib/commonjs/credential/issuance/01-start-flow.js.map +1 -0
  6. package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js +26 -0
  7. package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js.map +1 -0
  8. package/lib/commonjs/credential/issuance/03-start-user-authorization.js +119 -0
  9. package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -0
  10. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +6 -0
  11. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -0
  12. package/lib/commonjs/credential/issuance/05-authorize-access.js +63 -0
  13. package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -0
  14. package/lib/commonjs/credential/issuance/06-obtain-credential.js +128 -0
  15. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -0
  16. package/lib/commonjs/credential/issuance/07-confirm-credential.js +6 -0
  17. package/lib/commonjs/credential/issuance/07-confirm-credential.js.map +1 -0
  18. package/lib/commonjs/credential/issuance/const.js +9 -0
  19. package/lib/commonjs/credential/issuance/const.js.map +1 -0
  20. package/lib/commonjs/credential/issuance/index.js +34 -0
  21. package/lib/commonjs/credential/issuance/index.js.map +1 -0
  22. package/lib/commonjs/credential/presentation/01-start-flow.js +55 -0
  23. package/lib/commonjs/credential/presentation/01-start-flow.js.map +1 -0
  24. package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js +32 -0
  25. package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js.map +1 -0
  26. package/lib/commonjs/credential/presentation/03-get-request-object.js +68 -0
  27. package/lib/commonjs/credential/presentation/03-get-request-object.js.map +1 -0
  28. package/lib/commonjs/credential/presentation/04-send-authorization-response.js +139 -0
  29. package/lib/commonjs/credential/presentation/04-send-authorization-response.js.map +1 -0
  30. package/lib/commonjs/credential/presentation/index.js +34 -0
  31. package/lib/commonjs/credential/presentation/index.js.map +1 -0
  32. package/lib/commonjs/{rp → credential/presentation}/types.js +17 -34
  33. package/lib/commonjs/credential/presentation/types.js.map +1 -0
  34. package/lib/commonjs/index.js +10 -61
  35. package/lib/commonjs/index.js.map +1 -1
  36. package/lib/commonjs/pid/index.js +1 -3
  37. package/lib/commonjs/pid/index.js.map +1 -1
  38. package/lib/commonjs/sd-jwt/index.js +1 -1
  39. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  40. package/lib/commonjs/sd-jwt/types.js +1 -1
  41. package/lib/commonjs/sd-jwt/types.js.map +1 -1
  42. package/lib/commonjs/trust/chain.js +32 -4
  43. package/lib/commonjs/trust/chain.js.map +1 -1
  44. package/lib/commonjs/trust/index.js +105 -20
  45. package/lib/commonjs/trust/index.js.map +1 -1
  46. package/lib/commonjs/trust/types.js +54 -35
  47. package/lib/commonjs/trust/types.js.map +1 -1
  48. package/lib/commonjs/utils/crypto.js +5 -18
  49. package/lib/commonjs/utils/crypto.js.map +1 -1
  50. package/lib/commonjs/utils/errors.js +35 -4
  51. package/lib/commonjs/utils/errors.js.map +1 -1
  52. package/lib/commonjs/utils/misc.js +23 -0
  53. package/lib/commonjs/utils/misc.js.map +1 -0
  54. package/lib/commonjs/utils/par.js +86 -0
  55. package/lib/commonjs/utils/par.js.map +1 -0
  56. package/lib/module/credential/index.js +4 -0
  57. package/lib/module/credential/index.js.map +1 -0
  58. package/lib/module/credential/issuance/01-start-flow.js +2 -0
  59. package/lib/module/credential/issuance/01-start-flow.js.map +1 -0
  60. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js +19 -0
  61. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js.map +1 -0
  62. package/lib/module/credential/issuance/03-start-user-authorization.js +109 -0
  63. package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -0
  64. package/lib/module/credential/issuance/04-complete-user-authorization.js +2 -0
  65. package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -0
  66. package/lib/module/credential/issuance/05-authorize-access.js +55 -0
  67. package/lib/module/credential/issuance/05-authorize-access.js.map +1 -0
  68. package/lib/module/credential/issuance/06-obtain-credential.js +117 -0
  69. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -0
  70. package/lib/module/credential/issuance/07-confirm-credential.js +2 -0
  71. package/lib/module/credential/issuance/07-confirm-credential.js.map +1 -0
  72. package/lib/module/credential/issuance/const.js +2 -0
  73. package/lib/module/credential/issuance/const.js.map +1 -0
  74. package/lib/module/credential/issuance/index.js +6 -0
  75. package/lib/module/credential/issuance/index.js.map +1 -0
  76. package/lib/module/credential/presentation/01-start-flow.js +46 -0
  77. package/lib/module/credential/presentation/01-start-flow.js.map +1 -0
  78. package/lib/module/credential/presentation/02-evaluate-rp-trust.js +25 -0
  79. package/lib/module/credential/presentation/02-evaluate-rp-trust.js.map +1 -0
  80. package/lib/module/credential/presentation/03-get-request-object.js +60 -0
  81. package/lib/module/credential/presentation/03-get-request-object.js.map +1 -0
  82. package/lib/module/credential/presentation/04-send-authorization-response.js +128 -0
  83. package/lib/module/credential/presentation/04-send-authorization-response.js.map +1 -0
  84. package/lib/module/credential/presentation/index.js +6 -0
  85. package/lib/module/credential/presentation/index.js.map +1 -0
  86. package/lib/module/credential/presentation/types.js +21 -0
  87. package/lib/module/credential/presentation/types.js.map +1 -0
  88. package/lib/module/index.js +4 -5
  89. package/lib/module/index.js.map +1 -1
  90. package/lib/module/pid/index.js +1 -2
  91. package/lib/module/pid/index.js.map +1 -1
  92. package/lib/module/sd-jwt/index.js +1 -1
  93. package/lib/module/sd-jwt/index.js.map +1 -1
  94. package/lib/module/sd-jwt/types.js +1 -1
  95. package/lib/module/sd-jwt/types.js.map +1 -1
  96. package/lib/module/trust/chain.js +30 -3
  97. package/lib/module/trust/chain.js.map +1 -1
  98. package/lib/module/trust/index.js +99 -16
  99. package/lib/module/trust/index.js.map +1 -1
  100. package/lib/module/trust/types.js +50 -31
  101. package/lib/module/trust/types.js.map +1 -1
  102. package/lib/module/utils/crypto.js +2 -15
  103. package/lib/module/utils/crypto.js.map +1 -1
  104. package/lib/module/utils/errors.js +35 -4
  105. package/lib/module/utils/errors.js.map +1 -1
  106. package/lib/module/utils/misc.js +17 -0
  107. package/lib/module/utils/misc.js.map +1 -0
  108. package/lib/module/utils/par.js +74 -0
  109. package/lib/module/utils/par.js.map +1 -0
  110. package/lib/typescript/credential/index.d.ts +4 -0
  111. package/lib/typescript/credential/index.d.ts.map +1 -0
  112. package/lib/typescript/credential/issuance/01-start-flow.d.ts +11 -0
  113. package/lib/typescript/credential/issuance/01-start-flow.d.ts.map +1 -0
  114. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts +18 -0
  115. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts.map +1 -0
  116. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +31 -0
  117. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -0
  118. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +16 -0
  119. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -0
  120. package/lib/typescript/credential/issuance/05-authorize-access.d.ts +26 -0
  121. package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -0
  122. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +32 -0
  123. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -0
  124. package/lib/typescript/credential/issuance/07-confirm-credential.d.ts +11 -0
  125. package/lib/typescript/credential/issuance/07-confirm-credential.d.ts.map +1 -0
  126. package/lib/typescript/credential/issuance/const.d.ts +2 -0
  127. package/lib/typescript/credential/issuance/const.d.ts.map +1 -0
  128. package/lib/typescript/credential/issuance/index.d.ts +10 -0
  129. package/lib/typescript/credential/issuance/index.d.ts.map +1 -0
  130. package/lib/typescript/credential/presentation/01-start-flow.d.ts +20 -0
  131. package/lib/typescript/credential/presentation/01-start-flow.d.ts.map +1 -0
  132. package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts +18 -0
  133. package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts.map +1 -0
  134. package/lib/typescript/credential/presentation/03-get-request-object.d.ts +25 -0
  135. package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +1 -0
  136. package/lib/typescript/credential/presentation/04-send-authorization-response.d.ts +34 -0
  137. package/lib/typescript/credential/presentation/04-send-authorization-response.d.ts.map +1 -0
  138. package/lib/typescript/credential/presentation/index.d.ts +7 -0
  139. package/lib/typescript/credential/presentation/index.d.ts.map +1 -0
  140. package/lib/typescript/credential/presentation/types.d.ts +49 -0
  141. package/lib/typescript/credential/presentation/types.d.ts.map +1 -0
  142. package/lib/typescript/index.d.ts +4 -5
  143. package/lib/typescript/index.d.ts.map +1 -1
  144. package/lib/typescript/pid/index.d.ts +1 -2
  145. package/lib/typescript/pid/index.d.ts.map +1 -1
  146. package/lib/typescript/sd-jwt/index.d.ts +2 -2
  147. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  148. package/lib/typescript/sd-jwt/types.d.ts +5 -5
  149. package/lib/typescript/trust/chain.d.ts +12 -3
  150. package/lib/typescript/trust/chain.d.ts.map +1 -1
  151. package/lib/typescript/trust/index.d.ts +198 -24
  152. package/lib/typescript/trust/index.d.ts.map +1 -1
  153. package/lib/typescript/trust/types.d.ts +1299 -623
  154. package/lib/typescript/trust/types.d.ts.map +1 -1
  155. package/lib/typescript/utils/crypto.d.ts +1 -1
  156. package/lib/typescript/utils/crypto.d.ts.map +1 -1
  157. package/lib/typescript/utils/dpop.d.ts +2 -2
  158. package/lib/typescript/utils/errors.d.ts.map +1 -1
  159. package/lib/typescript/utils/misc.d.ts +8 -0
  160. package/lib/typescript/utils/misc.d.ts.map +1 -0
  161. package/lib/typescript/utils/par.d.ts +68 -0
  162. package/lib/typescript/utils/par.d.ts.map +1 -0
  163. package/package.json +2 -2
  164. package/src/credential/index.ts +4 -0
  165. package/src/credential/issuance/01-start-flow.ts +10 -0
  166. package/src/credential/issuance/02-evaluate-issuer-trust.ts +31 -0
  167. package/src/credential/issuance/03-start-user-authorization.ts +138 -0
  168. package/src/credential/issuance/04-complete-user-authorization.ts +17 -0
  169. package/src/credential/issuance/05-authorize-access.ts +92 -0
  170. package/src/credential/issuance/06-obtain-credential.ts +179 -0
  171. package/src/credential/issuance/07-confirm-credential.ts +14 -0
  172. package/src/credential/issuance/const.ts +2 -0
  173. package/src/credential/issuance/index.ts +32 -0
  174. package/src/credential/presentation/01-start-flow.ts +51 -0
  175. package/src/credential/presentation/02-evaluate-rp-trust.ts +33 -0
  176. package/src/credential/presentation/03-get-request-object.ts +85 -0
  177. package/src/credential/presentation/04-send-authorization-response.ts +168 -0
  178. package/src/credential/presentation/index.ts +26 -0
  179. package/src/credential/presentation/types.ts +27 -0
  180. package/src/index.ts +7 -28
  181. package/src/pid/index.ts +1 -2
  182. package/src/sd-jwt/index.ts +2 -2
  183. package/src/sd-jwt/types.ts +1 -1
  184. package/src/trust/chain.ts +45 -3
  185. package/src/trust/index.ts +136 -19
  186. package/src/trust/types.ts +57 -35
  187. package/src/utils/crypto.ts +2 -20
  188. package/src/utils/errors.ts +40 -8
  189. package/src/utils/misc.ts +23 -0
  190. package/src/utils/par.ts +103 -0
  191. package/lib/commonjs/pid/issuing.js +0 -276
  192. package/lib/commonjs/pid/issuing.js.map +0 -1
  193. package/lib/commonjs/rp/__test__/index.test.js +0 -172
  194. package/lib/commonjs/rp/__test__/index.test.js.map +0 -1
  195. package/lib/commonjs/rp/index.js +0 -239
  196. package/lib/commonjs/rp/index.js.map +0 -1
  197. package/lib/commonjs/rp/types.js.map +0 -1
  198. package/lib/module/pid/issuing.js +0 -266
  199. package/lib/module/pid/issuing.js.map +0 -1
  200. package/lib/module/rp/__test__/index.test.js +0 -168
  201. package/lib/module/rp/__test__/index.test.js.map +0 -1
  202. package/lib/module/rp/index.js +0 -228
  203. package/lib/module/rp/index.js.map +0 -1
  204. package/lib/module/rp/types.js +0 -36
  205. package/lib/module/rp/types.js.map +0 -1
  206. package/lib/typescript/pid/issuing.d.ts +0 -57
  207. package/lib/typescript/pid/issuing.d.ts.map +0 -1
  208. package/lib/typescript/rp/__test__/index.test.d.ts +0 -2
  209. package/lib/typescript/rp/__test__/index.test.d.ts.map +0 -1
  210. package/lib/typescript/rp/index.d.ts +0 -43
  211. package/lib/typescript/rp/index.d.ts.map +0 -1
  212. package/lib/typescript/rp/types.d.ts +0 -122
  213. package/lib/typescript/rp/types.d.ts.map +0 -1
  214. package/src/pid/issuing.ts +0 -405
  215. package/src/rp/__test__/index.test.ts +0 -250
  216. package/src/rp/index.ts +0 -287
  217. package/src/rp/types.ts +0 -42
@@ -0,0 +1 @@
1
+ {"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,uEAC2C,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type StartFlow } from "./01-start-flow";
2
+ import { evaluateIssuerTrust, type EvaluateIssuerTrust } from "./02-evaluate-issuer-trust";
3
+ import { startUserAuthorization, type StartUserAuthorization } from "./03-start-user-authorization";
4
+ import { type CompleteUserAuthorization } from "./04-complete-user-authorization";
5
+ import { authorizeAccess, type AuthorizeAccess } from "./05-authorize-access";
6
+ import { obtainCredential, type ObtainCredential } from "./06-obtain-credential";
7
+ import type { ConfirmCredential } from "./07-confirm-credential";
8
+ export { evaluateIssuerTrust, startUserAuthorization, authorizeAccess, obtainCredential, };
9
+ export type { StartFlow, EvaluateIssuerTrust, StartUserAuthorization, CompleteUserAuthorization, AuthorizeAccess, ObtainCredential, ConfirmCredential, };
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,mBAAmB,EACnB,KAAK,mBAAmB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,EAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EACL,gBAAgB,EAChB,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,GACjB,CAAC;AACF,YAAY,EACV,SAAS,EACT,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The beginning of the presentation flow.
3
+ * To be implemented accordind to the user touchpoint
4
+ *
5
+ * @param Optional parameters, depending on the starting touchoint
6
+ * @returns The url for the Relying Party to connect with
7
+ */
8
+ export type StartFlow<T extends Array<unknown> = []> = (...args: T) => Promise<{
9
+ requestURI: string;
10
+ clientId: string;
11
+ }>;
12
+ /**
13
+ * Start a presentation flow by decoding an incoming QR-code
14
+ *
15
+ * @param qrcode The encoded QR-code content
16
+ * @returns The url for the Relying Party to connect with
17
+ * @throws If the provided qr code fails to be decoded
18
+ */
19
+ export declare const startFlowFromQR: StartFlow<[string]>;
20
+ //# sourceMappingURL=01-start-flow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"01-start-flow.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/01-start-flow.ts"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CAoB/C,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { RelyingPartyEntityConfiguration } from "../../trust/types";
2
+ import type { StartFlow } from "../issuance/01-start-flow";
3
+ import type { Out } from "../../utils/misc";
4
+ export type EvaluateRelyingPartyTrust = (rpUrl: Out<StartFlow>["issuerUrl"], context?: {
5
+ appFetch?: GlobalFetch["fetch"];
6
+ }) => Promise<{
7
+ rpConf: RelyingPartyEntityConfiguration["payload"]["metadata"];
8
+ }>;
9
+ /**
10
+ * The Relying Party trust evaluation phase.
11
+ * Fetch the Relying Party's configuration and verify trust.
12
+ *
13
+ * @param rpUrl The base url of the Issuer
14
+ * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
15
+ * @returns The Relying Party's configuration
16
+ */
17
+ export declare const evaluateRelyingPartyTrust: EvaluateRelyingPartyTrust;
18
+ //# sourceMappingURL=02-evaluate-rp-trust.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"02-evaluate-rp-trust.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/02-evaluate-rp-trust.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,MAAM,yBAAyB,GAAG,CACtC,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,EAClC,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC;IACX,MAAM,EAAE,+BAA+B,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;CAChE,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,EAAE,yBAUvC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { type CryptoContext } from "@pagopa/io-react-native-jwt";
2
+ import type { EvaluateRelyingPartyTrust } from "./02-evaluate-rp-trust";
3
+ import { type Out } from "../../utils/misc";
4
+ import type { StartFlow } from "./01-start-flow";
5
+ import { RequestObject } from "./types";
6
+ export type GetRequestObject = (requestUri: Out<StartFlow>["requestURI"], rpConf: Out<EvaluateRelyingPartyTrust>["rpConf"], context: {
7
+ wiaCryptoContext: CryptoContext;
8
+ appFetch?: GlobalFetch["fetch"];
9
+ walletInstanceAttestation: string;
10
+ }) => Promise<{
11
+ requestObject: RequestObject;
12
+ }>;
13
+ /**
14
+ * Obtain the Request Object for RP authentication
15
+ * @see https://italia.github.io/eudi-wallet-it-docs/versione-corrente/en/relying-party-solution.html
16
+ *
17
+ * @param requestUri The url for the Relying Party to connect with
18
+ * @param rpConf The Relying Party's configuration
19
+ * @param context.wiaCryptoContext The context to access the key associated with the Wallet Instance Attestation
20
+ * @param context.walletInstanceAttestation The Wallet Instance Attestation token
21
+ * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
22
+ * @returns The Request Object that describes the presentation
23
+ */
24
+ export declare const getRequestObject: GetRequestObject;
25
+ //# sourceMappingURL=03-get-request-object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"03-get-request-object.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/03-get-request-object.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AAIrC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,MAAM,gBAAgB,GAAG,CAC7B,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,EACxC,MAAM,EAAE,GAAG,CAAC,yBAAyB,CAAC,CAAC,QAAQ,CAAC,EAChD,OAAO,EAAE;IACP,gBAAgB,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAChC,yBAAyB,EAAE,MAAM,CAAC;CACnC,KACE,OAAO,CAAC;IAAE,aAAa,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAgD9B,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { type Out } from "../../utils/misc";
2
+ import type { GetRequestObject } from "./03-get-request-object";
3
+ import type { EvaluateRelyingPartyTrust } from "./02-evaluate-rp-trust";
4
+ import { type Presentation } from "./types";
5
+ import * as z from "zod";
6
+ export type AuthorizationResponse = z.infer<typeof AuthorizationResponse>;
7
+ export declare const AuthorizationResponse: z.ZodObject<{
8
+ status: z.ZodString;
9
+ response_code: z.ZodOptional<z.ZodString>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ status: string;
12
+ response_code?: string | undefined;
13
+ }, {
14
+ status: string;
15
+ response_code?: string | undefined;
16
+ }>;
17
+ export type SendAuthorizationResponse = (requestObject: Out<GetRequestObject>["requestObject"], rpConf: Out<EvaluateRelyingPartyTrust>["rpConf"], presentation: Presentation, // TODO: [SIW-353] support multiple presentations
18
+ context: {
19
+ walletInstanceAttestation: string;
20
+ appFetch?: GlobalFetch["fetch"];
21
+ }) => Promise<AuthorizationResponse>;
22
+ /**
23
+ * Complete the presentation flow by sending the authorization response to the Relying Party
24
+ *
25
+ * @param requestObject The Request Object that describes the presentation
26
+ * @param rpConf The Relying Party's configuration
27
+ * @param presentation The presentation tuple consisting in the signed credential,
28
+ * the list of claims to be disclosed, and the context to access the key that proves the holder binding
29
+ * @param context.walletInstanceAttestation The Wallet Instance Attestation token
30
+ * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
31
+ * @returns The result of the presentation flow
32
+ */
33
+ export declare const sendAuthorizationResponse: SendAuthorizationResponse;
34
+ //# sourceMappingURL=04-send-authorization-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"04-send-authorization-response.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/04-send-authorization-response.ts"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC1E,eAAO,MAAM,qBAAqB;;;;;;;;;EAShC,CAAC;AAkFH,MAAM,MAAM,yBAAyB,GAAG,CACtC,aAAa,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC,eAAe,CAAC,EACrD,MAAM,EAAE,GAAG,CAAC,yBAAyB,CAAC,CAAC,QAAQ,CAAC,EAChD,YAAY,EAAE,YAAY,EAAE,iDAAiD;AAC7E,OAAO,EAAE;IACP,yBAAyB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEpC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,EAAE,yBA0CvC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { startFlowFromQR, type StartFlow } from "./01-start-flow";
2
+ import { evaluateRelyingPartyTrust, type EvaluateRelyingPartyTrust } from "./02-evaluate-rp-trust";
3
+ import { getRequestObject, type GetRequestObject } from "./03-get-request-object";
4
+ import { sendAuthorizationResponse, type SendAuthorizationResponse } from "./04-send-authorization-response";
5
+ export { startFlowFromQR, evaluateRelyingPartyTrust, getRequestObject, sendAuthorizationResponse, };
6
+ export type { StartFlow, EvaluateRelyingPartyTrust, GetRequestObject, SendAuthorizationResponse, };
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,EAC/B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,yBAAyB,GAC1B,CAAC;AACF,YAAY,EACV,SAAS,EACT,yBAAyB,EACzB,gBAAgB,EAChB,yBAAyB,GAC1B,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { CryptoContext } from "@pagopa/io-react-native-jwt";
2
+ import * as z from "zod";
3
+ /**
4
+ * A pair that associate a tokenized Verified Credential with the claims presented or requested to present.
5
+ */
6
+ export type Presentation = [
7
+ string,
8
+ string[],
9
+ CryptoContext
10
+ ];
11
+ export type RequestObject = z.infer<typeof RequestObject>;
12
+ export declare const RequestObject: z.ZodObject<{
13
+ iss: z.ZodString;
14
+ iat: z.ZodNumber;
15
+ exp: z.ZodNumber;
16
+ state: z.ZodString;
17
+ nonce: z.ZodString;
18
+ response_uri: z.ZodString;
19
+ response_type: z.ZodLiteral<"vp_token">;
20
+ response_mode: z.ZodLiteral<"direct_post.jwt">;
21
+ client_id: z.ZodString;
22
+ client_id_scheme: z.ZodLiteral<"entity_id">;
23
+ scope: z.ZodString;
24
+ }, "strip", z.ZodTypeAny, {
25
+ iss: string;
26
+ iat: number;
27
+ exp: number;
28
+ client_id: string;
29
+ nonce: string;
30
+ response_type: "vp_token";
31
+ state: string;
32
+ response_uri: string;
33
+ response_mode: "direct_post.jwt";
34
+ client_id_scheme: "entity_id";
35
+ scope: string;
36
+ }, {
37
+ iss: string;
38
+ iat: number;
39
+ exp: number;
40
+ client_id: string;
41
+ nonce: string;
42
+ response_type: "vp_token";
43
+ state: string;
44
+ response_uri: string;
45
+ response_mode: "direct_post.jwt";
46
+ client_id_scheme: "entity_id";
47
+ scope: string;
48
+ }>;
49
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACO,MAAM;IACzB,MAAM,EAAE;IACsC,aAAa;CACzE,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYxB,CAAC"}
@@ -1,11 +1,10 @@
1
1
  import "react-native-url-polyfill/auto";
2
+ import * as Credential from "./credential";
2
3
  import * as PID from "./pid";
3
- import * as RP from "./rp";
4
4
  import * as Errors from "./utils/errors";
5
5
  import * as WalletInstanceAttestation from "./wallet-instance-attestation";
6
- import * as RelyingPartySolution from "./rp";
7
- import { verifyTrustChain, getEntityConfiguration, getCredentialIssuerEntityConfiguration, getRelyingPartyEntityConfiguration, getTrustAnchorEntityConfiguration, getWalletProviderEntityConfiguration } from "./trust";
8
- import { RelyingPartyEntityConfiguration, WalletProviderEntityConfiguration, TrustAnchorEntityConfiguration, CredentialIssuerEntityConfiguration } from "./trust/types";
6
+ import * as Trust from "./trust";
7
+ import { AuthorizationDetail, AuthorizationDetails } from "./utils/par";
9
8
  import { createCryptoContextFor } from "./utils/crypto";
10
- export { PID, RP, WalletInstanceAttestation, Errors, RelyingPartySolution, verifyTrustChain, getEntityConfiguration, getCredentialIssuerEntityConfiguration, getRelyingPartyEntityConfiguration, getTrustAnchorEntityConfiguration, getWalletProviderEntityConfiguration, createCryptoContextFor, RelyingPartyEntityConfiguration, WalletProviderEntityConfiguration, TrustAnchorEntityConfiguration, CredentialIssuerEntityConfiguration, };
9
+ export { PID, Credential, WalletInstanceAttestation, Errors, Trust, createCryptoContextFor, AuthorizationDetail, AuthorizationDetails, };
11
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,gCAAgC,CAAC;AAExC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,yBAAyB,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,oBAAoB,MAAM,MAAM,CAAC;AAC7C,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,sCAAsC,EACtC,kCAAkC,EAClC,iCAAiC,EACjC,oCAAoC,EACrC,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,+BAA+B,EAC/B,iCAAiC,EACjC,8BAA8B,EAC9B,mCAAmC,EACpC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EACL,GAAG,EACH,EAAE,EACF,yBAAyB,EACzB,MAAM,EACN,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,sCAAsC,EACtC,kCAAkC,EAClC,iCAAiC,EACjC,oCAAoC,EACpC,sBAAsB,EACtB,+BAA+B,EAC/B,iCAAiC,EACjC,8BAA8B,EAC9B,mCAAmC,GACpC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,gCAAgC,CAAC;AAExC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,yBAAyB,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EACL,GAAG,EACH,UAAU,EACV,yBAAyB,EACzB,MAAM,EACN,KAAK,EACL,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,GACrB,CAAC"}
@@ -1,4 +1,3 @@
1
1
  import * as SdJwt from "./sd-jwt";
2
- import * as Issuing from "./issuing";
3
- export { SdJwt, Issuing };
2
+ export { SdJwt };
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pid/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAC;AAClC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pid/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -49,13 +49,13 @@ export declare const disclose: (token: string, claims: string[]) => Promise<{
49
49
  *
50
50
  *
51
51
  * @param token The encoded token that represents a valid sd-jwt for verifiable credentials
52
- * @param publicKey The public key to validate the signature
52
+ * @param publicKey The single public key or an array of public keys to validate the signature.
53
53
  * @param schema Schema to use to parse the SD-JWT
54
54
  *
55
55
  * @returns The parsed SD-JWT token and the parsed disclosures
56
56
  *
57
57
  */
58
- export declare const verify: <S extends z.AnyZodObject>(token: string, publicKey: JWK, schema: S) => Promise<{
58
+ export declare const verify: <S extends z.AnyZodObject>(token: string, publicKey: JWK | JWK[], schema: S) => Promise<{
59
59
  sdJwt: z.TypeOf<S>;
60
60
  disclosures: Disclosure[];
61
61
  }>;
@@ -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;AAOxB,OAAO,EAAE,UAAU,EAAY,KAAK,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAE3E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAWxC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,MAAM,oCACV,MAAM;;iBAIA,qBAAqB,EAAE;CAsBrC,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;EA8CnE,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,oCACV,MAAM,aACF,GAAG;;iBAE6B,UAAU,EAAE;EAwBxD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sd-jwt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,EAAE,UAAU,EAAY,KAAK,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAE3E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAWxC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,MAAM,oCACV,MAAM;;iBAIA,qBAAqB,EAAE;CAsBrC,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;EA8CnE,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,oCACV,MAAM,aACF,GAAG,GAAG,GAAG,EAAE;;iBAEqB,UAAU,EAAE;EAwBxD,CAAC"}
@@ -176,7 +176,7 @@ export declare const SdJwt4VC: z.ZodObject<{
176
176
  x5u?: string | undefined;
177
177
  };
178
178
  }>;
179
- type: z.ZodLiteral<"PersonIdentificationData">;
179
+ type: z.ZodString;
180
180
  verified_claims: z.ZodObject<{
181
181
  verification: z.ZodIntersection<z.ZodObject<{
182
182
  trust_framework: z.ZodLiteral<"eidas">;
@@ -224,7 +224,7 @@ export declare const SdJwt4VC: z.ZodObject<{
224
224
  }>;
225
225
  _sd_alg: z.ZodLiteral<"sha-256">;
226
226
  }, "strip", z.ZodTypeAny, {
227
- type: "PersonIdentificationData";
227
+ type: string;
228
228
  status: string;
229
229
  iss: string;
230
230
  sub: string;
@@ -270,7 +270,7 @@ export declare const SdJwt4VC: z.ZodObject<{
270
270
  };
271
271
  _sd_alg: "sha-256";
272
272
  }, {
273
- type: "PersonIdentificationData";
273
+ type: string;
274
274
  status: string;
275
275
  iss: string;
276
276
  sub: string;
@@ -324,7 +324,7 @@ export declare const SdJwt4VC: z.ZodObject<{
324
324
  kid?: string | undefined;
325
325
  };
326
326
  payload: {
327
- type: "PersonIdentificationData";
327
+ type: string;
328
328
  status: string;
329
329
  iss: string;
330
330
  sub: string;
@@ -378,7 +378,7 @@ export declare const SdJwt4VC: z.ZodObject<{
378
378
  kid?: string | undefined;
379
379
  };
380
380
  payload: {
381
- type: "PersonIdentificationData";
381
+ type: string;
382
382
  status: string;
383
383
  iss: string;
384
384
  sub: string;
@@ -7,11 +7,20 @@ type ParsedToken = {
7
7
  /**
8
8
  * Validates a provided trust chain against a known trust
9
9
  *
10
- * @param trustAnchorEntity
11
- * @param chain
10
+ * @param trustAnchorEntity The entity configuration of the known trust anchor
11
+ * @param chain The chain of statements to be validate
12
12
  * @returns The list of parsed token representing the chain
13
13
  * @throws {IoWalletError} If the chain is not valid
14
14
  */
15
- export declare function verifyTrustChain(trustAnchorEntity: TrustAnchorEntityConfiguration, chain: string[]): Promise<ParsedToken[]>;
15
+ export declare function validateTrustChain(trustAnchorEntity: TrustAnchorEntityConfiguration, chain: string[]): Promise<ParsedToken[]>;
16
+ /**
17
+ * Given a trust chain, obtain a new trust chain by fetching each element's fresh version
18
+ *
19
+ * @param chain The original chain
20
+ * @param appFetch (optional) fetch api implementation
21
+ * @returns A list of signed token that reprensent the trust chain, in the same order of the provided chain
22
+ * @throws When an element of the chain fails to parse
23
+ */
24
+ export declare function renewTrustChain(chain: string[], appFetch?: GlobalFetch["fetch"]): Promise<string[]>;
16
25
  export {};
17
26
  //# sourceMappingURL=chain.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../src/trust/chain.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,8BAA8B,EAC/B,MAAM,SAAS,CAAC;AAIjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAExF,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;IAC3C,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;CACrC,CAAC;AAiCF;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,iBAAiB,EAAE,8BAA8B,EACjD,KAAK,EAAE,MAAM,EAAE,GACd,OAAO,CAAC,WAAW,EAAE,CAAC,CA+CxB"}
1
+ {"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../src/trust/chain.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,8BAA8B,EAC/B,MAAM,SAAS,CAAC;AAIjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAGxF,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;IAC3C,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;CACrC,CAAC;AAiCF;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,iBAAiB,EAAE,8BAA8B,EACjD,KAAK,EAAE,MAAM,EAAE,GACd,OAAO,CAAC,WAAW,EAAE,CAAC,CA+CxB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,GAAE,WAAW,CAAC,OAAO,CAAS,qBA6BvC"}
@@ -1,6 +1,31 @@
1
- import { WalletProviderEntityConfiguration, TrustAnchorEntityConfiguration, CredentialIssuerEntityConfiguration, RelyingPartyEntityConfiguration, EntityConfiguration } from "./types";
2
- import { verifyTrustChain } from "./chain";
3
- export { verifyTrustChain };
1
+ import { WalletProviderEntityConfiguration, TrustAnchorEntityConfiguration, CredentialIssuerEntityConfiguration, RelyingPartyEntityConfiguration, EntityConfiguration, EntityStatement } from "./types";
2
+ import { validateTrustChain } from "./chain";
3
+ export type { WalletProviderEntityConfiguration, TrustAnchorEntityConfiguration, CredentialIssuerEntityConfiguration, RelyingPartyEntityConfiguration, EntityConfiguration, EntityStatement, };
4
+ /**
5
+ * Verify a given trust chain is actually valid.
6
+ * It can handle fast chain renewal, which means we try to fetch a fresh version of each statement.
7
+ *
8
+ * @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
12
+ * @returns The result of the chain validation
13
+ * @throws {IoWalletError} When either validation or renewal fail
14
+ */
15
+ export declare function verifyTrustChain(trustAnchorEntity: TrustAnchorEntityConfiguration, chain: string[], { appFetch, renewOnFail, }?: {
16
+ appFetch?: GlobalFetch["fetch"];
17
+ renewOnFail?: boolean;
18
+ }): Promise<ReturnType<typeof validateTrustChain>>;
19
+ /**
20
+ * Fetch the signed entity configuration token for an entity
21
+ *
22
+ * @param entityBaseUrl The url of the entity to fetch
23
+ * @param param.appFetch (optional) fetch api implemention
24
+ * @returns The signed Entity Configuration token
25
+ */
26
+ export declare function getSignedEntityConfiguration(entityBaseUrl: string, { appFetch, }?: {
27
+ appFetch?: GlobalFetch["fetch"];
28
+ }): Promise<string>;
4
29
  /**
5
30
  * Fetch and parse the entity configuration document for a given federation entity.
6
31
  * This is an inner method to serve public interfaces.
@@ -253,9 +278,7 @@ export declare const getCredentialIssuerEntityConfiguration: (entityBaseUrl: Par
253
278
  dpop_signing_alg_values_supported: string[];
254
279
  credential_endpoint: string;
255
280
  credentials_supported: {
256
- format: "vc+sd-jwt";
257
- cryptographic_binding_methods_supported: string[];
258
- cryptographic_suites_supported: string[];
281
+ id: string;
259
282
  display: {
260
283
  name: string;
261
284
  locale: string;
@@ -266,8 +289,53 @@ export declare const getCredentialIssuerEntityConfiguration: (entityBaseUrl: Par
266
289
  background_color: string;
267
290
  text_color: string;
268
291
  }[];
292
+ format: "vc+sd-jwt";
293
+ cryptographic_binding_methods_supported: string[];
294
+ cryptographic_suites_supported: string[];
295
+ credential_definition: {
296
+ type: string[];
297
+ credentialSubject: Record<string, {
298
+ mandatory: boolean;
299
+ display: {
300
+ name: string;
301
+ locale: string;
302
+ }[];
303
+ }>;
304
+ };
269
305
  }[];
270
306
  };
307
+ wallet_relying_party?: {
308
+ jwks: {
309
+ keys: {
310
+ kty: "RSA" | "EC";
311
+ alg?: string | undefined;
312
+ crv?: string | undefined;
313
+ d?: string | undefined;
314
+ dp?: string | undefined;
315
+ dq?: string | undefined;
316
+ e?: string | undefined;
317
+ ext?: boolean | undefined;
318
+ k?: string | undefined;
319
+ key_ops?: string[] | undefined;
320
+ kid?: string | undefined;
321
+ n?: string | undefined;
322
+ p?: string | undefined;
323
+ q?: string | undefined;
324
+ qi?: string | undefined;
325
+ use?: string | undefined;
326
+ x?: string | undefined;
327
+ y?: string | undefined;
328
+ x5c?: string[] | undefined;
329
+ x5t?: string | undefined;
330
+ "x5t#S256"?: string | undefined;
331
+ x5u?: string | undefined;
332
+ }[];
333
+ };
334
+ application_type?: string | undefined;
335
+ client_id?: string | undefined;
336
+ client_name?: string | undefined;
337
+ contacts?: string[] | undefined;
338
+ } | undefined;
271
339
  };
272
340
  };
273
341
  }>;
@@ -422,8 +490,6 @@ export declare const getRelyingPartyEntityConfiguration: (entityBaseUrl: Paramet
422
490
  client_id?: string | undefined;
423
491
  client_name?: string | undefined;
424
492
  contacts?: string[] | undefined;
425
- } & {
426
- [k: string]: unknown;
427
493
  };
428
494
  };
429
495
  };
@@ -607,9 +673,7 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
607
673
  dpop_signing_alg_values_supported: string[];
608
674
  credential_endpoint: string;
609
675
  credentials_supported: {
610
- format: "vc+sd-jwt";
611
- cryptographic_binding_methods_supported: string[];
612
- cryptographic_suites_supported: string[];
676
+ id: string;
613
677
  display: {
614
678
  name: string;
615
679
  locale: string;
@@ -620,8 +684,53 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
620
684
  background_color: string;
621
685
  text_color: string;
622
686
  }[];
687
+ format: "vc+sd-jwt";
688
+ cryptographic_binding_methods_supported: string[];
689
+ cryptographic_suites_supported: string[];
690
+ credential_definition: {
691
+ type: string[];
692
+ credentialSubject: Record<string, {
693
+ mandatory: boolean;
694
+ display: {
695
+ name: string;
696
+ locale: string;
697
+ }[];
698
+ }>;
699
+ };
623
700
  }[];
624
701
  };
702
+ wallet_relying_party?: {
703
+ jwks: {
704
+ keys: {
705
+ kty: "RSA" | "EC";
706
+ alg?: string | undefined;
707
+ crv?: string | undefined;
708
+ d?: string | undefined;
709
+ dp?: string | undefined;
710
+ dq?: string | undefined;
711
+ e?: string | undefined;
712
+ ext?: boolean | undefined;
713
+ k?: string | undefined;
714
+ key_ops?: string[] | undefined;
715
+ kid?: string | undefined;
716
+ n?: string | undefined;
717
+ p?: string | undefined;
718
+ q?: string | undefined;
719
+ qi?: string | undefined;
720
+ use?: string | undefined;
721
+ x?: string | undefined;
722
+ y?: string | undefined;
723
+ x5c?: string[] | undefined;
724
+ x5t?: string | undefined;
725
+ "x5t#S256"?: string | undefined;
726
+ x5u?: string | undefined;
727
+ }[];
728
+ };
729
+ application_type?: string | undefined;
730
+ client_id?: string | undefined;
731
+ client_name?: string | undefined;
732
+ contacts?: string[] | undefined;
733
+ } | undefined;
625
734
  };
626
735
  };
627
736
  }) | ({
@@ -685,7 +794,7 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
685
794
  } & {
686
795
  payload: {
687
796
  metadata: {
688
- wallet_provider: {
797
+ wallet_relying_party: {
689
798
  jwks: {
690
799
  keys: {
691
800
  kty: "RSA" | "EC";
@@ -712,13 +821,10 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
712
821
  x5u?: string | undefined;
713
822
  }[];
714
823
  };
715
- token_endpoint: string;
716
- grant_types_supported: string[];
717
- token_endpoint_auth_methods_supported: string[];
718
- token_endpoint_auth_signing_alg_values_supported: string[];
719
- attested_security_context_values_supported?: string[] | undefined;
720
- } & {
721
- [k: string]: unknown;
824
+ application_type?: string | undefined;
825
+ client_id?: string | undefined;
826
+ client_name?: string | undefined;
827
+ contacts?: string[] | undefined;
722
828
  };
723
829
  };
724
830
  };
@@ -783,7 +889,7 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
783
889
  } & {
784
890
  payload: {
785
891
  metadata: {
786
- wallet_relying_party: {
892
+ wallet_provider: {
787
893
  jwks: {
788
894
  keys: {
789
895
  kty: "RSA" | "EC";
@@ -810,14 +916,82 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
810
916
  x5u?: string | undefined;
811
917
  }[];
812
918
  };
813
- application_type?: string | undefined;
814
- client_id?: string | undefined;
815
- client_name?: string | undefined;
816
- contacts?: string[] | undefined;
919
+ token_endpoint: string;
920
+ grant_types_supported: string[];
921
+ token_endpoint_auth_methods_supported: string[];
922
+ token_endpoint_auth_signing_alg_values_supported: string[];
923
+ attested_security_context_values_supported?: string[] | undefined;
817
924
  } & {
818
925
  [k: string]: unknown;
819
926
  };
820
927
  };
821
928
  };
822
929
  })>;
930
+ /**
931
+ * Fetch and parse the entity statement document for a given federation entity.
932
+ *
933
+ * @param accreditationBodyBaseUrl The base url of the accreditaion body which holds and signs the required entity statement
934
+ * @param subordinatedEntityBaseUrl The url that identifies the subordinate entity
935
+ * @param options.appFetch An optional instance of the http client to be used.
936
+ * @returns The parsed entity configuration object
937
+ * @throws {IoWalletError} If the http request fails
938
+ * @throws Parse error if the document is not in the expected shape.
939
+ */
940
+ export declare function getEntityStatement(accreditationBodyBaseUrl: string, subordinatedEntityBaseUrl: string, { appFetch, }?: {
941
+ appFetch?: GlobalFetch["fetch"];
942
+ }): Promise<{
943
+ header: {
944
+ alg: string;
945
+ kid: string;
946
+ typ: "entity-statement+jwt";
947
+ };
948
+ payload: {
949
+ iss: string;
950
+ sub: string;
951
+ iat: number;
952
+ exp: number;
953
+ jwks: {
954
+ keys: {
955
+ kty: "RSA" | "EC";
956
+ alg?: string | undefined;
957
+ crv?: string | undefined;
958
+ d?: string | undefined;
959
+ dp?: string | undefined;
960
+ dq?: string | undefined;
961
+ e?: string | undefined;
962
+ ext?: boolean | undefined;
963
+ k?: string | undefined;
964
+ key_ops?: string[] | undefined;
965
+ kid?: string | undefined;
966
+ n?: string | undefined;
967
+ p?: string | undefined;
968
+ q?: string | undefined;
969
+ qi?: string | undefined;
970
+ use?: string | undefined;
971
+ x?: string | undefined;
972
+ y?: string | undefined;
973
+ x5c?: string[] | undefined;
974
+ x5t?: string | undefined;
975
+ "x5t#S256"?: string | undefined;
976
+ x5u?: string | undefined;
977
+ }[];
978
+ };
979
+ trust_marks: {
980
+ id: string;
981
+ trust_mark: string;
982
+ }[];
983
+ };
984
+ }>;
985
+ /**
986
+ * Fetch the entity statement document for a given federation entity.
987
+ *
988
+ * @param accreditationBodyBaseUrl The base url of the accreditaion body which holds and signs the required entity statement
989
+ * @param subordinatedEntityBaseUrl The url that identifies the subordinate entity
990
+ * @param options.appFetch An optional instance of the http client to be used.
991
+ * @returns The signed entity statement token
992
+ * @throws {IoWalletError} If the http request fails
993
+ */
994
+ export declare function getSignedEntityStatement(accreditationBodyBaseUrl: string, subordinatedEntityBaseUrl: string, { appFetch, }?: {
995
+ appFetch?: GlobalFetch["fetch"];
996
+ }): Promise<string>;
823
997
  //# sourceMappingURL=index.d.ts.map