@pagopa/io-react-native-wallet 0.4.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. package/README.md +128 -19
  2. package/lib/commonjs/index.js +16 -23
  3. package/lib/commonjs/index.js.map +1 -1
  4. package/lib/commonjs/pid/index.js +3 -8
  5. package/lib/commonjs/pid/index.js.map +1 -1
  6. package/lib/commonjs/pid/issuing.js +153 -176
  7. package/lib/commonjs/pid/issuing.js.map +1 -1
  8. package/lib/commonjs/rp/__test__/index.test.js +7 -5
  9. package/lib/commonjs/rp/__test__/index.test.js.map +1 -1
  10. package/lib/commonjs/rp/index.js +145 -155
  11. package/lib/commonjs/rp/index.js.map +1 -1
  12. package/lib/commonjs/rp/types.js +1 -21
  13. package/lib/commonjs/rp/types.js.map +1 -1
  14. package/lib/commonjs/trust/index.js +24 -5
  15. package/lib/commonjs/trust/index.js.map +1 -1
  16. package/lib/commonjs/trust/types.js +102 -9
  17. package/lib/commonjs/trust/types.js.map +1 -1
  18. package/lib/commonjs/utils/crypto.js +46 -0
  19. package/lib/commonjs/utils/crypto.js.map +1 -0
  20. package/lib/commonjs/utils/dpop.js +14 -7
  21. package/lib/commonjs/utils/dpop.js.map +1 -1
  22. package/lib/commonjs/wallet-instance-attestation/index.js +3 -3
  23. package/lib/commonjs/wallet-instance-attestation/issuing.js +42 -60
  24. package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
  25. package/lib/module/index.js +4 -6
  26. package/lib/module/index.js.map +1 -1
  27. package/lib/module/pid/index.js +1 -1
  28. package/lib/module/pid/index.js.map +1 -1
  29. package/lib/module/pid/issuing.js +152 -180
  30. package/lib/module/pid/issuing.js.map +1 -1
  31. package/lib/module/rp/__test__/index.test.js +3 -3
  32. package/lib/module/rp/__test__/index.test.js.map +1 -1
  33. package/lib/module/rp/index.js +141 -154
  34. package/lib/module/rp/index.js.map +1 -1
  35. package/lib/module/rp/types.js +0 -20
  36. package/lib/module/rp/types.js.map +1 -1
  37. package/lib/module/trust/index.js +19 -5
  38. package/lib/module/trust/index.js.map +1 -1
  39. package/lib/module/trust/types.js +100 -7
  40. package/lib/module/trust/types.js.map +1 -1
  41. package/lib/module/utils/crypto.js +40 -0
  42. package/lib/module/utils/crypto.js.map +1 -0
  43. package/lib/module/utils/dpop.js +13 -5
  44. package/lib/module/utils/dpop.js.map +1 -1
  45. package/lib/module/wallet-instance-attestation/index.js +2 -2
  46. package/lib/module/wallet-instance-attestation/index.js.map +1 -1
  47. package/lib/module/wallet-instance-attestation/issuing.js +40 -58
  48. package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
  49. package/lib/typescript/index.d.ts +4 -6
  50. package/lib/typescript/index.d.ts.map +1 -1
  51. package/lib/typescript/pid/index.d.ts +1 -1
  52. package/lib/typescript/pid/index.d.ts.map +1 -1
  53. package/lib/typescript/pid/issuing.d.ts +43 -88
  54. package/lib/typescript/pid/issuing.d.ts.map +1 -1
  55. package/lib/typescript/rp/index.d.ts +41 -87
  56. package/lib/typescript/rp/index.d.ts.map +1 -1
  57. package/lib/typescript/rp/types.d.ts +10 -906
  58. package/lib/typescript/rp/types.d.ts.map +1 -1
  59. package/lib/typescript/sd-jwt/index.d.ts +1 -1
  60. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  61. package/lib/typescript/trust/index.d.ts +806 -3
  62. package/lib/typescript/trust/index.d.ts.map +1 -1
  63. package/lib/typescript/trust/types.d.ts +9655 -297
  64. package/lib/typescript/trust/types.d.ts.map +1 -1
  65. package/lib/typescript/utils/crypto.d.ts +10 -0
  66. package/lib/typescript/utils/crypto.d.ts.map +1 -0
  67. package/lib/typescript/utils/dpop.d.ts +10 -2
  68. package/lib/typescript/utils/dpop.d.ts.map +1 -1
  69. package/lib/typescript/wallet-instance-attestation/index.d.ts +2 -2
  70. package/lib/typescript/wallet-instance-attestation/index.d.ts.map +1 -1
  71. package/lib/typescript/wallet-instance-attestation/issuing.d.ts +18 -31
  72. package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
  73. package/lib/typescript/wallet-instance-attestation/types.d.ts +4 -4
  74. package/package.json +2 -2
  75. package/src/index.ts +14 -13
  76. package/src/pid/index.ts +1 -1
  77. package/src/pid/issuing.ts +233 -232
  78. package/src/rp/__test__/index.test.ts +3 -3
  79. package/src/rp/index.ts +172 -194
  80. package/src/rp/types.ts +0 -24
  81. package/src/sd-jwt/index.ts +1 -1
  82. package/src/trust/index.ts +106 -5
  83. package/src/trust/types.ts +152 -34
  84. package/src/utils/crypto.ts +41 -0
  85. package/src/utils/dpop.ts +17 -7
  86. package/src/wallet-instance-attestation/index.ts +2 -2
  87. package/src/wallet-instance-attestation/issuing.ts +51 -63
  88. package/lib/commonjs/pid/metadata.js +0 -49
  89. package/lib/commonjs/pid/metadata.js.map +0 -1
  90. package/lib/module/pid/metadata.js +0 -41
  91. package/lib/module/pid/metadata.js.map +0 -1
  92. package/lib/typescript/pid/metadata.d.ts +0 -482
  93. package/lib/typescript/pid/metadata.d.ts.map +0 -1
  94. package/src/pid/metadata.ts +0 -46
