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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. package/README.md +98 -22
  2. package/lib/commonjs/index.js +12 -8
  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 +152 -169
  7. package/lib/commonjs/pid/issuing.js.map +1 -1
  8. package/lib/commonjs/pid/metadata.js +28 -25
  9. package/lib/commonjs/pid/metadata.js.map +1 -1
  10. package/lib/commonjs/rp/__test__/index.test.js +5 -3
  11. package/lib/commonjs/rp/__test__/index.test.js.map +1 -1
  12. package/lib/commonjs/rp/index.js +158 -154
  13. package/lib/commonjs/rp/index.js.map +1 -1
  14. package/lib/commonjs/trust/types.js +9 -7
  15. package/lib/commonjs/trust/types.js.map +1 -1
  16. package/lib/commonjs/utils/crypto.js +46 -0
  17. package/lib/commonjs/utils/crypto.js.map +1 -0
  18. package/lib/commonjs/utils/dpop.js +14 -7
  19. package/lib/commonjs/utils/dpop.js.map +1 -1
  20. package/lib/commonjs/wallet-instance-attestation/index.js +3 -3
  21. package/lib/commonjs/wallet-instance-attestation/issuing.js +50 -60
  22. package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
  23. package/lib/module/index.js +4 -3
  24. package/lib/module/index.js.map +1 -1
  25. package/lib/module/pid/index.js +1 -1
  26. package/lib/module/pid/index.js.map +1 -1
  27. package/lib/module/pid/issuing.js +151 -172
  28. package/lib/module/pid/issuing.js.map +1 -1
  29. package/lib/module/pid/metadata.js +28 -25
  30. package/lib/module/pid/metadata.js.map +1 -1
  31. package/lib/module/rp/__test__/index.test.js +1 -1
  32. package/lib/module/rp/__test__/index.test.js.map +1 -1
  33. package/lib/module/rp/index.js +155 -153
  34. package/lib/module/rp/index.js.map +1 -1
  35. package/lib/module/trust/types.js +7 -6
  36. package/lib/module/trust/types.js.map +1 -1
  37. package/lib/module/utils/crypto.js +40 -0
  38. package/lib/module/utils/crypto.js.map +1 -0
  39. package/lib/module/utils/dpop.js +13 -5
  40. package/lib/module/utils/dpop.js.map +1 -1
  41. package/lib/module/wallet-instance-attestation/index.js +2 -2
  42. package/lib/module/wallet-instance-attestation/index.js.map +1 -1
  43. package/lib/module/wallet-instance-attestation/issuing.js +48 -58
  44. package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
  45. package/lib/typescript/index.d.ts +4 -3
  46. package/lib/typescript/index.d.ts.map +1 -1
  47. package/lib/typescript/pid/index.d.ts +1 -1
  48. package/lib/typescript/pid/index.d.ts.map +1 -1
  49. package/lib/typescript/pid/issuing.d.ts +51 -87
  50. package/lib/typescript/pid/issuing.d.ts.map +1 -1
  51. package/lib/typescript/pid/metadata.d.ts +1338 -408
  52. package/lib/typescript/pid/metadata.d.ts.map +1 -1
  53. package/lib/typescript/rp/index.d.ts +48 -86
  54. package/lib/typescript/rp/index.d.ts.map +1 -1
  55. package/lib/typescript/rp/types.d.ts +413 -57
  56. package/lib/typescript/rp/types.d.ts.map +1 -1
  57. package/lib/typescript/sd-jwt/index.d.ts +1 -1
  58. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  59. package/lib/typescript/trust/types.d.ts +1000 -274
  60. package/lib/typescript/trust/types.d.ts.map +1 -1
  61. package/lib/typescript/utils/crypto.d.ts +10 -0
  62. package/lib/typescript/utils/crypto.d.ts.map +1 -0
  63. package/lib/typescript/utils/dpop.d.ts +10 -2
  64. package/lib/typescript/utils/dpop.d.ts.map +1 -1
  65. package/lib/typescript/wallet-instance-attestation/index.d.ts +2 -2
  66. package/lib/typescript/wallet-instance-attestation/index.d.ts.map +1 -1
  67. package/lib/typescript/wallet-instance-attestation/issuing.d.ts +17 -31
  68. package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
  69. package/package.json +2 -2
  70. package/src/index.ts +5 -3
  71. package/src/pid/index.ts +1 -1
  72. package/src/pid/issuing.ts +233 -226
  73. package/src/pid/metadata.ts +32 -27
  74. package/src/rp/__test__/index.test.ts +1 -1
  75. package/src/rp/index.ts +180 -188
  76. package/src/sd-jwt/index.ts +1 -1
  77. package/src/trust/types.ts +39 -32
  78. package/src/utils/crypto.ts +41 -0
  79. package/src/utils/dpop.ts +17 -7
  80. package/src/wallet-instance-attestation/index.ts +2 -2
  81. package/src/wallet-instance-attestation/issuing.ts +55 -62
@@ -1,46 +1,46 @@
1
- import { decode as decodeJwt, verify as verifyJwt, sha256ToBase64 } from "@pagopa/io-react-native-jwt";
2
- import { SignJWT, thumbprint } from "@pagopa/io-react-native-jwt";
1
+ import { sha256ToBase64, SignJWT, thumbprint } from "@pagopa/io-react-native-jwt";
3
2
  import { JWK } from "../utils/jwk";
4
3
  import uuid from "react-native-uuid";
