@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.
- package/README.md +128 -19
- package/lib/commonjs/index.js +16 -23
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/pid/index.js +3 -8
- package/lib/commonjs/pid/index.js.map +1 -1
- package/lib/commonjs/pid/issuing.js +153 -176
- package/lib/commonjs/pid/issuing.js.map +1 -1
- package/lib/commonjs/rp/__test__/index.test.js +7 -5
- package/lib/commonjs/rp/__test__/index.test.js.map +1 -1
- package/lib/commonjs/rp/index.js +145 -155
- package/lib/commonjs/rp/index.js.map +1 -1
- package/lib/commonjs/rp/types.js +1 -21
- package/lib/commonjs/rp/types.js.map +1 -1
- package/lib/commonjs/trust/index.js +24 -5
- package/lib/commonjs/trust/index.js.map +1 -1
- package/lib/commonjs/trust/types.js +102 -9
- package/lib/commonjs/trust/types.js.map +1 -1
- package/lib/commonjs/utils/crypto.js +46 -0
- package/lib/commonjs/utils/crypto.js.map +1 -0
- package/lib/commonjs/utils/dpop.js +14 -7
- package/lib/commonjs/utils/dpop.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/index.js +3 -3
- package/lib/commonjs/wallet-instance-attestation/issuing.js +42 -60
- package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/module/index.js +4 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/pid/index.js +1 -1
- package/lib/module/pid/index.js.map +1 -1
- package/lib/module/pid/issuing.js +152 -180
- package/lib/module/pid/issuing.js.map +1 -1
- package/lib/module/rp/__test__/index.test.js +3 -3
- package/lib/module/rp/__test__/index.test.js.map +1 -1
- package/lib/module/rp/index.js +141 -154
- package/lib/module/rp/index.js.map +1 -1
- package/lib/module/rp/types.js +0 -20
- package/lib/module/rp/types.js.map +1 -1
- package/lib/module/trust/index.js +19 -5
- package/lib/module/trust/index.js.map +1 -1
- package/lib/module/trust/types.js +100 -7
- package/lib/module/trust/types.js.map +1 -1
- package/lib/module/utils/crypto.js +40 -0
- package/lib/module/utils/crypto.js.map +1 -0
- package/lib/module/utils/dpop.js +13 -5
- package/lib/module/utils/dpop.js.map +1 -1
- package/lib/module/wallet-instance-attestation/index.js +2 -2
- package/lib/module/wallet-instance-attestation/index.js.map +1 -1
- package/lib/module/wallet-instance-attestation/issuing.js +40 -58
- package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/typescript/index.d.ts +4 -6
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/pid/index.d.ts +1 -1
- package/lib/typescript/pid/index.d.ts.map +1 -1
- package/lib/typescript/pid/issuing.d.ts +43 -88
- package/lib/typescript/pid/issuing.d.ts.map +1 -1
- package/lib/typescript/rp/index.d.ts +41 -87
- package/lib/typescript/rp/index.d.ts.map +1 -1
- package/lib/typescript/rp/types.d.ts +10 -906
- package/lib/typescript/rp/types.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/index.d.ts +1 -1
- package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
- package/lib/typescript/trust/index.d.ts +806 -3
- package/lib/typescript/trust/index.d.ts.map +1 -1
- package/lib/typescript/trust/types.d.ts +9655 -297
- package/lib/typescript/trust/types.d.ts.map +1 -1
- package/lib/typescript/utils/crypto.d.ts +10 -0
- package/lib/typescript/utils/crypto.d.ts.map +1 -0
- package/lib/typescript/utils/dpop.d.ts +10 -2
- package/lib/typescript/utils/dpop.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/index.d.ts +2 -2
- package/lib/typescript/wallet-instance-attestation/index.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/issuing.d.ts +18 -31
- package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/types.d.ts +4 -4
- package/package.json +2 -2
- package/src/index.ts +14 -13
- package/src/pid/index.ts +1 -1
- package/src/pid/issuing.ts +233 -232
- package/src/rp/__test__/index.test.ts +3 -3
- package/src/rp/index.ts +172 -194
- package/src/rp/types.ts +0 -24
- package/src/sd-jwt/index.ts +1 -1
- package/src/trust/index.ts +106 -5
- package/src/trust/types.ts +152 -34
- package/src/utils/crypto.ts +41 -0
- package/src/utils/dpop.ts +17 -7
- package/src/wallet-instance-attestation/index.ts +2 -2
- package/src/wallet-instance-attestation/issuing.ts +51 -63
- package/lib/commonjs/pid/metadata.js +0 -49
- package/lib/commonjs/pid/metadata.js.map +0 -1
- package/lib/module/pid/metadata.js +0 -41
- package/lib/module/pid/metadata.js.map +0 -1
- package/lib/typescript/pid/metadata.d.ts +0 -482
- package/lib/typescript/pid/metadata.d.ts.map +0 -1
- package/src/pid/metadata.ts +0 -46
@@ -1,92 +1,65 @@
|
|
1
|
-
import {
|
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
|
6
|
-
import {
|
7
|
-
import
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
|
4
|
+
import { PidIssuingError } from "../utils/errors";
|
5
|
+
import { createDPopToken } from "../utils/dpop";
|
6
|
+
import * as WalletInstanceAttestation from "../wallet-instance-attestation";
|
7
|
+
import { generate, deleteKey } from "@pagopa/io-react-native-crypto";
|
8
|
+
import { SdJwt } from ".";
|
9
|
+
import { createCryptoContextFor } from "../utils/crypto";
|
11
10
|
// This is a temporary type that will be used for demo purposes only
|
12
11
|
|
13
|
-
|
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
|
+
const assertionType = "urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation";
|
25
13
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
14
|
+
/**
|
15
|
+
* Make a PAR request to the PID issuer and return the response url
|
16
|
+
*/
|
17
|
+
const getPar = _ref => {
|
18
|
+
let {
|
19
|
+
wiaCryptoContext,
|
20
|
+
appFetch = fetch
|
21
|
+
} = _ref;
|
22
|
+
return async (clientId, codeVerifier, walletProviderBaseUrl, pidProviderEntityConfiguration, walletInstanceAttestation) => {
|
23
|
+
// Calculate the thumbprint of the public key of the Wallet Instance Attestation.
|
24
|
+
// The PAR request token is signed used the Wallet Instance Attestation key.
|
25
|
+
// The signature can be verified by reading the public key from the key set shippet with the it will ship the Wallet Instance Attestation;
|
26
|
+
// key is matched by its kid, which is supposed to be the thumbprint of its public key.
|
27
|
+
const keyThumbprint = await wiaCryptoContext.getPublicKey().then(JWK.parse).then(thumbprint);
|
28
|
+
const iss = WalletInstanceAttestation.decode(walletInstanceAttestation).payload.cnf.jwk.kid;
|
29
|
+
const codeChallenge = await sha256ToBase64(codeVerifier);
|
30
|
+
const signedJwtForPar = await new SignJWT(wiaCryptoContext).setProtectedHeader({
|
40
31
|
kid: keyThumbprint
|
41
|
-
}
|
42
|
-
|
43
|
-
|
44
|
-
|
32
|
+
}).setPayload({
|
33
|
+
iss,
|
34
|
+
aud: pidProviderEntityConfiguration.payload.iss,
|
35
|
+
jti: `${uuid.v4()}`,
|
36
|
+
client_assertion_type: assertionType,
|
45
37
|
authorization_details: [{
|
46
|
-
|
47
|
-
type:
|
38
|
+
credential_definition: {
|
39
|
+
type: "PersonIdentificationData"
|
48
40
|
},
|
49
41
|
format: "vc+sd-jwt",
|
50
|
-
type: "
|
42
|
+
type: "openid_credential"
|
51
43
|
}],
|
52
44
|
response_type: "code",
|
53
45
|
code_challenge_method: "s256",
|
54
|
-
redirect_uri:
|
55
|
-
state:
|
56
|
-
client_id:
|
46
|
+
redirect_uri: walletProviderBaseUrl,
|
47
|
+
state: `${uuid.v4()}`,
|
48
|
+
client_id: clientId,
|
57
49
|
code_challenge: codeChallenge
|
58
|
-
}).
|
59
|
-
|
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;
|
50
|
+
}).setIssuedAt().setExpirationTime("1h").sign();
|
51
|
+
const parUrl = pidProviderEntityConfiguration.payload.metadata.openid_credential_issuer.pushed_authorization_request_endpoint;
|
79
52
|
const requestBody = {
|
80
53
|
response_type: "code",
|
81
|
-
client_id:
|
54
|
+
client_id: clientId,
|
82
55
|
code_challenge: codeChallenge,
|
83
56
|
code_challenge_method: "S256",
|
84
|
-
client_assertion_type:
|
85
|
-
client_assertion:
|
57
|
+
client_assertion_type: assertionType,
|
58
|
+
client_assertion: walletInstanceAttestation,
|
86
59
|
request: signedJwtForPar
|
87
60
|
};
|
88
61
|
var formBody = new URLSearchParams(requestBody);
|
89
|
-
const response = await
|
62
|
+
const response = await appFetch(parUrl, {
|
90
63
|
method: "POST",
|
91
64
|
headers: {
|
92
65
|
"Content-Type": "application/x-www-form-urlencoded"
|
@@ -98,55 +71,56 @@ export class Issuing {
|
|
98
71
|
return result.request_uri;
|
99
72
|
}
|
100
73
|
throw new PidIssuingError(`Unable to obtain PAR. Response code: ${await response.text()}`);
|
101
|
-
}
|
74
|
+
};
|
75
|
+
};
|
76
|
+
|
77
|
+
/**
|
78
|
+
* 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.
|
79
|
+
*
|
80
|
+
* @param params.wiaCryptoContext The key pair associated with the WIA. Will be use to prove the ownership of the attestation.
|
81
|
+
* @param params.appFetch (optional) Http client
|
82
|
+
* @param walletInstanceAttestation Wallet Instance Attestation token.
|
83
|
+
* @param walletProviderBaseUrl Base url for the Wallet Provider
|
84
|
+
* @param pidProviderEntityConfiguration The Entity Configuration of the PID Provider, from which discover public endooints.
|
85
|
+
* @returns The access token along with the values that identify the issuing session.
|
86
|
+
*/
|
87
|
+
export const authorizeIssuing = _ref2 => {
|
88
|
+
let {
|
89
|
+
wiaCryptoContext,
|
90
|
+
appFetch = fetch
|
91
|
+
} = _ref2;
|
92
|
+
return async (walletInstanceAttestation, walletProviderBaseUrl, pidProviderEntityConfiguration) => {
|
93
|
+
// FIXME: do better
|
94
|
+
const clientId = await wiaCryptoContext.getPublicKey().then(_ => _.kid);
|
95
|
+
const codeVerifier = `${uuid.v4()}`;
|
96
|
+
const authorizationCode = `${uuid.v4()}`;
|
97
|
+
const tokenUrl = pidProviderEntityConfiguration.payload.metadata.openid_credential_issuer.token_endpoint;
|
98
|
+
await getPar({
|
99
|
+
wiaCryptoContext,
|
100
|
+
appFetch
|
101
|
+
})(clientId, codeVerifier, walletProviderBaseUrl, pidProviderEntityConfiguration, walletInstanceAttestation);
|
102
102
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
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), {
|
103
|
+
// Use an ephemeral key to be destroyed after use
|
104
|
+
const keytag = `ephemeral-${uuid.v4()}`;
|
105
|
+
await generate(keytag);
|
106
|
+
const ephemeralContext = createCryptoContextFor(keytag);
|
107
|
+
const signedDPop = await createDPopToken({
|
115
108
|
htm: "POST",
|
116
109
|
htu: tokenUrl,
|
117
110
|
jti: `${uuid.v4()}`
|
118
|
-
});
|
119
|
-
|
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;
|
111
|
+
}, ephemeralContext);
|
112
|
+
await deleteKey(keytag);
|
139
113
|
const requestBody = {
|
140
114
|
grant_type: "authorization code",
|
141
|
-
client_id:
|
142
|
-
code:
|
143
|
-
code_verifier:
|
144
|
-
client_assertion_type:
|
145
|
-
client_assertion:
|
146
|
-
redirect_uri:
|
115
|
+
client_id: clientId,
|
116
|
+
code: authorizationCode,
|
117
|
+
code_verifier: codeVerifier,
|
118
|
+
client_assertion_type: assertionType,
|
119
|
+
client_assertion: walletInstanceAttestation,
|
120
|
+
redirect_uri: walletProviderBaseUrl
|
147
121
|
};
|
148
122
|
var formBody = new URLSearchParams(requestBody);
|
149
|
-
const response = await
|
123
|
+
const response = await appFetch(tokenUrl, {
|
150
124
|
method: "POST",
|
151
125
|
headers: {
|
152
126
|
"Content-Type": "application/x-www-form-urlencoded",
|
@@ -155,51 +129,66 @@ export class Issuing {
|
|
155
129
|
body: formBody.toString()
|
156
130
|
});
|
157
131
|
if (response.status === 200) {
|
158
|
-
|
132
|
+
const {
|
133
|
+
c_nonce,
|
134
|
+
access_token
|
135
|
+
} = await response.json();
|
136
|
+
return {
|
137
|
+
accessToken: access_token,
|
138
|
+
nonce: c_nonce,
|
139
|
+
clientId,
|
140
|
+
codeVerifier,
|
141
|
+
authorizationCode,
|
142
|
+
walletProviderBaseUrl
|
143
|
+
};
|
159
144
|
}
|
160
145
|
throw new PidIssuingError(`Unable to obtain token. Response code: ${await response.text()}`);
|
161
|
-
}
|
146
|
+
};
|
147
|
+
};
|
162
148
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
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
|
-
}
|
149
|
+
/**
|
150
|
+
* Return the signed jwt for nonce proof of possession
|
151
|
+
*/
|
152
|
+
const createNonceProof = async (nonce, issuer, audience, ctx) => {
|
153
|
+
return new SignJWT(ctx).setPayload({
|
154
|
+
nonce,
|
155
|
+
jwk: await ctx.getPublicKey()
|
156
|
+
}).setProtectedHeader({
|
157
|
+
type: "openid4vci-proof+jwt"
|
158
|
+
}).setAudience(audience).setIssuer(issuer).setIssuedAt().setExpirationTime("1h").sign();
|
159
|
+
};
|
181
160
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
async
|
197
|
-
|
198
|
-
|
199
|
-
|
161
|
+
/**
|
162
|
+
* Complete the issuing flow and get the PID credential.
|
163
|
+
*
|
164
|
+
* @param params.pidCryptoContext The key pair associated with the PID. Will be use to prove the ownership of the credential.
|
165
|
+
* @param params.appFetch (optional) Http client
|
166
|
+
* @param authConf The authorization configuration retrieved with the access token
|
167
|
+
* @param cieData Data red from the CIE login process
|
168
|
+
* @returns The PID credential token
|
169
|
+
*/
|
170
|
+
export const getCredential = _ref3 => {
|
171
|
+
let {
|
172
|
+
pidCryptoContext,
|
173
|
+
appFetch = fetch
|
174
|
+
} = _ref3;
|
175
|
+
return async (_ref4, pidProviderEntityConfiguration, cieData) => {
|
176
|
+
let {
|
177
|
+
nonce,
|
178
|
+
accessToken,
|
179
|
+
clientId,
|
180
|
+
walletProviderBaseUrl
|
181
|
+
} = _ref4;
|
182
|
+
const signedDPopForPid = await createDPopToken({
|
183
|
+
htm: "POST",
|
184
|
+
htu: pidProviderEntityConfiguration.payload.metadata.openid_credential_issuer.token_endpoint,
|
185
|
+
jti: `${uuid.v4()}`
|
186
|
+
}, pidCryptoContext);
|
187
|
+
const signedNonceProof = await createNonceProof(nonce, clientId, walletProviderBaseUrl, pidCryptoContext);
|
188
|
+
const credentialUrl = pidProviderEntityConfiguration.payload.metadata.openid_credential_issuer.credential_endpoint;
|
200
189
|
const requestBody = {
|
201
190
|
credential_definition: JSON.stringify({
|
202
|
-
type: ["
|
191
|
+
type: ["PersonIdentificationData"]
|
203
192
|
}),
|
204
193
|
format: "vc+sd-jwt",
|
205
194
|
proof: JSON.stringify({
|
@@ -209,7 +198,7 @@ export class Issuing {
|
|
209
198
|
})
|
210
199
|
};
|
211
200
|
const formBody = new URLSearchParams(requestBody);
|
212
|
-
const response = await
|
201
|
+
const response = await appFetch(credentialUrl, {
|
213
202
|
method: "POST",
|
214
203
|
headers: {
|
215
204
|
"Content-Type": "application/x-www-form-urlencoded",
|
@@ -219,36 +208,19 @@ export class Issuing {
|
|
219
208
|
body: formBody.toString()
|
220
209
|
});
|
221
210
|
if (response.status === 200) {
|
222
|
-
|
223
|
-
|
224
|
-
|
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
|
-
}
|
211
|
+
const pidResponse = await response.json();
|
212
|
+
await validatePid(pidResponse.credential, pidCryptoContext);
|
213
|
+
return pidResponse;
|
250
214
|
}
|
251
|
-
throw new
|
215
|
+
throw new PidIssuingError(`Unable to obtain credential! url=${credentialUrl} status=${response.status} body=${await response.text()}`);
|
216
|
+
};
|
217
|
+
};
|
218
|
+
const validatePid = async (pidJwt, pidCryptoContext) => {
|
219
|
+
const decoded = SdJwt.decode(pidJwt);
|
220
|
+
const pidKey = await pidCryptoContext.getPublicKey();
|
221
|
+
const holderBindedKey = decoded.sdJwt.payload.cnf.jwk;
|
222
|
+
if ((await thumbprint(pidKey)) !== (await thumbprint(holderBindedKey))) {
|
223
|
+
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
224
|
}
|
253
|
-
}
|
225
|
+
};
|
254
226
|
//# sourceMappingURL=issuing.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["sha256ToBase64","SignJWT","thumbprint","JWK","uuid","PidIssuingError","createDPopToken","WalletInstanceAttestation","generate","deleteKey","SdJwt","createCryptoContextFor","assertionType","getPar","_ref","wiaCryptoContext","appFetch","fetch","clientId","codeVerifier","walletProviderBaseUrl","pidProviderEntityConfiguration","walletInstanceAttestation","keyThumbprint","getPublicKey","then","parse","iss","decode","payload","cnf","jwk","kid","codeChallenge","signedJwtForPar","setProtectedHeader","setPayload","aud","jti","v4","client_assertion_type","authorization_details","credential_definition","type","format","response_type","code_challenge_method","redirect_uri","state","client_id","code_challenge","setIssuedAt","setExpirationTime","sign","parUrl","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","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","JSON","stringify","proof","jwt","proof_type","Authorization","pidResponse","validatePid","credential","pidJwt","decoded","pidKey","holderBindedKey","sdJwt"],"sourceRoot":"../../../src","sources":["pid/issuing.ts"],"mappings":"AAAA,SACEA,cAAc,EAEdC,OAAO,EACPC,UAAU,QACL,6BAA6B;AACpC,SAASC,GAA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elyingPartySolution from "..";
|
2
3
|
import { AuthRequestDecodeError } from "../../utils/errors";
|
3
|
-
import { RpEntityConfiguration } from "../types";
|
4
4
|
describe("decodeAuthRequestQR", () => {
|
5
5
|
it("should return authentication request URL", async () => {
|
6
6
|
const qrcode = "ZXVkaXc6Ly9hdXRob3JpemU/Y2xpZW50X2lkPWh0dHBzOi8vdmVyaWZpZXIuZXhhbXBsZS5vcmcmcmVxdWVzdF91cmk9aHR0cHM6Ly92ZXJpZmllci5leGFtcGxlLm9yZy9yZXF1ZXN0X3VyaQ==";
|
@@ -156,7 +156,7 @@ describe("RpEntityConfiguration", () => {
|
|
156
156
|
authority_hints: ["https://demo.federation.eudi.wallet.developers.italia.it"]
|
157
157
|
}
|
158
158
|
};
|
159
|
-
const result =
|
159
|
+
const result = RelyingPartyEntityConfiguration.safeParse(pp);
|
160
160
|
if (result.success === false) {
|
161
161
|
throw result.error;
|
162
162
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["RelyingPartyEntityConfiguration","RelyingPartySolution","AuthRequestDecodeError","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,+BAA+B,QAAQ,mBAAmB;AACnE,OAAO,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