@@ -5,6 +5,28 @@ export const TrustMark = z.object({
5
5
  id: z.string(),
6
6
  trust_mark: z.string()
7
7
  });
8
+
9
+ // Display metadata for a credential, used by the issuer to
10
+ // instruct the Wallet Solution on how to render the credential correctly
11
+ const CredentialDisplayMetadata = z.object({
12
+ name: z.string(),
13
+ locale: z.string(),
14
+ logo: z.object({
15
+ url: z.string(),
16
+ alt_text: z.string()
17
+ }),
18
+ background_color: z.string(),
19
+ text_color: z.string()
20
+ });
21
+
22
+ // Metadata for a credentia which i supported by a Issuer
23
+
24
+ const SupportedCredentialMetadata = z.object({
25
+ format: z.literal("vc+sd-jwt"),
26
+ cryptographic_binding_methods_supported: z.array(z.string()),
27
+ cryptographic_suites_supported: z.array(z.string()),
28
+ display: z.array(CredentialDisplayMetadata)
29
+ });
8
30
  export const EntityStatement = z.object({
9
31
  header: z.object({
10
32
  typ: z.literal("entity-statement+jwt"),
@@ -22,12 +44,15 @@ export const EntityStatement = z.object({
22
44
  exp: z.number()
23
45
  })
24
46
  });
25
- export const EntityConfiguration = z.object({
26
- header: z.object({
27
- typ: z.literal("entity-statement+jwt"),
28
- alg: z.string(),
29
- kid: z.string()
30
- }),
47
+ export const EntityConfigurationHeader = z.object({
48
+ typ: z.literal("entity-statement+jwt"),
49
+ alg: z.string(),
50
+ kid: z.string()
51
+ });
52
+
53
+ // Structuire common to every Entity Configuration document
54
+ const BaseEntityConfiguration = z.object({
55
+ header: EntityConfigurationHeader,
31
56
  payload: z.object({
32
57
  exp: UnixTime,
33
58
  iat: UnixTime,
@@ -50,7 +75,75 @@ export const EntityConfiguration = z.object({
50
75
  }).passthrough()
51
76
  }).passthrough(),
52
77
  authority_hints: z.array(z.string()).optional()
78
+ }).passthrough()
79
+ });
80
+
81
+ // Entity configuration for a Trust Anchor (it has no specific metadata section)
82
+
83
+ export const TrustAnchorEntityConfiguration = BaseEntityConfiguration;
84
+
85
+ // Entity configuration for a Credential Issuer
86
+
87
+ export const CredentialIssuerEntityConfiguration = BaseEntityConfiguration.and(z.object({
88
+ payload: z.object({
89
+ jwks: z.object({
90
+ keys: z.array(JWK)
91
+ }),
92
+ metadata: z.object({
93
+ openid_credential_issuer: z.object({
94
+ credential_issuer: z.string(),
95
+ authorization_endpoint: z.string(),
96
+ token_endpoint: z.string(),
97
+ pushed_authorization_request_endpoint: z.string(),
98
+ dpop_signing_alg_values_supported: z.array(z.string()),
99
+ credential_endpoint: z.string(),
100
+ credentials_supported: z.array(SupportedCredentialMetadata),
101
+ jwks: z.object({
102
+ keys: z.array(JWK)
103
+ })
104
+ })
105
+ })
106
+ })
107
+ }));
108
+
109
+ // Entity configuration for a Wallet Provider
110
+
111
+ export const WalletProviderEntityConfiguration = BaseEntityConfiguration.and(z.object({
112
+ payload: z.object({
113
+ metadata: z.object({
114
+ wallet_provider: z.object({
115
+ token_endpoint: z.string(),
116
+ attested_security_context_values_supported: z.array(z.string()).optional(),
117
+ grant_types_supported: z.array(z.string()),
118
+ token_endpoint_auth_methods_supported: z.array(z.string()),
119
+ token_endpoint_auth_signing_alg_values_supported: z.array(z.string()),
120
+ jwks: z.object({
121
+ keys: z.array(JWK)
122
+ })
123
+ }).passthrough()
124
+ })
125
+ })
126
+ }));
127
+
128
+ // Entity configuration for a Relying Party
129
+
130
+ export const RelyingPartyEntityConfiguration = BaseEntityConfiguration.and(z.object({
131
+ payload: z.object({
132
+ metadata: z.object({
133
+ wallet_relying_party: z.object({
134
+ application_type: z.string().optional(),
135
+ client_id: z.string().optional(),
136
+ client_name: z.string().optional(),
137
+ jwks: z.array(JWK),
138
+ contacts: z.array(z.string()).optional()
139
+ }).passthrough()
140
+ })
53
141
  })
142
+ }));
143
+
144
+ // Maps any entity configuration by the union of every possible shapes
145
+
146
+ export const EntityConfiguration = z.union([WalletProviderEntityConfiguration, CredentialIssuerEntityConfiguration, TrustAnchorEntityConfiguration, RelyingPartyEntityConfiguration], {
147
+ description: "Any kind of Entity Configuration allowed in the ecosystem"
54
148
  });
55
- export const TrustAnchorEntityConfiguration = EntityConfiguration;
56
149
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["UnixTime","JWK","z","TrustMark","object","id","string","trust_mark","EntityStatement","header","typ","literal","alg","kid","payload","iss","sub","jwks","keys","array","trust_marks","iat","number","exp","EntityConfiguration","metadata","federation_entity","federation_fetch_endpoint","optional","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","homepage_uri","policy_uri","logo_uri","contacts","passthrough","authority_hints","TrustAnchorEntityConfiguration"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,CAAC,MAAM,KAAK;AAExB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAAEC,EAAE,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EAAE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B"}
1
+ {"version":3,"names":["UnixTime","JWK","z","TrustMark","object","id","string","trust_mark","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","SupportedCredentialMetadata","format","literal","cryptographic_binding_methods_supported","array","cryptographic_suites_supported","display","EntityStatement","header","typ","alg","kid","payload","iss","sub","jwks","keys","trust_marks","iat","number","exp","EntityConfigurationHeader","BaseEntityConfiguration","metadata","federation_entity","federation_fetch_endpoint","optional","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","homepage_uri","policy_uri","logo_uri","contacts","passthrough","authority_hints","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","authorization_endpoint","token_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","credential_endpoint","credentials_supported","WalletProviderEntityConfiguration","wallet_provider","attested_security_context_values_supported","grant_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","RelyingPartyEntityConfiguration","wallet_relying_party","application_type","client_id","client_name","EntityConfiguration","union","description"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,CAAC,MAAM,KAAK;AAExB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAAEC,EAAE,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EAAEC,UAAU,EAAEL,CAAC,CAACI,MAAM,CAAC;AAAE,CAAC,CAAC;;AAG7E;AACA;AAEA,MAAME,yBAAyB,GAAGN,CAAC,CAACE,MAAM,CAAC;EACzCK,IAAI,EAAEP,CAAC,CAACI,MAAM,CAAC,CAAC;EAChBI,MAAM,EAAER,CAAC,CAACI,MAAM,CAAC,CAAC;EAClBK,IAAI,EAAET,CAAC,CAACE,MAAM,CAAC;IACbQ,GAAG,EAAEV,CAAC,CAACI,MA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ED;;AAIA,OAAO,MAAMmB,+BAA+B,GAAGhC,uBAAuB,CAACiB,GAAG,CACxErD,CAAC,CAACE,MAAM,CAAC;EACPwB,OAAO,EAAE1B,CAAC,CAACE,MAAM,CAAC;IAChBmC,QAAQ,EAAErC,CAAC,CAACE,MAAM,CAAC;MACjBmE,oBAAoB,EAAErE,CAAC,CACpBE,MAAM,CAAC;QACNoE,gBAAgB,EAAEtE,CAAC,CAACI,MAAM,CAAC,CAAC,CAACoC,QAAQ,CAAC,CAAC;QACvC+B,SAAS,EAAEvE,CAAC,CAACI,MAAM,CAAC,CAAC,CAACoC,QAAQ,CAAC,CAAC;QAChCgC,WAAW,EAAExE,CAAC,CAACI,MAAM,CAAC,CAAC,CAACoC,QAAQ,CAAC,CAAC;QAClCX,IAAI,EAAE7B,CAAC,CAACkB,KAAK,CAACnB,GAAG,CAAC;QAClBiD,QAAQ,EAAEhD,CAAC,CAACkB,KAAK,CAAClB,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC,CAACoC,QAAQ,CAAC;MACzC,CAAC,CAAC,CACDS,WAAW,CAAC;IACjB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;;AAED;;AAEA,OAAO,MAAMwB,mBAAmB,GAAGzE,CAAC,CAAC0E,KAAK,CACxC,CACEZ,iCAAiC,EACjCV,mCAAmC,EACnCD,8BAA8B,EAC9BiB,+BAA+B,CAChC,EACD;EACEO,WAAW,EAAE;AACf,CACF,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { getPublicKey, sign } from "@pagopa/io-react-native-crypto";
2
+ import { thumbprint } from "@pagopa/io-react-native-jwt";
3
+ import { fixBase64EncodingOnKey } from "./jwk";
4
+
5
+ /**
6
+ * Create a CryptoContext bound to a key pair.
7
+ * Key pair is supposed to exist already in the device's keychain.
8
+ * It's identified by its unique keytag.
9
+ *
10
+ * @returns the crypto context
11
+ */
12
+ export const createCryptoContextFor = keytag => {
13
+ return {
14
+ /**
15
+ * Retrieve the public key of the pair.
16
+ * If the key pair doesn't exist yet, an error is raised
17
+ * @returns The public key.
18
+ */
19
+ async getPublicKey() {
20
+ return getPublicKey(keytag).then(fixBase64EncodingOnKey).then(async jwk => ({
21
+ ...jwk,
22
+ // Keys in the TEE are not stored with their KID, which is supposed to be assigned when they are included in JWK sets.
23
+ // (that is, KID is not a propoerty of the key itself, but it's property used to identify a key in a set).
24
+ // We assume the convention we use the thumbprint of the public key as KID, thus for easy development we decided to evaluate KID here
25
+ // However the values is an arbitrary string that might be anything
26
+ kid: await thumbprint(jwk)
27
+ }));
28
+ },
29
+ /**
30
+ * Get a signature for a provided value.
31
+ * If the key pair doesn't exist yet, an error is raised.
32
+ * @param value
33
+ * @returns The signature for the value
34
+ */
35
+ async getSignature(value) {
36
+ return sign(value, keytag);
37
+ }
38
+ };
39
+ };
40
+ //# sourceMappingURL=crypto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getPublicKey","sign","thumbprint","fixBase64EncodingOnKey","createCryptoContextFor","keytag","then","jwk","kid","getSignature","value"],"sourceRoot":"../../../src","sources":["utils/crypto.ts"],"mappings":"AAAA,SAASA,YAAY,EAAEC,IAAI,QAAQ,gCAAgC;AACnE,SAASC,UAAU,QAA4B,6BAA6B;AAC5E,SAASC,sBAAsB,QAAQ,OAAO;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAIC,MAAc,IAAoB;EACvE,OAAO;IACL;AACJ;AACA;AACA;AACA;IACI,MAAML,YAAYA,CAAA,EAAG;MACnB,OAAOA,YAAY,CAACK,MAAM,CAAC,CACxBC,IAAI,CAACH,sBAAsB,CAAC,CAC5BG,IAAI,CAAC,MAAOC,GAAG,KAAM;QACpB,GAAGA,GAAG;QACN;QACA;QACA;QACA;QACAC,GAAG,EAAE,MAAMN,UAAU,CAACK,GAAG;MAC3B,CAAC,CAAC,CAAC;IACP,CAAC;IACD;AACJ;AACA;AACA;AACA;AACA;IACI,MAAME,YAAYA,CAACC,KAAa,EAAE;MAChC,OAAOT,IAAI,CAACS,KAAK,EAAEL,MAAM,CAAC;IAC5B;EACF,CAAC;AACH,CAAC"}
@@ -1,12 +1,20 @@
1
1
  import * as z from "zod";
2
2
  import { SignJWT } from "@pagopa/io-react-native-jwt";
3
- export const getUnsignedDPop = (jwk, payload) => {
4
- const dPop = new SignJWT(payload).setProtectedHeader({
5
- alg: "ES256",
3
+
4
+ /**
5
+ * Create a signed DPoP token
6
+ *
7
+ * @param payload The payload to be included in the token.
8
+ * @param crypto The crypto context that handles the key bound to the DPoP.
9
+ *
10
+ * @returns The signed crypto token.
11
+ */
12
+ export const createDPopToken = async (payload, crypto) => {
13
+ const jwk = await crypto.getPublicKey();
14
+ return new SignJWT(crypto).setPayload(payload).setProtectedHeader({
6
15
  typ: "dpop+jwt",
7
16
  jwk
8
- }).setIssuedAt().setExpirationTime("1h").toSign();
9
- return dPop;
17
+ }).setIssuedAt().setExpirationTime("1h").sign();
10
18
  };
11
19
  export const DPoPPayload = z.object({
12
20
  jti: z.string(),
@@ -1 +1 @@
1
- {"version":3,"names":["z","SignJWT","getUnsignedDPop","jwk","payload","dPop","setProtectedHeader","alg","typ","setIssuedAt","setExpirationTime","toSign","DPoPPayload","object","jti","string","htm","union","literal","htu","ath","optional"],"sourceRoot":"../../../src","sources":["utils/dpop.ts"],"mappings":"AAAA,OAAO,KAAKA,CAAC,MAAM,KAAK;AAExB,SAASC,OAAO,QAAQ,6BAA6B;AAGrD,OAAO,MAAMC,eAAe,GAAGA,CAACC,GAAQ,EAAEC,OAAoB,KAAa;EACzE,MAAMC,IAAI,GAAG,IAAIJ,OAAO,CAACG,OAAO,CAAC,CAC9BE,kBAAkB,CAAC;IAClBC,GAAG,EAAE,OAAO;IACZC,GAAG,EAAE,UAAU;IACfL;EACF,CAAC,CAAC,CACDM,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,IAAI,CAAC,CACvBC,MAAM,CAAC,CAAC;EACX,OAAON,IAAI;AACb,CAAC;AAGD,OAAO,MAAMO,WAAW,GAAGZ,CAAC,CAACa,MAAM,CAAC;EAClCC,GAAG,EAAEd,CAAC,CAACe,MAAM,CAAC,CAAC;EACfC,GAAG,EAAEhB,CAAC,CAACiB,KAAK,CAAC,CAACjB,CAAC,CAACkB,OAAO,CAAC,MAAM,CAAC,EAAElB,CAAC,CAACkB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;EACnDC,GAAG,EAAEnB,CAAC,CAACe,MAAM,CAAC,CAAC;EACfK,GAAG,EAAEpB,CAAC,CAACe,MAAM,CAAC,CAAC,CAACM,QAAQ,CAAC;AAC3B,CAAC,CAAC"}
1
+ {"version":3,"names":["z","SignJWT","createDPopToken","payload","crypto","jwk","getPublicKey","setPayload","setProtectedHeader","typ","setIssuedAt","setExpirationTime","sign","DPoPPayload","object","jti","string","htm","union","literal","htu","ath","optional"],"sourceRoot":"../../../src","sources":["utils/dpop.ts"],"mappings":"AAAA,OAAO,KAAKA,CAAC,MAAM,KAAK;AAExB,SAASC,OAAO,QAA4B,6BAA6B;;AAEzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAG,MAAAA,CAC7BC,OAAoB,EACpBC,MAAqB,KACD;EACpB,MAAMC,GAAG,GAAG,MAAMD,MAAM,CAACE,YAAY,CAAC,CAAC;EACvC,OAAO,IAAIL,OAAO,CAACG,MAAM,CAAC,CACvBG,UAAU,CAACJ,OAAO,CAAC,CACnBK,kBAAkB,CAAC;IAClBC,GAAG,EAAE,UAAU;IACfJ;EACF,CAAC,CAAC,CACDK,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,IAAI,CAAC,CACvBC,IAAI,CAAC,CAAC;AACX,CAAC;AAGD,OAAO,MAAMC,WAAW,GAAGb,CAAC,CAACc,MAAM,CAAC;EAClCC,GAAG,EAAEf,CAAC,CAACgB,MAAM,CAAC,CAAC;EACfC,GAAG,EAAEjB,CAAC,CAACkB,KAAK,CAAC,CAAClB,CAAC,CAACmB,OAAO,CAAC,MAAM,CAAC,EAAEnB,CAAC,CAACmB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;EACnDC,GAAG,EAAEpB,CAAC,CAACgB,MAAM,CAAC,CAAC;EACfK,GAAG,EAAErB,CAAC,CAACgB,MAAM,CAAC,CAAC,CAACM,QAAQ,CAAC;AAC3B,CAAC,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { WalletInstanceAttestationJwt } from "./types";
2
2
  import { decode as decodeJwt } from "@pagopa/io-react-native-jwt";
3
3
  import { verify as verifyJwt } from "@pagopa/io-react-native-jwt";
4
- import { Issuing } from "./issuing";
5
- export { Issuing };
4
+ import { getAttestation } from "./issuing";
5
+ export { getAttestation };
6
6
  /**
7
7
  * Decode a given JWT to get the parsed Wallet Instance Attestation object they define.
8
8
  * It ensures provided data is in a valid shape.
@@ -1 +1 @@
1
- {"version":3,"names":["WalletInstanceAttestationJwt","decode","decodeJwt","verify","verifyJwt","Issuing","token","decodedJwt","parse","header","protectedHeader","payload","decoded","pubKey","cnf","jwk"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/index.ts"],"mappings":"AAAA,SAASA,4BAA4B,QAAQ,SAAS;AACtD,SAASC,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AACjE,SAASC,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AAEjE,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASA,OAAO;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASJ,MAAMA,CAACK,KAAa,EAAgC;EAClE;EACA,MAAMC,UAAU,GAAGL,SAAS,CAACI,KAAK,CAAC;EACnC;EACA,OAAON,4BAA4B,CAACQ,KAAK,CAAC;IACxCC,MAAM,EAAEF,UAAU,CAACG,eAAe;IAClCC,OAAO,EAAEJ,UAAU,CAACI;EACtB,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeR,MAAMA,CAC1BG,KAAa,EAC0B;EACvC,MAAMM,OAAO,GAAGX,MAAM,CAACK,KAAK,CAAC;EAC7B,MAAMO,MAAM,GAAGD,OAAO,CAACD,OAAO,CAACG,GAAG,CAACC,GAAG;EAEtC,MAAMX,SAAS,CAACE,KAAK,EAAEO,MAAM,CAAC;EAE9B,OAAOD,OAAO;AAChB"}
1
+ {"version":3,"names":["WalletInstanceAttestationJwt","decode","decodeJwt","verify","verifyJwt","getAttestation","token","decodedJwt","parse","header","protectedHeader","payload","decoded","pubKey","cnf","jwk"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/index.ts"],"mappings":"AAAA,SAASA,4BAA4B,QAAQ,SAAS;AACtD,SAASC,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AACjE,SAASC,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AAEjE,SAASC,cAAc,QAAQ,WAAW;AAC1C,SAASA,cAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASJ,MAAMA,CAACK,KAAa,EAAgC;EAClE;EACA,MAAMC,UAAU,GAAGL,SAAS,CAACI,KAAK,CAAC;EACnC;EACA,OAAON,4BAA4B,CAACQ,KAAK,CAAC;IACxCC,MAAM,EAAEF,UAAU,CAACG,eAAe;IAClCC,OAAO,EAAEJ,UAAU,CAACI;EACtB,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeR,MAAMA,CAC1BG,KAAa,EAC0B;EACvC,MAAMM,OAAO,GAAGX,MAAM,CAACK,KAAK,CAAC;EAC7B,MAAMO,MAAM,GAAGD,OAAO,CAACD,OAAO,CAACG,GAAG,CAACC,GAAG;EAEtC,MAAMX,SAAS,CAACE,KAAK,EAAEO,MAAM,CAAC;EAE9B,OAAOD,OAAO;AAChB"}
@@ -5,61 +5,43 @@ import { JWK, fixBase64EncodingOnKey } from "../utils/jwk";
5
5
  import { WalletInstanceAttestationRequestJwt } from "./types";
6
6
  import uuid from "react-native-uuid";
7
7
  import { WalletInstanceAttestationIssuingError } from "../utils/errors";
8
- export class Issuing {
9
- constructor(walletProviderBaseUrl) {
10
- let appFetch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : fetch;
11
- this.walletProviderBaseUrl = walletProviderBaseUrl;
12
- this.appFetch = appFetch;
13
- }
14
-
15
- /**
16
- * Get the Wallet Instance Attestation Request to sign
17
- *
18
- * @async @function
19
- *
20
- * @param jwk Public key of the wallet instance
21
- *
22
- * @returns {string} Wallet Instance Attestation Request to sign
23
- *
24
- */
25
- async getAttestationRequestToSign(jwk) {
26
- const parsedJwk = JWK.parse(jwk);
27
- const keyThumbprint = await thumbprint(parsedJwk);
28
- const publicKey = {
29
- ...parsedJwk,
30
- kid: keyThumbprint
31
- };
32
- const walletInstanceAttestationRequest = new SignJWT({
33
- iss: keyThumbprint,
34
- aud: this.walletProviderBaseUrl,
35
- jti: `${uuid.v4()}`,
36
- nonce: `${uuid.v4()}`,
37
- cnf: {
38
- jwk: fixBase64EncodingOnKey(publicKey)
39
- }
40
- }).setProtectedHeader({
41
- alg: "ES256",
42
- kid: publicKey.kid,
43
- typ: "wiar+jwt"
44
- }).setIssuedAt().setExpirationTime("1h").toSign();
45
- return walletInstanceAttestationRequest;
46
- }
8
+ async function getAttestationRequest(wiaCryptoContext, walletProviderEntityConfiguration) {
9
+ const jwk = await wiaCryptoContext.getPublicKey();
10
+ const parsedJwk = JWK.parse(jwk);
11
+ const keyThumbprint = await thumbprint(parsedJwk);
12
+ const publicKey = {
13
+ ...parsedJwk,
14
+ kid: keyThumbprint
15
+ };
16
+ return new SignJWT(wiaCryptoContext).setPayload({
17
+ iss: keyThumbprint,
18
+ aud: walletProviderEntityConfiguration.payload.iss,
19
+ jti: `${uuid.v4()}`,
20
+ nonce: `${uuid.v4()}`,
21
+ cnf: {
22
+ jwk: fixBase64EncodingOnKey(publicKey)
23
+ }
24
+ }).setProtectedHeader({
25
+ kid: publicKey.kid,
26
+ typ: "wiar+jwt"
27
+ }).setIssuedAt().setExpirationTime("1h").sign();
28
+ }
47
29
 
48
- /**
49
- * Get the Wallet Instance Attestation given a
50
- * Wallet Instance Attestation Request and signature
51
- *
52
- * @async @function
53
- *
54
- * @param attestationRequest Wallet Instance Attestaion Request
55
- * obtained with {@link getAttestationRequestToSign}
56
- * @param signature Signature of the Wallet Instance Attestaion Request
57
- *
58
- * @returns {string} Wallet Instance Attestation
59
- *
60
- */
61
- async getAttestation(attestationRequest, signature) {
62
- const signedAttestationRequest = await SignJWT.appendSignature(attestationRequest, signature);
30
+ /**
31
+ * Request a Wallet Instance Attestation (WIA) to the Wallet provider
32
+ *
33
+ * @param params.wiaCryptoContext The key pair associated with the WIA. Will be use to prove the ownership of the attestation.
34
+ * @param params.appFetch (optional) Http client
35
+ * @param walletProviderBaseUrl Base url for the Wallet Provider
36
+ * @returns The retrieved Wallet Instance Attestation token
37
+ */
38
+ export const getAttestation = _ref => {
39
+ let {
40
+ wiaCryptoContext,
41
+ appFetch = fetch
42
+ } = _ref;
43
+ return async walletProviderEntityConfiguration => {
44
+ const signedAttestationRequest = await getAttestationRequest(wiaCryptoContext, walletProviderEntityConfiguration);
63
45
  const decodedRequest = decodeJwt(signedAttestationRequest);
64
46
  const parsedRequest = WalletInstanceAttestationRequestJwt.parse({
65
47
  payload: decodedRequest.payload,
@@ -67,12 +49,12 @@ export class Issuing {
67
49
  });
68
50
  const publicKey = parsedRequest.payload.cnf.jwk;
69
51
  await verifyJwt(signedAttestationRequest, publicKey);
70
- const tokenUrl = new URL("token", this.walletProviderBaseUrl).href;
52
+ const tokenUrl = walletProviderEntityConfiguration.payload.metadata.wallet_provider.token_endpoint;
71
53
  const requestBody = {
72
54
  grant_type: "urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation",
73
55
  assertion: signedAttestationRequest
74
56
  };
75
- const response = await this.appFetch(tokenUrl, {
57
+ const response = await appFetch(tokenUrl, {
76
58
  method: "POST",
77
59
  headers: {
78
60
  "Content-Type": "application/json"
@@ -83,6 +65,6 @@ export class Issuing {
83
65
  return await response.text();
84
66
  }
85
67
  throw new WalletInstanceAttestationIssuingError("Unable to obtain wallet instance attestation from wallet provider", `Response code: ${response.status}`);
86
- }
87
- }
68
+ };
69
+ };
88
70
  //# sourceMappingURL=issuing.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["decode","decodeJwt","verify","verifyJwt","SignJWT","thumbprint","JWK","fixBase64EncodingOnKey","WalletInstanceAttestationRequestJwt","uuid","WalletInstanceAttestationIssuingError","Issuing","constructor","walletProviderBaseUrl","appFetch","arguments","length","undefined","fetch","getAttestationRequestToSign","jwk","parsedJwk","parse","keyThumbprint","publicKey","kid","walletInstanceAttestationRequest","iss","aud","jti","v4","nonce","cnf","setProtectedHeader","alg","typ","setIssuedAt","setExpirationTime","toSign","getAttestation","attestationRequest","signature","signedAttestationRequest","appendSignature","decodedRequest","parsedRequest","payload","header","protectedHeader","tokenUrl","URL","href","requestBody","grant_type","assertion","response","method","headers","body","JSON","stringify","status","text"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/issuing.ts"],"mappings":"AAAA,SAASA,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AACjE,SAASC,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AACjE,SAASC,OAAO,EAAEC,UAAU,QAAQ,6BAA6B;AACjE,SAASC,GAAG,EAAEC,sBAAsB,QAAQ,cAAc;AAC1D,SAASC,mCAAmC,QAAQ,SAAS;AAC7D,OAAOC,IAAI,MAAM,mBAAmB;AACpC,SAASC,qCAAqC,QAAQ,iBAAiB;AAEvE,OAAO,MAAMC,OAAO,CAAC;EAGnBC,WAAWA,CACTC,qBAA6B,EAE7B;IAAA,IADAC,QAA8B,GAAAC,SAAA,CAAAC,MAAA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G3C,SAAS,CAACyC,wBAAwB,CAAC;IAC1D,MAAMG,aAAa,GAAGrC,mCAAmC,CAACc,KAAK,CAAC;MAC9DwB,OAAO,EAAEF,cAAc,CAACE,OAAO;MAC/BC,MAAM,EAAEH,cAAc,CAACI;IACzB,CAAC,CAAC;IACF,MAAMxB,SAAS,GAAGqB,aAAa,CAACC,OAAO,CAACd,GAAG,CAACZ,GAAG;IAE/C,MAAMjB,SAAS,CAACuC,wBAAwB,EAAElB,SAAS,CAAC;IAEpD,MAAMyB,QAAQ,GAAG,IAAIC,GAAG,CAAC,OAAO,EAAE,IAAI,CAACrC,qBAAqB,CAAC,CAACsC,IAAI;IAClE,MAAMC,WAAW,GAAG;MAClBC,UAAU,EACR,oEAAoE;MACtEC,SAAS,EAAEZ;IACb,CAAC;IACD,MAAMa,QAAQ,GAAG,MAAM,IAAI,CAACzC,QAAQ,CAACmC,QAAQ,EAAE;MAC7CO,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QACP,cAAc,EAAE;MAClB,CAAC;MACDC,IAAI,EAAEC,IAAI,CAACC,SAAS,CAACR,WAAW;IAClC,CAAC,CAAC;IAEF,IAAIG,QAAQ,CAACM,MAAM,KAAK,GAAG,EAAE;MAC3B,OAAO,MAAMN,QAAQ,CAACO,IAAI,CAAC,CAAC;IAC9B;IAEA,MAAM,IAAIpD,qCAAqC,CAC7C,mEAAmE,EAClE,kBAAiB6C,QAAQ,CAACM,MAAO,EACpC,CAAC;EACH;AACF"}
1
+ {"version":3,"names":["decode","decodeJwt","verify","verifyJwt","SignJWT","thumbprint","JWK","fixBase64EncodingOnKey","WalletInstanceAttestationRequestJwt","uuid","WalletInstanceAttestationIssuingError","getAttestationRequest","wiaCryptoContext","walletProviderEntityConfiguration","jwk","getPublicKey","parsedJwk","parse","keyThumbprint","publicKey","kid","setPayload","iss","aud","payload","jti","v4","nonce","cnf","setProtectedHeader","typ","setIssuedAt","setExpirationTime","sign","getAttestation","_ref","appFetch","fetch","signedAttestationRequest","decodedRequest","parsedRequest","header","protectedHeader","tokenUrl","metadata","wallet_provider","token_endpoint","requestBody","grant_type","assertion","response","method","headers","body","JSON","stringify","status","text"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/issuing.ts"],"mappings":"AAAA,SAEEA,MAAM,IAAIC,SAAS,QACd,6BAA6B;AACpC,SAASC,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AACjE,SAASC,OAAO,EAAEC,UAAU,QAAQ,6BAA6B;AACjE,SAASC,GAAG,EAAEC,sBAAsB,QAAQ,cAAc;AAC1D,SAASC,mCAAmC,QAAQ,SAAS;AAC7D,OAAOC,IAAI,MAAM,mBAAmB;AACpC,SAASC,qCAAqC,QAAQ,iBAAiB;AAGvE,eAAeC,qBAAqBA,CAClCC,gBAA+B,EAC/BC,iCAAoE,EACnD;EACjB,MAAMC,GAAG,GAAG,MAAMF,gBAAgB,CAACG,YAAY,CAAC,CAAC;EACjD,MAAMC,SAAS,GAAGV,GAAG,CAACW,KAAK,CAACH,GAAG,CAAC;EAChC,MAAMI,aAAa,GAAG,MAAMb,UAAU,CAACW,SAAS,CAAC;EACjD,MAAMG,SAAS,GAAG;IAAE,GAAGH,SAAS;IAAEI,GAAG,EAAEF;EAAc,CAAC;EAEtD,OAAO,IAAId,OAAO,CAACQ,gBAAgB,CAAC,CACjCS,UAAU,CAAC;IACVC,GAAG,EAAEJ,aAAa;IAClBK,GAAG,EAAEV,iCAAiC,CAACW,OAAO,CAACF,GAAG;IAClDG,GAAG,EAAG,GAAEhB,IAAI,CAACiB,EAAE,CAAC,CAAE,EAAC;IACnBC,KAAK,EAAG,GAAElB,IAAI,CAACiB,EAAE,CAAC,CAAE,EAAC;IACrBE,GAAG,EAAE;MACHd,GAAG,EAAEP,sBAAsB,CAACY,SAAS;IACvC;EACF,CAAC,CAAC,CACDU,kBAAkB,CAAC;IAClBT,GAAG,EAAED,SAAS,CAACC,GAAG;IAClBU,GAAG,EAAE;EACP,CAAC,CAAC,CACDC,WAAW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,MAAO,EACpC,CAAC;EACH,CAAC;AAAA"}
@@ -3,10 +3,8 @@ import * as PID from "./pid";
3
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 { getUnsignedDPop } from "./utils/dpop";
7
- import { RelyingPartySolution } from "./rp";
8
- import { RpEntityConfiguration } from "./rp/types";
9
- import { verifyTrustChain, getEntityConfiguration } from "./trust";
10
- import { EntityConfiguration, EntityStatement, TrustAnchorEntityConfiguration } from "./trust/types";
11
- export { PID, RP, WalletInstanceAttestation, Errors, getUnsignedDPop, RelyingPartySolution, verifyTrustChain, getEntityConfiguration, EntityConfiguration, EntityStatement, RpEntityConfiguration, TrustAnchorEntityConfiguration, };
6
+ import * as RelyingPartySolution from "./rp";
7
+ import { verifyTrustChain, getEntityConfiguration, getCredentialIssuerEntityConfiguration, getRelyingPartyEntityConfiguration, getTrustAnchorEntityConfiguration, getWalletProviderEntityConfiguration } from "./trust";
8
+ import { createCryptoContextFor } from "./utils/crypto";
9
+ export { PID, RP, WalletInstanceAttestation, Errors, RelyingPartySolution, verifyTrustChain, getEntityConfiguration, getCredentialIssuerEntityConfiguration, getRelyingPartyEntityConfiguration, getTrustAnchorEntityConfiguration, getWalletProviderEntityConfiguration, createCryptoContextFor, };
12
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,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,MAAM,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,8BAA8B,EAC/B,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,GAAG,EACH,EAAE,EACF,yBAAyB,EACzB,MAAM,EACN,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,8BAA8B,GAC/B,CAAC"}
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,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,GACvB,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import * as SdJwt from "./sd-jwt";
2
- import { Issuing } from "./issuing";
2
+ import * as Issuing from "./issuing";
3
3
  export { SdJwt, Issuing };
4
4
  //# 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,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,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,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC"}
@@ -1,14 +1,19 @@
1
- import { JWK } from "../utils/jwk";
2
- import { PidIssuerEntityConfiguration } from "./metadata";
1
+ /// <reference types="react-native" />
2
+ import { type CryptoContext } from "@pagopa/io-react-native-jwt";
3
+ import { CredentialIssuerEntityConfiguration } from "../trust/types";
3
4
  export type CieData = {
4
5
  birthDate: string;
5
6
  fiscalCode: string;
6
7
  name: string;
7
8
  surname: string;
8
9
  };
9
- export type TokenResponse = {
10
- access_token: string;
11
- c_nonce: string;
10
+ export type AuthorizationConf = {
11
+ accessToken: string;
12
+ nonce: string;
13
+ clientId: string;
14
+ authorizationCode: string;
15
+ codeVerifier: string;
16
+ walletProviderBaseUrl: string;
12
17
  };
13
18
  export type PidResponse = {
14
19
  credential: string;
@@ -16,87 +21,37 @@ export type PidResponse = {
16
21
  c_nonce_expires_in: number;
17
22
  format: string;
18
23
  };
19
- export declare class Issuing {
20
- pidProviderBaseUrl: string;
21
- walletProviderBaseUrl: string;
22
- walletInstanceAttestation: string;
23
- codeVerifier: string;
24
- clientId: string;
25
- state: string;
26
- authorizationCode: string;
27
- appFetch: GlobalFetch["fetch"];
28
- constructor(pidProviderBaseUrl: string, walletProviderBaseUrl: string, walletInstanceAttestation: string, clientId: string, appFetch?: GlobalFetch["fetch"]);
29
- /**
30
- * Return the unsigned jwt to call the PAR request.
31
- *
32
- * @function
33
- * @param jwk The wallet instance attestation public JWK
34
- *
35
- * @returns Unsigned jwt
36
- *
37
- */
38
- getUnsignedJwtForPar(jwk: JWK): Promise<string>;
39
- /**
40
- * Make a PAR request to the PID issuer and return the response url
41
- *
42
- * @function
43
- * @param unsignedJwtForPar The unsigned JWT for PAR
44
- * @param signature The JWT for PAR signature
45
- *
46
- * @returns Unsigned PAR url
47
- *
48
- */
49
- getPar(unsignedJwtForPar: string, signature: string): Promise<string>;
50
- /**
51
- * Return the unsigned jwt for a generic DPoP
52
- *
53
- * @function
54
- * @param jwk the public key for which the DPoP is to be created
55
- *
56
- * @returns Unsigned JWT for DPoP
57
- *
58
- */
59
- getUnsignedDPoP(jwk: JWK): Promise<string>;
60
- /**
61
- * Make an auth token request to the PID issuer
62
- *
63
- * @function
64
- * @returns a token response
65
- *
66
- */
67
- getAuthToken(): Promise<TokenResponse>;
68
- /**
69
- * Return the unsigned jwt for nonce proof of possession
70
- *
71
- * @function
72
- * @param nonce the nonce
73
- *
74
- * @returns Unsigned JWT for nonce proof
75
- *
76
- */
77
- getUnsignedNonceProof(nonce: string): Promise<string>;
78
- /**
79
- * Make the credential issuing request to the PID issuer
80
- *
81
- * @function
82
- * @param unsignedDPopForPid The unsigned JWT for PID DPoP
83
- * @param dPopPidSignature The JWT for PID DPoP signature
84
- * @param unsignedNonceProof The unsigned JWT for nonce proof
85
- * @param nonceProofSignature The JWT for nonce proof signature
86
- * @param accessToken The access token obtained with getAuthToken
87
- * @param cieData Personal data read by the CIE
88
- *
89
- * @returns a credential
90
- *
91
- */
92
- getCredential(unsignedDPopForPid: string, dPopPidSignature: string, unsignedNonceProof: string, nonceProofSignature: string, accessToken: string, cieData: CieData): Promise<PidResponse>;
93
- /**
94
- * Obtain the PID issuer metadata
95
- *
96
- * @function
97
- * @returns PID issuer metadata
98
- *
99
- */
100
- getEntityConfiguration(): Promise<PidIssuerEntityConfiguration>;
101
- }
24
+ /**
25
+ * Start the issuing flow by generating an authorization request to the PID Provider. Obtain from the PID Provider an access token to be used to complete the issuing flow.
26
+ *
27
+ * @param params.wiaCryptoContext The key pair associated with the WIA. Will be use to prove the ownership of the attestation.
28
+ * @param params.appFetch (optional) Http client
29
+ * @param walletInstanceAttestation Wallet Instance Attestation token.
30
+ * @param walletProviderBaseUrl Base url for the Wallet Provider
31
+ * @param pidProviderEntityConfiguration The Entity Configuration of the PID Provider, from which discover public endooints.
32
+ * @returns The access token along with the values that identify the issuing session.
33
+ */
34
+ export declare const authorizeIssuing: ({ wiaCryptoContext, appFetch, }: {
35
+ wiaCryptoContext: CryptoContext;
36
+ appFetch?: {
37
+ (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
38
+ (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
39
+ } | undefined;
40
+ }) => (walletInstanceAttestation: string, walletProviderBaseUrl: string, pidProviderEntityConfiguration: CredentialIssuerEntityConfiguration) => Promise<AuthorizationConf>;
41
+ /**
42
+ * Complete the issuing flow and get the PID credential.
43
+ *
44
+ * @param params.pidCryptoContext The key pair associated with the PID. Will be use to prove the ownership of the credential.
45
+ * @param params.appFetch (optional) Http client
46
+ * @param authConf The authorization configuration retrieved with the access token
47
+ * @param cieData Data red from the CIE login process
48
+ * @returns The PID credential token
49
+ */
50
+ export declare const getCredential: ({ pidCryptoContext, appFetch, }: {
51
+ pidCryptoContext: CryptoContext;
52
+ appFetch?: {
53
+ (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
54
+ (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
55
+ } | undefined;
56
+ }) => ({ nonce, accessToken, clientId, walletProviderBaseUrl }: AuthorizationConf, pidProviderEntityConfiguration: CredentialIssuerEntityConfiguration, cieData: CieData) => Promise<PidResponse>;
102
57
  //# sourceMappingURL=issuing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"issuing.d.ts","sourceRoot":"","sources":["../../../src/pid/issuing.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,GAAG,EAAE,MA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