5
- import { PidIssuingError, PidMetadataError } from "../utils/errors";
6
- import { getUnsignedDPop } from "../utils/dpop";
7
- import { sign, generate, deleteKey } from "@pagopa/io-react-native-crypto";
4
+ import { PidIssuingError } from "../utils/errors";
5
+ import { createDPopToken } from "../utils/dpop";
8
6
  import { PidIssuerEntityConfiguration } from "./metadata";
9
- import { fixBase64EncodingOnKey } from "./../utils/jwk";
10
-
7
+ import { createCryptoContextFor, getEntityConfiguration as getGenericEntityConfiguration } from "..";
8
+ import { generate, deleteKey } from "@pagopa/io-react-native-crypto";
9
+ import { SdJwt } from ".";
11
10
  // This is a temporary type that will be used for demo purposes only
12
11
 
13
- export class Issuing {
14
- constructor(pidProviderBaseUrl, walletProviderBaseUrl, walletInstanceAttestation, clientId) {
15
- let appFetch = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : fetch;
16
- this.pidProviderBaseUrl = pidProviderBaseUrl;
17
- this.walletProviderBaseUrl = walletProviderBaseUrl;
18
- this.state = `${uuid.v4()}`;
19
- this.codeVerifier = `${uuid.v4()}`;
20
- this.authorizationCode = `${uuid.v4()}`;
21
- this.walletInstanceAttestation = walletInstanceAttestation;
22
- this.clientId = clientId;
23
- this.appFetch = appFetch;
24
- }
12
+ /**
13
+ * Obtain the PID provider entity configuration.
14
+ */
15
+ export const getEntityConfiguration = function () {
16
+ let {
17
+ appFetch = fetch
18
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
19
+ return async relyingPartyBaseUrl => {
20
+ return getGenericEntityConfiguration(relyingPartyBaseUrl, {
21
+ appFetch: appFetch
22
+ }).then(PidIssuerEntityConfiguration.parse);
23
+ };
24
+ };
25
25
 
26
- /**
27
- * Return the unsigned jwt to call the PAR request.
28
- *
29
- * @function
30
- * @param jwk The wallet instance attestation public JWK
31
- *
32
- * @returns Unsigned jwt
33
- *
34
- */
35
- async getUnsignedJwtForPar(jwk) {
36
- const parsedJwk = JWK.parse(jwk);
37
- const keyThumbprint = await thumbprint(parsedJwk);
38
- const publicKey = {
39
- ...parsedJwk,
26
+ /**
27
+ * Make a PAR request to the PID issuer and return the response url
28
+ */
29
+ const getPar = _ref => {
30
+ let {
31
+ wiaCryptoContext,
32
+ appFetch = fetch
33
+ } = _ref;
34
+ return async (clientId, codeVerifier, walletProviderBaseUrl, pidProviderEntityConfiguration, walletInstanceAttestation) => {
35
+ // Calculate the thumbprint of the public key of the Wallet Instance Attestation.
36
+ // The PAR request token is signed used the Wallet Instance Attestation key.
37
+ // The signature can be verified by reading the public key from the key set shippet with the it will ship the Wallet Instance Attestation;
38
+ // key is matched by its kid, which is supposed to be the thumbprint of its public key.
39
+ const keyThumbprint = await wiaCryptoContext.getPublicKey().then(JWK.parse).then(thumbprint);
40
+ const codeChallenge = await sha256ToBase64(codeVerifier);
41
+ const signedJwtForPar = await new SignJWT(wiaCryptoContext).setProtectedHeader({
40
42
  kid: keyThumbprint
41
- };
42
- const codeChallenge = await sha256ToBase64(this.codeVerifier);
43
- const unsignedJwtForPar = new SignJWT({
43
+ }).setPayload({
44
44
  client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
45
45
  authorization_details: [{
46
46
  credentialDefinition: {
@@ -51,42 +51,23 @@ export class Issuing {
51
51
  }],
52
52
  response_type: "code",
53
53
  code_challenge_method: "s256",
54
- redirect_uri: this.walletProviderBaseUrl,
55
- state: this.state,
56
- client_id: this.clientId,
54
+ redirect_uri: walletProviderBaseUrl,
55
+ state: `${uuid.v4()}`,
56
+ client_id: clientId,
57
57
  code_challenge: codeChallenge
58
- }).setProtectedHeader({
59
- alg: "ES256",
60
- kid: publicKey.kid
61
- }).setIssuedAt().setExpirationTime("1h").toSign();
62
- return unsignedJwtForPar;
63
- }
64
-
65
- /**
66
- * Make a PAR request to the PID issuer and return the response url
67
- *
68
- * @function
69
- * @param unsignedJwtForPar The unsigned JWT for PAR
70
- * @param signature The JWT for PAR signature
71
- *
72
- * @returns Unsigned PAR url
73
- *
74
- */
75
- async getPar(unsignedJwtForPar, signature) {
76
- const codeChallenge = await sha256ToBase64(this.codeVerifier);
77
- const signedJwtForPar = await SignJWT.appendSignature(unsignedJwtForPar, signature);
78
- const parUrl = new URL("/as/par", this.pidProviderBaseUrl).href;
58
+ }).setIssuedAt().setExpirationTime("1h").sign();
59
+ const parUrl = pidProviderEntityConfiguration.payload.metadata.openid_credential_issuer.pushed_authorization_request_endpoint;
79
60
  const requestBody = {
80
61
  response_type: "code",
81
- client_id: this.clientId,
62
+ client_id: clientId,
82
63
  code_challenge: codeChallenge,
83
64
  code_challenge_method: "S256",
84
65
  client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
85
- client_assertion: this.walletInstanceAttestation,
66
+ client_assertion: walletInstanceAttestation,
86
67
  request: signedJwtForPar
87
68
  };
88
69
  var formBody = new URLSearchParams(requestBody);
89
- const response = await this.appFetch(parUrl, {
70
+ const response = await appFetch(parUrl, {
90
71
  method: "POST",
91
72
  headers: {
92
73
  "Content-Type": "application/x-www-form-urlencoded"
@@ -98,55 +79,56 @@ export class Issuing {
98
79
  return result.request_uri;
99
80
  }
100
81
  throw new PidIssuingError(`Unable to obtain PAR. Response code: ${await response.text()}`);
101
- }
82
+ };
83
+ };
84
+
85
+ /**
86
+ * 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.
87
+ *
88
+ * @param params.wiaCryptoContext The key pair associated with the WIA. Will be use to prove the ownership of the attestation.
89
+ * @param params.appFetch (optional) Http client
90
+ * @param walletInstanceAttestation Wallet Instance Attestation token.
91
+ * @param walletProviderBaseUrl Base url for the Wallet Provider
92
+ * @param pidProviderEntityConfiguration The Entity Configuration of the PID Provider, from which discover public endooints.
93
+ * @returns The access token along with the values that identify the issuing session.
94
+ */
95
+ export const authorizeIssuing = _ref2 => {
96
+ let {
97
+ wiaCryptoContext,
98
+ appFetch = fetch
99
+ } = _ref2;
100
+ return async (walletInstanceAttestation, walletProviderBaseUrl, pidProviderEntityConfiguration) => {
101
+ // FIXME: do better
102
+ const clientId = await wiaCryptoContext.getPublicKey().then(_ => _.kid);
103
+ const codeVerifier = `${uuid.v4()}`;
104
+ const authorizationCode = `${uuid.v4()}`;
105
+ const tokenUrl = pidProviderEntityConfiguration.payload.metadata.openid_credential_issuer.token_endpoint;
106
+ await getPar({
107
+ wiaCryptoContext,
108
+ appFetch
109
+ })(clientId, codeVerifier, walletProviderBaseUrl, pidProviderEntityConfiguration, walletInstanceAttestation);
102
110
 
103
- /**
104
- * Return the unsigned jwt for a generic DPoP
105
- *
106
- * @function
107
- * @param jwk the public key for which the DPoP is to be created
108
- *
109
- * @returns Unsigned JWT for DPoP
110
- *
111
- */
112
- async getUnsignedDPoP(jwk) {
113
- const tokenUrl = new URL("/token", this.pidProviderBaseUrl).href;
114
- const dPop = getUnsignedDPop(fixBase64EncodingOnKey(jwk), {
111
+ // Use an ephemeral key to be destroyed after use
112
+ const keytag = `ephemeral-${uuid.v4()}`;
113
+ await generate(keytag);
114
+ const ephemeralContext = createCryptoContextFor(keytag);
115
+ const signedDPop = await createDPopToken({
115
116
  htm: "POST",
116
117
  htu: tokenUrl,
117
118
  jti: `${uuid.v4()}`
118
- });
119
- return dPop;
120
- }
121
-
122
- /**
123
- * Make an auth token request to the PID issuer
124
- *
125
- * @function
126
- * @returns a token response
127
- *
128
- */
129
- async getAuthToken() {
130
- //Generate fresh keys for DPoP
131
- const dPopKeyTag = `${uuid.v4()}`;
132
- const dPopKey = await generate(dPopKeyTag);
133
- const unsignedDPopForToken = await this.getUnsignedDPoP(dPopKey);
134
- const dPopTokenSignature = await sign(unsignedDPopForToken, dPopKeyTag);
135
- await deleteKey(dPopKeyTag);
136
- const signedDPop = await SignJWT.appendSignature(unsignedDPopForToken, dPopTokenSignature);
137
- const decodedJwtDPop = decodeJwt(signedDPop);
138
- const tokenUrl = decodedJwtDPop.payload.htu;
119
+ }, ephemeralContext);
120
+ await deleteKey(keytag);
139
121
  const requestBody = {
140
122
  grant_type: "authorization code",
141
- client_id: this.clientId,
142
- code: this.authorizationCode,
143
- code_verifier: this.codeVerifier,
123
+ client_id: clientId,
124
+ code: authorizationCode,
125
+ code_verifier: codeVerifier,
144
126
  client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
145
- client_assertion: this.walletInstanceAttestation,
146
- redirect_uri: this.walletProviderBaseUrl
127
+ client_assertion: walletInstanceAttestation,
128
+ redirect_uri: walletProviderBaseUrl
147
129
  };
148
130
  var formBody = new URLSearchParams(requestBody);
149
- const response = await this.appFetch(tokenUrl, {
131
+ const response = await appFetch(tokenUrl, {
150
132
  method: "POST",
151
133
  headers: {
152
134
  "Content-Type": "application/x-www-form-urlencoded",
@@ -155,48 +137,62 @@ export class Issuing {
155
137
  body: formBody.toString()
156
138
  });
157
139
  if (response.status === 200) {
158
- return await response.json();
140
+ const {
141
+ c_nonce,
142
+ access_token
143
+ } = await response.json();
144
+ return {
145
+ accessToken: access_token,
146
+ nonce: c_nonce,
147
+ clientId,
148
+ codeVerifier,
149
+ authorizationCode,
150
+ walletProviderBaseUrl
151
+ };
159
152
  }
160
153
  throw new PidIssuingError(`Unable to obtain token. Response code: ${await response.text()}`);
161
- }
154
+ };
155
+ };
162
156
 
163
- /**
164
- * Return the unsigned jwt for nonce proof of possession
165
- *
166
- * @function
167
- * @param nonce the nonce
168
- *
169
- * @returns Unsigned JWT for nonce proof
170
- *
171
- */
172
- async getUnsignedNonceProof(nonce) {
173
- const unsignedProof = new SignJWT({
174
- nonce
175
- }).setProtectedHeader({
176
- alg: "ES256",
177
- type: "openid4vci-proof+jwt"
178
- }).setAudience(this.walletProviderBaseUrl).setIssuer(this.clientId).setIssuedAt().setExpirationTime("1h").toSign();
179
- return unsignedProof;
180
- }
157
+ /**
158
+ * Return the signed jwt for nonce proof of possession
159
+ */
160
+ const createNonceProof = async (nonce, issuer, audience, ctx) => {
161
+ return new SignJWT(ctx).setPayload({
162
+ nonce
163
+ }).setProtectedHeader({
164
+ type: "openid4vci-proof+jwt"
165
+ }).setAudience(audience).setIssuer(issuer).setIssuedAt().setExpirationTime("1h").sign();
166
+ };
181
167
 
182
- /**
183
- * Make the credential issuing request to the PID issuer
184
- *
185
- * @function
186
- * @param unsignedDPopForPid The unsigned JWT for PID DPoP
187
- * @param dPopPidSignature The JWT for PID DPoP signature
188
- * @param unsignedNonceProof The unsigned JWT for nonce proof
189
- * @param nonceProofSignature The JWT for nonce proof signature
190
- * @param accessToken The access token obtained with getAuthToken
191
- * @param cieData Personal data read by the CIE
192
- *
193
- * @returns a credential
194
- *
195
- */
196
- async getCredential(unsignedDPopForPid, dPopPidSignature, unsignedNonceProof, nonceProofSignature, accessToken, cieData) {
197
- const signedDPopForPid = await SignJWT.appendSignature(unsignedDPopForPid, dPopPidSignature);
198
- const signedNonceProof = await SignJWT.appendSignature(unsignedNonceProof, nonceProofSignature);
199
- const credentialUrl = new URL("/credential", this.pidProviderBaseUrl).href;
168
+ /**
169
+ * Complete the issuing flow and get the PID credential.
170
+ *
171
+ * @param params.pidCryptoContext The key pair associated with the PID. Will be use to prove the ownership of the credential.
172
+ * @param params.appFetch (optional) Http client
173
+ * @param authConf The authorization configuration retrieved with the access token
174
+ * @param cieData Data red from the CIE login process
175
+ * @returns The PID credential token
176
+ */
177
+ export const getCredential = _ref3 => {
178
+ let {
179
+ pidCryptoContext,
180
+ appFetch = fetch
181
+ } = _ref3;
182
+ return async (_ref4, pidProviderEntityConfiguration, cieData) => {
183
+ let {
184
+ nonce,
185
+ accessToken,
186
+ clientId,
187
+ walletProviderBaseUrl
188
+ } = _ref4;
189
+ const signedDPopForPid = await createDPopToken({
190
+ htm: "POST",
191
+ htu: pidProviderEntityConfiguration.payload.metadata.openid_credential_issuer.token_endpoint,
192
+ jti: `${uuid.v4()}`
193
+ }, pidCryptoContext);
194
+ const signedNonceProof = await createNonceProof(nonce, clientId, walletProviderBaseUrl, pidCryptoContext);
195
+ const credentialUrl = pidProviderEntityConfiguration.payload.metadata.openid_credential_issuer.credential_endpoint;
200
196
  const requestBody = {
201
197
  credential_definition: JSON.stringify({
202
198
  type: ["eu.eudiw.pid.it"]
@@ -209,7 +205,7 @@ export class Issuing {
209
205
  })
210
206
  };
211
207
  const formBody = new URLSearchParams(requestBody);
212
- const response = await this.appFetch(credentialUrl, {
208
+ const response = await appFetch(credentialUrl, {
213
209
  method: "POST",
214
210
  headers: {
215
211
  "Content-Type": "application/x-www-form-urlencoded",
@@ -219,36 +215,19 @@ export class Issuing {
219
215
  body: formBody.toString()
220
216
  });
221
217
  if (response.status === 200) {
222
- return await response.json();
223
- }
224
- throw new PidIssuingError(`Unable to obtain credential!`);
225
- }
226
-
227
- /**
228
- * Obtain the PID issuer metadata
229
- *
230
- * @function
231
- * @returns PID issuer metadata
232
- *
233
- */
234
- async getEntityConfiguration() {
235
- const metadataUrl = new URL("ci/.well-known/openid-federation", this.pidProviderBaseUrl).href;
236
- const response = await this.appFetch(metadataUrl);
237
- if (response.status === 200) {
238
- const jwtMetadata = await response.text();
239
- const {
240
- payload
241
- } = decodeJwt(jwtMetadata);
242
- const result = PidIssuerEntityConfiguration.safeParse(payload);
243
- if (result.success) {
244
- const parsedMetadata = result.data;
245
- await verifyJwt(jwtMetadata, parsedMetadata.jwks.keys);
246
- return parsedMetadata;
247
- } else {
248
- throw new PidMetadataError(result.error.message);
249
- }
218
+ const pidResponse = await response.json();
219
+ await validatePid(pidResponse.credential, pidCryptoContext);
220
+ return pidResponse;
250
221
  }
251
- throw new PidMetadataError(`Unable to obtain PID metadata. Response: ${await response.text()} with status: ${response.status}`);
222
+ throw new PidIssuingError(`Unable to obtain credential! url=${credentialUrl} status=${response.status} body=${await response.text()}`);
223
+ };
224
+ };
225
+ const validatePid = async (pidJwt, pidCryptoContext) => {
226
+ const decoded = SdJwt.decode(pidJwt);
227
+ const pidKey = await pidCryptoContext.getPublicKey();
228
+ const holderBindedKey = decoded.sdJwt.payload.cnf.jwk;
229
+ if ((await thumbprint(pidKey)) !== (await thumbprint(holderBindedKey))) {
230
+ throw new PidIssuingError(`The obtained pid does not seem to be valid according to your configuration. Your PID public key is: ${JSON.stringify(pidKey)} but PID holder binded key is: ${JSON.stringify(holderBindedKey)}`);
252
231
  }
253
- }
232
+ };
254
233
  //# sourceMappingURL=issuing.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["decode","decodeJwt","verify","verifyJwt","sha256ToBase64","SignJWT","thumbprint","JWK","uuid","PidIssuingError","PidMetadataError","getUnsignedDPop","sign","generate","deleteKey","PidIssuerEntityConfiguration","fixBase64EncodingOnKey","Issuing","constructor","pidProviderBaseUrl","walletProviderBaseUrl","walletInstanceAttestation","clientId","appFetch","arguments","length","undefined","fetch","state","v4","codeVerifier","authorizationCode","getUnsignedJwtForPar","jwk","parsedJwk","parse","keyThumbprint","publicKey","kid","codeChallenge","unsignedJwtForPar","client_assertion_type","authorization_details","credentialDefinition","type","format","response_type","code_challenge_method","redirect_uri","client_id","code_challenge","setProtectedHeader","alg","setIssuedAt","setExpirationTime","toSign","getPar","signature","signedJwtForPar","appendSignature","parUrl","URL","href","requestBody","client_assertion","request","formBody","URLSearchParams","response","method","headers","body","toString","status","result","json","request_uri","text","getUnsignedDPoP","tokenUrl","dPop","htm","htu","jti","getAuthToken","dPopKeyTag","dPopKey","unsignedDPopForToken","dPopTokenSignature","signedDPop","decodedJwtDPop","payload","grant_type","code","code_verifier","DPoP","getUnsignedNonceProof","nonce","unsignedProof","setAudience","setIssuer","getCredential","unsignedDPopForPid","dPopPidSignature","unsignedNonceProof","nonceProofSignature","accessToken","cieData","signedDPopForPid","signedNonceProof","credentialUrl","credential_definition","JSON","stringify","proof","jwt","proof_type","Authorization","getEntityConfiguration","metadataUrl","jwtMetadata","safeParse","success","parsedMetadata","data","jwks","keys","error","message"],"sourceRoot":"../../../src","sources":["pid/issuing.ts"],"mappings":"AAAA,SACEA,MAAM,IAAIC,SAAS,EACnBC,MAAM,IAAIC,SAAS,EACnBC,cAAc,QACT,6BAA6B;AAEpC,SAASC,OAAO,EAAEC,UAAU,QAAQ,6BAA6B;AACjE,SAASC,GAAG,QAAQ,cAAc;AAClC,OAAOC,IAAI,MAAM,mBAAmB;AACpC,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,iBAAiB;AACnE,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAASC,IAAI,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,gCAAgC;AAC1E,SAASC,4BAA4B,QAAQ,YAAY;AACzD,SAASC,sBAAsB,QAAQ,gBAAgB;;AAEvD;;AAgBA,OAAO,MAAMC,OAAO,CAAC;EAUnBC,WAAWA,CACTC,kBAA0B,EAC1BC,qBAA6B,EAC7BC,yBAAiC,EACjCC,QAAgB,EAEhB;IAAA,IADAC,QAA8B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGG,KAAK;IAEtC,IAAI,CAACR,kBAAkB,GAAGA,kBAAkB;IAC5C,IAAI,CAACC,qBAAqB,GAAGA,qBAAqB;IAClD,IAAI,CAACQ,KAAK,GAAI,GAAEpB,IAAI,CAACqB,EAAE,CAAC,CAAE,EAAC;IAC3B,IAAI,CAACC,YAAY,GAAI,GAAEtB,IAAI,CAACqB,EAAE,CAAC,CAA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CAAC;IAEjD,IAAInD,QAAQ,CAACK,MAAM,KAAK,GAAG,EAAE;MAC3B,MAAM+C,WAAW,GAAG,MAAMpD,QAAQ,CAACS,IAAI,CAAC,CAAC;MACzC,MAAM;QAAEc;MAAQ,CAAC,GAAG1F,SAAS,CAACuH,WAAW,CAAC;MAC1C,MAAM9C,MAAM,GAAG3D,4BAA4B,CAAC0G,SAAS,CAAC9B,OAAO,CAAC;MAC9D,IAAIjB,MAAM,CAACgD,OAAO,EAAE;QAClB,MAAMC,cAAc,GAAGjD,MAAM,CAACkD,IAAI;QAClC,MAAMzH,SAAS,CAACqH,WAAW,EAAEG,cAAc,CAACE,IAAI,CAACC,IAAI,CAAC;QACtD,OAAOH,cAAc;MACvB,CAAC,MAAM;QACL,MAAM,IAAIjH,gBAAgB,CAACgE,MAAM,CAACqD,KAAK,CAACC,OAAO,CAAC;MAClD;IACF;IAEA,MAAM,IAAItH,gBAAgB,CACvB,4CAA2C,MAAM0D,QAAQ,CAACS,IAAI,CAAC,CAAE,iBAChET,QAAQ,CAACK,MACV,EACH,CAAC;EACH;AACF"}
1
+ {"version":3,"names":["sha256ToBase64","SignJWT","thumbprint","JWK","uuid","PidIssuingError","createDPopToken","PidIssuerEntityConfiguration","createCryptoContextFor","getEntityConfiguration","getGenericEntityConfiguration","generate","deleteKey","SdJwt","appFetch","fetch","arguments","length","undefined","relyingPartyBaseUrl","then","parse","getPar","_ref","wiaCryptoContext","clientId","codeVerifier","walletProviderBaseUrl","pidProviderEntityConfiguration","walletInstanceAttestation","keyThumbprint","getPublicKey","codeChallenge","signedJwtForPar","setProtectedHeader","kid","setPayload","client_assertion_type","authorization_details","credentialDefinition","type","format","response_type","code_challenge_method","redirect_uri","state","v4","client_id","code_challenge","setIssuedAt","setExpirationTime","sign","parUrl","payload","metadata","openid_credential_issuer","pushed_authorization_request_endpoint","requestBody","client_assertion","request","formBody","URLSearchParams","response","method","headers","body","toString","status","result","json","request_uri","text","authorizeIssuing","_ref2","_","authorizationCode","tokenUrl","token_endpoint","keytag","ephemeralContext","signedDPop","htm","htu","jti","grant_type","code","code_verifier","DPoP","c_nonce","access_token","accessToken","nonce","createNonceProof","issuer","audience","ctx","setAudience","setIssuer","getCredential","_ref3","pidCryptoContext","_ref4","cieData","signedDPopForPid","signedNonceProof","credentialUrl","credential_endpoint","credential_definition","JSON","stringify","proof","jwt","proof_type","Authorization","pidResponse","validatePid","credential","pidJwt","decoded","decode","pidKey","holderBindedKey","sdJwt","cnf","jwk"],"sourceRoot":"../../../src","sources":["pid/issuing.ts"],"mappings":"AAAA,SACEA,cAAc,EAEdC,OAAO,EACPC,UAAU,QACL,6BAA6B;AACpC,SAASC,GAAG,QAAQ,cAAc;AAClC,OAAOC,IAAI,MAAM,mBAAmB;AACpC,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAASC,4BAA4B,QAAQ,YAAY;AACzD,SACEC,sBAAsB,EACtBC,sBAAsB,IAAIC,6BAA6B,QAClD,IAAI;AACX,SAASC,QAAQ,EAAEC,SAAS,QAAQ,gCAAgC;AACpE,SAASC,KAAK,QAAQ,GAAG;AACzB;;AAwBA;AACA;AACA;AACA,OAAO,MAAMJ,sBAAsB,GACjC,SAAAA,CAAA;EAAA,IAAC;IAAEK,QAAQ,GAAGC;EAA2C,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,OAC/D,MACEG,mBAA2B,IACe;IAC1C,OAAOT,6BAA6B,CAACS,mBAAmB,EAAE;MACxDL,QAAQ,EAAEA;IACZ,CAAC,CAAC,CAACM,IAAI,CAACb,4BAA4B,CAACc,KAAK,CAAC;EAC7C,CAAC;AAAA;;AAEH;AACA;AACA;AACA,MAAMC,MAAM,GACVC,IAAA;EAAA,IAAC;IACCC,gBAAgB;IAChBV,QAAQ,GAAGC;EAIb,CAAC,GAAAQ,IAAA;EAAA,OACD,OACEE,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AM,GAAG,MAAMpB,gBAAgB,CAACrE,YAAY,CAAC,CAAC;EACpD,MAAM0F,eAAe,GAAGH,OAAO,CAACI,KAAK,CAACrE,OAAO,CAACsE,GAAG,CAACC,GAAG;EAErD,IAAI,CAAC,MAAM1H,UAAU,CAACsH,MAAM,CAAC,OAAO,MAAMtH,UAAU,CAACuH,eAAe,CAAC,CAAC,EAAE;IACtE,MAAM,IAAIpH,eAAe,CACtB,uGAAsGuG,IAAI,CAACC,SAAS,CACnHW,MACF,CAAE,kCAAiCZ,IAAI,CAACC,SAAS,CAACY,eAAe,CAAE,EACrE,CAAC;EACH;AACF,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { EntityConfiguration } from "../trust/types";
1
2
  import { JWK } from "../utils/jwk";
2
3
  import { z } from "zod";
3
4
  export const PidDisplayMetadata = z.object({
@@ -10,32 +11,34 @@ export const PidDisplayMetadata = z.object({
10
11
  background_color: z.string(),
11
12
  text_color: z.string()
12
13
  });
13
- export const PidIssuerEntityConfiguration = z.object({
14
- jwks: z.object({
15
- keys: z.array(JWK)
16
- }),
17
- metadata: z.object({
18
- openid_credential_issuer: z.object({
19
- credential_issuer: z.string(),
20
- authorization_endpoint: z.string(),
21
- token_endpoint: z.string(),
22
- pushed_authorization_request_endpoint: z.string(),
23
- dpop_signing_alg_values_supported: z.array(z.string()),
24
- credential_endpoint: z.string(),
25
- credentials_supported: z.array(z.object({
26
- format: z.literal("vc+sd-jwt"),
27
- cryptographic_binding_methods_supported: z.array(z.string()),
28
- cryptographic_suites_supported: z.array(z.string()),
29
- display: z.array(PidDisplayMetadata)
30
- }))
14
+ export const PidIssuerEntityConfiguration = EntityConfiguration.and(z.object({
15
+ payload: z.object({
16
+ jwks: z.object({
17
+ keys: z.array(JWK)
31
18
  }),
32
- federation_entity: z.object({
33
- organization_name: z.string(),
34
- homepage_uri: z.string(),
35
- policy_uri: z.string(),
36
- tos_uri: z.string(),
37
- logo_uri: z.string()
19
+ metadata: z.object({
20
+ openid_credential_issuer: z.object({
21
+ credential_issuer: z.string(),
22
+ authorization_endpoint: z.string(),
23
+ token_endpoint: z.string(),
24
+ pushed_authorization_request_endpoint: z.string(),
25
+ dpop_signing_alg_values_supported: z.array(z.string()),
26
+ credential_endpoint: z.string(),
27
+ credentials_supported: z.array(z.object({
28
+ format: z.literal("vc+sd-jwt"),
29
+ cryptographic_binding_methods_supported: z.array(z.string()),
30
+ cryptographic_suites_supported: z.array(z.string()),
31
+ display: z.array(PidDisplayMetadata)
32
+ }))
33
+ }),
34
+ federation_entity: z.object({
35
+ organization_name: z.string(),
36
+ homepage_uri: z.string(),
37
+ policy_uri: z.string(),
38
+ tos_uri: z.string(),
39
+ logo_uri: z.string()
40
+ })
38
41
  })
39
42
  })
40
- });
43
+ }));
41
44
  //# sourceMappingURL=metadata.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["JWK","z","PidDisplayMetadata","object","name","string","locale","logo","url","alt_text","background_color","text_color","PidIssuerEntityConfiguration","jwks","keys","array","metadata","openid_credential_issuer","credential_issuer","authorization_endpoint","token_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","credential_endpoint","credentials_supported","format","literal","cryptographic_binding_methods_supported","cryptographic_suites_supported","display","federation_entity","organization_name","homepage_uri","policy_uri","tos_uri","logo_uri"],"sourceRoot":"../../../src","sources":["pid/metadata.ts"],"mappings":"AAAA,SAASA,GAAG,QAAQ,cAAc;AAClC,SAASC,CAAC,QAAQ,KAAK;AAGvB,OAAO,MAAMC,kBAAkB,GAAGD,CAAC,CAACE,MAAM,CAAC;EACzCC,IAAI,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EAChBC,MAAM,EAAEL,CAAC,CAACI,MAAM,CAAC,CAAC;EAClBE,IAAI,EAAEN,CAAC,CAACE,MAAM,CAAC;IACbK,GAAG,EAAEP,CAAC,CAACI,MAAM,CAAC,CAAC;IACfI,QAAQ,EAAER,CAAC,CAACI,MAAM,CAAC;EACrB,CAAC,CAAC;EACFK,gBAAg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C7B2B,YAAY,EAAE/B,CAAC,CAACI,MAAM,CAAC,CAAC;MACxB4B,UAAU,EAAEhC,CAAC,CAACI,MAAM,CAAC,CAAC;MACtB6B,OAAO,EAAEjC,CAAC,CAACI,MAAM,CAAC,CAAC;MACnB8B,QAAQ,EAAElC,CAAC,CAACI,MAAM,CAAC;IACrB,CAAC;EACH,CAAC;AACH,CAAC,CAAC"}
1
+ {"version":3,"names":["EntityConfiguration","JWK","z","PidDisplayMetadata","object","name","string","locale","logo","url","alt_text","background_color","text_color","PidIssuerEntityConfiguration","and","payload","jwks","keys","array","metadata","openid_credential_issuer","credential_issuer","authorization_endpoint","token_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","credential_endpoint","credentials_supported","format","literal","cryptographic_binding_methods_supported","cryptographic_suites_supported","display","federation_entity","organization_name","homepage_uri","policy_uri","tos_uri","logo_uri"],"sourceRoot":"../../../src","sources":["pid/metadata.ts"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,gBAAgB;AACpD,SAASC,GAAG,QAAQ,cAAc;AAClC,SAASC,CAAC,QAAQ,KAAK;AAGvB,OAAO,MAAMC,kBAAkB,GAAGD,CAAC,CAACE,MAAM,CAAC;EACzCC,IAAI,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EAChBC,MAAM,EAAEL,CAAC,CAACI,MAAM,CAAC,CAAC;EAClBE,IAAI,EAAEN,CAAC,CAACE,MAAM,CAAC;IACbK,GAAG,EAAEP,CAAC,CAACI,MAAM,CAAC,CAAC;IACfI,QAAQ,EAAER,CAAC,CAACI,MAAM,CAAC;EACrB,CAAC,CAAC;EACFK,gBAAgB,EAAET,CAAC,CAACI,MAAM,CAAC,CAAC;EAC5BM,UAAU,EAAEV,CAAC,CAACI,MAAM,CAAC;AACvB,CAAC,CAAC;AAKF,OAAO,MAAMO,4BAA4B,GAAGb,mBAAmB,CAACc,GAAG,CACjEZ,CAAC,CAACE,MAAM,CAAC;EACPW,OAAO,EAAEb,CAAC,C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AAC,CAACI,MAAM,CAAC,CAAC;QACnBgC,QAAQ,EAAEpC,CAAC,CAACI,MAAM,CAAC;MACrB,CAAC;IACH,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC"}
@@ -1,4 +1,4 @@
1
- import { RelyingPartySolution } from "..";
1
+ import * as RelyingPartySolution from "..";
2
2
  import { AuthRequestDecodeError } from "../../utils/errors";
3
3
  import { RpEntityConfiguration } from "../types";
4
4
  describe("decodeAuthRequestQR", () => {
@@ -1 +1 @@
1
- {"version":3,"names":["RelyingPartySolution","AuthRequestDecodeError","RpEntityConfiguration","describe","it","qrcode","result","decodeAuthRequestQR","expect","requestURI","toEqual","toThrowError","pp","header","alg","kid","typ","payload","exp","iat","iss","sub","jwks","keys","kty","e","n","metadata","federation_entity","organization_name","homepage_uri","policy_uri","logo_uri","contacts","wallet_relying_party","application_type","authorization_encrypted_response_alg","authorization_encrypted_response_enc","authorization_signed_response_alg","client_id","client_name","default_acr_values","default_max_age","id_token_encrypted_response_alg","id_token_encrypted_response_enc","id_token_signed_response_alg","presentation_definitions","id","input_descriptors","format","constraints","fields","filter","const","type","path","intent_to_retain","limit_disclosure","jwt","mso_mdoc","redirect_uris","request_uris","require_auth_time","subject_type","vp_formats","jwt_vp_json","crv","d","use","x","y","p","q","authority_hints","safeParse","success","error","toBe"],"sourceRoot":"../../../../src","sources":["rp/__test__/index.test.ts"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,IAAI;AACzC,SAASC,sBAAsB,QAAQ,oBAAoB;AAC3D,SAASC,qBAAqB,QAAQ,UAAU;AAEhDC,QAAQ,CAAC,qBAAqB,EAAE,MAAM;EACpCC,EAAE,CAAC,0CAA0C,EAAE,YAAY;IACzD,MAAMC,MAAM,GACV,sJAAsJ;IACxJ,MAAMC,MAAM,GAAGN,oBAAoB,CAACO,mBAAmB,CAACF,MAAM,CAAC;IAC/DG,MAAM,CAACF,MAAM,CAACG,UAAU,CAAC,CAACC,OAAO,CAC/B,0CACF,CAAC;E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CAAC,EAAE,6CAA6C;cAChDC,CAAC,EAAE;YACL,CAAC,EACD;cACE9C,GAAG,EAAE,KAAK;cACV2C,CAAC,EAAE,wVAAwV;cAC3V1C,CAAC,EAAE,MAAM;cACT2C,GAAG,EAAE,KAAK;cACVrD,GAAG,EAAE,6CAA6C;cAClDW,CAAC,EAAE,wVAAwV;cAC3V6C,CAAC,EAAE,6KAA6K;cAChLC,CAAC,EAAE;YACL,CAAC;UAEL;QACF,CAAC;QACDC,eAAe,EAAE,CACf,0DAA0D;MAE9D;IACF,CAAC;IACD,MAAMnE,MAAM,GAAGJ,qBAAqB,CAACwE,SAAS,CAAC9D,EAAE,CAAC;IAClD,IAAIN,MAAM,CAACqE,OAAO,KAAK,KAAK,EAAE;MAC5B,MAAMrE,MAAM,CAACsE,KAAK;IACpB;IACApE,MAAM,CAACF,MAAM,CAACqE,OAAO,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC;EACnC,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["RelyingPartySolution","AuthRequestDecodeError","RpEntityConfiguration","describe","it","qrcode","result","decodeAuthRequestQR","expect","requestURI","toEqual","toThrowError","pp","header","alg","kid","typ","payload","exp","iat","iss","sub","jwks","keys","kty","e","n","metadata","federation_entity","organization_name","homepage_uri","policy_uri","logo_uri","contacts","wallet_relying_party","application_type","authorization_encrypted_response_alg","authorization_encrypted_response_enc","authorization_signed_response_alg","client_id","client_name","default_acr_values","default_max_age","id_token_encrypted_response_alg","id_token_encrypted_response_enc","id_token_signed_response_alg","presentation_definitions","id","input_descriptors","format","constraints","fields","filter","const","type","path","intent_to_retain","limit_disclosure","jwt","mso_mdoc","redirect_uris","request_uris","require_auth_time","subject_type","vp_formats","jwt_vp_json","crv","d","use","x","y","p","q","authority_hints","safeParse","success","error","toBe"],"sourceRoot":"../../../../src","sources":["rp/__test__/index.test.ts"],"mappings":"AAAA,OAAO,KAAKA,oBAAoB,MAAM,IAAI;AAC1C,SAASC,sBAAsB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