@pagopa/io-react-native-wallet 2.0.0-next.3 → 2.0.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +75 -57
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +3 -3
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/README.md +45 -34
- package/lib/commonjs/credential/issuance/types.js +1 -0
- package/lib/commonjs/credential/issuance/types.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +6 -13
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js +7 -8
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
- package/lib/commonjs/credential/presentation/types.js +1 -1
- package/lib/commonjs/credential/presentation/types.js.map +1 -1
- package/lib/commonjs/credential/status/{02-status-attestation.js → 02-status-assertion.js} +28 -22
- package/lib/commonjs/credential/status/02-status-assertion.js.map +1 -0
- package/lib/commonjs/credential/status/03-verify-and-parse-status-assertion.js +85 -0
- package/lib/commonjs/credential/status/03-verify-and-parse-status-assertion.js.map +1 -0
- package/lib/commonjs/credential/status/README.md +22 -20
- package/lib/commonjs/credential/status/index.js +6 -6
- package/lib/commonjs/credential/status/index.js.map +1 -1
- package/lib/commonjs/credential/status/types.js +48 -15
- package/lib/commonjs/credential/status/types.js.map +1 -1
- package/lib/commonjs/sd-jwt/index.js +6 -1
- package/lib/commonjs/sd-jwt/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/types.js +25 -9
- package/lib/commonjs/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/utils/credentials.js +33 -0
- package/lib/commonjs/utils/credentials.js.map +1 -0
- package/lib/commonjs/utils/crypto.js +1 -7
- package/lib/commonjs/utils/crypto.js.map +1 -1
- package/lib/commonjs/utils/jwk.js +12 -0
- package/lib/commonjs/utils/jwk.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/types.js +1 -2
- package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
- package/lib/module/credential/issuance/04-complete-user-authorization.js +76 -58
- package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js +4 -4
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/module/credential/issuance/README.md +45 -34
- package/lib/module/credential/issuance/types.js +1 -0
- package/lib/module/credential/issuance/types.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js +6 -13
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +7 -8
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
- package/lib/module/credential/presentation/types.js +1 -1
- package/lib/module/credential/presentation/types.js.map +1 -1
- package/lib/module/credential/status/{02-status-attestation.js → 02-status-assertion.js} +28 -22
- package/lib/module/credential/status/02-status-assertion.js.map +1 -0
- package/lib/module/credential/status/03-verify-and-parse-status-assertion.js +78 -0
- package/lib/module/credential/status/03-verify-and-parse-status-assertion.js.map +1 -0
- package/lib/module/credential/status/README.md +22 -20
- package/lib/module/credential/status/index.js +3 -3
- package/lib/module/credential/status/index.js.map +1 -1
- package/lib/module/credential/status/types.js +43 -12
- package/lib/module/credential/status/types.js.map +1 -1
- package/lib/module/sd-jwt/index.js +6 -1
- package/lib/module/sd-jwt/index.js.map +1 -1
- package/lib/module/sd-jwt/types.js +25 -9
- package/lib/module/sd-jwt/types.js.map +1 -1
- package/lib/module/utils/credentials.js +26 -0
- package/lib/module/utils/credentials.js.map +1 -0
- package/lib/module/utils/crypto.js +2 -8
- package/lib/module/utils/crypto.js.map +1 -1
- package/lib/module/utils/jwk.js +11 -1
- package/lib/module/utils/jwk.js.map +1 -1
- package/lib/module/wallet-instance-attestation/types.js +1 -2
- package/lib/module/wallet-instance-attestation/types.js.map +1 -1
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +7 -14
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/types.d.ts +3 -0
- package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/01-start-flow.d.ts +2 -2
- package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts +4 -3
- package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts +9 -5
- package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/types.d.ts +3 -4
- package/lib/typescript/credential/presentation/types.d.ts.map +1 -1
- package/lib/typescript/credential/status/02-status-assertion.d.ts +23 -0
- package/lib/typescript/credential/status/02-status-assertion.d.ts.map +1 -0
- package/lib/typescript/credential/status/03-verify-and-parse-status-assertion.d.ts +21 -0
- package/lib/typescript/credential/status/03-verify-and-parse-status-assertion.d.ts.map +1 -0
- package/lib/typescript/credential/status/index.d.ts +4 -4
- package/lib/typescript/credential/status/index.d.ts.map +1 -1
- package/lib/typescript/credential/status/types.d.ts +499 -22
- package/lib/typescript/credential/status/types.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/index.d.ts +68 -40
- package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/types.d.ts +97 -46
- package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
- package/lib/typescript/utils/credentials.d.ts +11 -0
- package/lib/typescript/utils/credentials.d.ts.map +1 -0
- package/lib/typescript/utils/crypto.d.ts.map +1 -1
- package/lib/typescript/utils/jwk.d.ts +7 -0
- package/lib/typescript/utils/jwk.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/credential/issuance/04-complete-user-authorization.ts +79 -85
- package/src/credential/issuance/06-obtain-credential.ts +4 -1
- package/src/credential/issuance/07-verify-and-parse-credential.ts +4 -6
- package/src/credential/issuance/README.md +45 -34
- package/src/credential/issuance/types.ts +1 -0
- package/src/credential/presentation/07-evaluate-dcql-query.ts +16 -17
- package/src/credential/presentation/07-evaluate-input-descriptor.ts +16 -13
- package/src/credential/presentation/types.ts +1 -2
- package/src/credential/status/{02-status-attestation.ts → 02-status-assertion.ts} +37 -28
- package/src/credential/status/03-verify-and-parse-status-assertion.ts +109 -0
- package/src/credential/status/README.md +22 -20
- package/src/credential/status/index.ts +7 -14
- package/src/credential/status/types.ts +62 -15
- package/src/sd-jwt/index.ts +5 -1
- package/src/sd-jwt/types.ts +24 -10
- package/src/utils/credentials.ts +29 -0
- package/src/utils/crypto.ts +12 -20
- package/src/utils/jwk.ts +15 -1
- package/src/wallet-instance-attestation/types.ts +1 -1
- package/lib/commonjs/credential/status/02-status-attestation.js.map +0 -1
- package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js +0 -55
- package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js.map +0 -1
- package/lib/module/credential/status/02-status-attestation.js.map +0 -1
- package/lib/module/credential/status/03-verify-and-parse-status-attestation.js +0 -49
- package/lib/module/credential/status/03-verify-and-parse-status-attestation.js.map +0 -1
- package/lib/typescript/credential/status/02-status-attestation.d.ts +0 -19
- package/lib/typescript/credential/status/02-status-attestation.d.ts.map +0 -1
- package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts +0 -24
- package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts.map +0 -1
- package/src/credential/status/03-verify-and-parse-status-attestation.ts +0 -70
@@ -21,16 +21,14 @@ export * from "./utils";
|
|
21
21
|
export declare const decode: <S extends z.ZodType<{
|
22
22
|
header: {
|
23
23
|
alg: string;
|
24
|
-
|
25
|
-
|
24
|
+
kid: string;
|
25
|
+
typ: "vc+sd-jwt" | "dc+sd-jwt";
|
26
|
+
trust_chain?: string[] | undefined;
|
27
|
+
x5c?: string[] | undefined;
|
28
|
+
vctm?: string[] | undefined;
|
26
29
|
};
|
27
30
|
payload: {
|
28
31
|
iss: string;
|
29
|
-
status: {
|
30
|
-
status_assertion: {
|
31
|
-
credential_hash_alg: "sha-256";
|
32
|
-
};
|
33
|
-
};
|
34
32
|
sub: string;
|
35
33
|
exp: number;
|
36
34
|
_sd_alg: "sha-256";
|
@@ -61,26 +59,33 @@ export declare const decode: <S extends z.ZodType<{
|
|
61
59
|
};
|
62
60
|
};
|
63
61
|
vct: string;
|
64
|
-
"vct#integrity": string;
|
65
|
-
issuing_authority: string;
|
66
|
-
issuing_country: string;
|
67
62
|
iat?: number | undefined;
|
63
|
+
status?: {
|
64
|
+
status_assertion: {
|
65
|
+
credential_hash_alg: "sha-256";
|
66
|
+
};
|
67
|
+
} | {
|
68
|
+
status_attestation: {
|
69
|
+
credential_hash_alg: "sha-256";
|
70
|
+
};
|
71
|
+
} | undefined;
|
72
|
+
"vct#integrity"?: string | undefined;
|
73
|
+
issuing_authority?: string | undefined;
|
74
|
+
issuing_country?: string | undefined;
|
68
75
|
} & {
|
69
76
|
_sd: string[];
|
70
77
|
};
|
71
78
|
}, z.ZodTypeDef, {
|
72
79
|
header: {
|
73
80
|
alg: string;
|
74
|
-
|
75
|
-
|
81
|
+
kid: string;
|
82
|
+
typ: "vc+sd-jwt" | "dc+sd-jwt";
|
83
|
+
trust_chain?: string[] | undefined;
|
84
|
+
x5c?: string[] | undefined;
|
85
|
+
vctm?: string[] | undefined;
|
76
86
|
};
|
77
87
|
payload: {
|
78
88
|
iss: string;
|
79
|
-
status: {
|
80
|
-
status_assertion: {
|
81
|
-
credential_hash_alg: "sha-256";
|
82
|
-
};
|
83
|
-
};
|
84
89
|
sub: string;
|
85
90
|
exp: number;
|
86
91
|
_sd_alg: "sha-256";
|
@@ -111,10 +116,19 @@ export declare const decode: <S extends z.ZodType<{
|
|
111
116
|
};
|
112
117
|
};
|
113
118
|
vct: string;
|
114
|
-
"vct#integrity": string;
|
115
|
-
issuing_authority: string;
|
116
|
-
issuing_country: string;
|
117
119
|
iat?: number | undefined;
|
120
|
+
status?: {
|
121
|
+
status_assertion: {
|
122
|
+
credential_hash_alg: "sha-256";
|
123
|
+
};
|
124
|
+
} | {
|
125
|
+
status_attestation: {
|
126
|
+
credential_hash_alg: "sha-256";
|
127
|
+
};
|
128
|
+
} | undefined;
|
129
|
+
"vct#integrity"?: string | undefined;
|
130
|
+
issuing_authority?: string | undefined;
|
131
|
+
issuing_country?: string | undefined;
|
118
132
|
} & {
|
119
133
|
_sd: string[];
|
120
134
|
};
|
@@ -161,16 +175,14 @@ export declare const disclose: (token: string, claims: string[]) => Promise<{
|
|
161
175
|
export declare const verify: <S extends z.ZodType<{
|
162
176
|
header: {
|
163
177
|
alg: string;
|
164
|
-
|
165
|
-
|
178
|
+
kid: string;
|
179
|
+
typ: "vc+sd-jwt" | "dc+sd-jwt";
|
180
|
+
trust_chain?: string[] | undefined;
|
181
|
+
x5c?: string[] | undefined;
|
182
|
+
vctm?: string[] | undefined;
|
166
183
|
};
|
167
184
|
payload: {
|
168
185
|
iss: string;
|
169
|
-
status: {
|
170
|
-
status_assertion: {
|
171
|
-
credential_hash_alg: "sha-256";
|
172
|
-
};
|
173
|
-
};
|
174
186
|
sub: string;
|
175
187
|
exp: number;
|
176
188
|
_sd_alg: "sha-256";
|
@@ -201,26 +213,33 @@ export declare const verify: <S extends z.ZodType<{
|
|
201
213
|
};
|
202
214
|
};
|
203
215
|
vct: string;
|
204
|
-
"vct#integrity": string;
|
205
|
-
issuing_authority: string;
|
206
|
-
issuing_country: string;
|
207
216
|
iat?: number | undefined;
|
217
|
+
status?: {
|
218
|
+
status_assertion: {
|
219
|
+
credential_hash_alg: "sha-256";
|
220
|
+
};
|
221
|
+
} | {
|
222
|
+
status_attestation: {
|
223
|
+
credential_hash_alg: "sha-256";
|
224
|
+
};
|
225
|
+
} | undefined;
|
226
|
+
"vct#integrity"?: string | undefined;
|
227
|
+
issuing_authority?: string | undefined;
|
228
|
+
issuing_country?: string | undefined;
|
208
229
|
} & {
|
209
230
|
_sd: string[];
|
210
231
|
};
|
211
232
|
}, z.ZodTypeDef, {
|
212
233
|
header: {
|
213
234
|
alg: string;
|
214
|
-
|
215
|
-
|
235
|
+
kid: string;
|
236
|
+
typ: "vc+sd-jwt" | "dc+sd-jwt";
|
237
|
+
trust_chain?: string[] | undefined;
|
238
|
+
x5c?: string[] | undefined;
|
239
|
+
vctm?: string[] | undefined;
|
216
240
|
};
|
217
241
|
payload: {
|
218
242
|
iss: string;
|
219
|
-
status: {
|
220
|
-
status_assertion: {
|
221
|
-
credential_hash_alg: "sha-256";
|
222
|
-
};
|
223
|
-
};
|
224
243
|
sub: string;
|
225
244
|
exp: number;
|
226
245
|
_sd_alg: "sha-256";
|
@@ -251,10 +270,19 @@ export declare const verify: <S extends z.ZodType<{
|
|
251
270
|
};
|
252
271
|
};
|
253
272
|
vct: string;
|
254
|
-
"vct#integrity": string;
|
255
|
-
issuing_authority: string;
|
256
|
-
issuing_country: string;
|
257
273
|
iat?: number | undefined;
|
274
|
+
status?: {
|
275
|
+
status_assertion: {
|
276
|
+
credential_hash_alg: "sha-256";
|
277
|
+
};
|
278
|
+
} | {
|
279
|
+
status_attestation: {
|
280
|
+
credential_hash_alg: "sha-256";
|
281
|
+
};
|
282
|
+
} | undefined;
|
283
|
+
"vct#integrity"?: string | undefined;
|
284
|
+
issuing_authority?: string | undefined;
|
285
|
+
issuing_country?: string | undefined;
|
258
286
|
} & {
|
259
287
|
_sd: string[];
|
260
288
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sd-jwt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAE3E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAErE,cAAc,SAAS,CAAC;AAQxB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,MAAM
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sd-jwt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAE3E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAErE,cAAc,SAAS,CAAC;AAQxB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WACV,MAAM;;iBAIA,qBAAqB,EAAE;CA0BrC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,UACZ,MAAM,UACL,MAAM,EAAE;WACE,MAAM;WAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE;EA4CnE,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WACV,MAAM,aACF,GAAG,GAAG,GAAG,EAAE;;iBAEqB,UAAU,EAAE;EAqBxD,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,UAClB,MAAM,aACF,MAAM;cAGP,MAAM;EAyBjB,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC"}
|
@@ -29,20 +29,33 @@ export type DisclosureWithEncoded = {
|
|
29
29
|
decoded: Disclosure;
|
30
30
|
encoded: string;
|
31
31
|
};
|
32
|
+
/**
|
33
|
+
* Type for a Verifiable Credential in SD-JWT format.
|
34
|
+
* It supports both the older and the new data model for backward compatibility.
|
35
|
+
*/
|
32
36
|
export type SdJwt4VC = z.infer<typeof SdJwt4VC>;
|
33
37
|
export declare const SdJwt4VC: z.ZodObject<{
|
34
38
|
header: z.ZodObject<{
|
35
|
-
typ: z.
|
39
|
+
typ: z.ZodEnum<["vc+sd-jwt", "dc+sd-jwt"]>;
|
36
40
|
alg: z.ZodString;
|
37
|
-
kid: z.
|
41
|
+
kid: z.ZodString;
|
42
|
+
trust_chain: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
43
|
+
x5c: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
44
|
+
vctm: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
38
45
|
}, "strip", z.ZodTypeAny, {
|
39
46
|
alg: string;
|
40
|
-
|
41
|
-
|
47
|
+
kid: string;
|
48
|
+
typ: "vc+sd-jwt" | "dc+sd-jwt";
|
49
|
+
trust_chain?: string[] | undefined;
|
50
|
+
x5c?: string[] | undefined;
|
51
|
+
vctm?: string[] | undefined;
|
42
52
|
}, {
|
43
53
|
alg: string;
|
44
|
-
|
45
|
-
|
54
|
+
kid: string;
|
55
|
+
typ: "vc+sd-jwt" | "dc+sd-jwt";
|
56
|
+
trust_chain?: string[] | undefined;
|
57
|
+
x5c?: string[] | undefined;
|
58
|
+
vctm?: string[] | undefined;
|
46
59
|
}>;
|
47
60
|
payload: z.ZodIntersection<z.ZodObject<{
|
48
61
|
iss: z.ZodString;
|
@@ -50,7 +63,7 @@ export declare const SdJwt4VC: z.ZodObject<{
|
|
50
63
|
iat: z.ZodOptional<z.ZodNumber>;
|
51
64
|
exp: z.ZodNumber;
|
52
65
|
_sd_alg: z.ZodLiteral<"sha-256">;
|
53
|
-
status: z.ZodObject<{
|
66
|
+
status: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
54
67
|
status_assertion: z.ZodObject<{
|
55
68
|
credential_hash_alg: z.ZodLiteral<"sha-256">;
|
56
69
|
}, "strip", z.ZodTypeAny, {
|
@@ -66,7 +79,23 @@ export declare const SdJwt4VC: z.ZodObject<{
|
|
66
79
|
status_assertion: {
|
67
80
|
credential_hash_alg: "sha-256";
|
68
81
|
};
|
69
|
-
}
|
82
|
+
}>, z.ZodObject<{
|
83
|
+
status_attestation: z.ZodObject<{
|
84
|
+
credential_hash_alg: z.ZodLiteral<"sha-256">;
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
86
|
+
credential_hash_alg: "sha-256";
|
87
|
+
}, {
|
88
|
+
credential_hash_alg: "sha-256";
|
89
|
+
}>;
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
91
|
+
status_attestation: {
|
92
|
+
credential_hash_alg: "sha-256";
|
93
|
+
};
|
94
|
+
}, {
|
95
|
+
status_attestation: {
|
96
|
+
credential_hash_alg: "sha-256";
|
97
|
+
};
|
98
|
+
}>]>>;
|
70
99
|
cnf: z.ZodObject<{
|
71
100
|
jwk: z.ZodObject<{
|
72
101
|
alg: z.ZodOptional<z.ZodString>;
|
@@ -190,16 +219,11 @@ export declare const SdJwt4VC: z.ZodObject<{
|
|
190
219
|
};
|
191
220
|
}>;
|
192
221
|
vct: z.ZodString;
|
193
|
-
"vct#integrity": z.ZodString
|
194
|
-
issuing_authority: z.ZodString
|
195
|
-
issuing_country: z.ZodString
|
222
|
+
"vct#integrity": z.ZodOptional<z.ZodString>;
|
223
|
+
issuing_authority: z.ZodOptional<z.ZodString>;
|
224
|
+
issuing_country: z.ZodOptional<z.ZodString>;
|
196
225
|
}, "strip", z.ZodTypeAny, {
|
197
226
|
iss: string;
|
198
|
-
status: {
|
199
|
-
status_assertion: {
|
200
|
-
credential_hash_alg: "sha-256";
|
201
|
-
};
|
202
|
-
};
|
203
227
|
sub: string;
|
204
228
|
exp: number;
|
205
229
|
_sd_alg: "sha-256";
|
@@ -230,17 +254,21 @@ export declare const SdJwt4VC: z.ZodObject<{
|
|
230
254
|
};
|
231
255
|
};
|
232
256
|
vct: string;
|
233
|
-
"vct#integrity": string;
|
234
|
-
issuing_authority: string;
|
235
|
-
issuing_country: string;
|
236
257
|
iat?: number | undefined;
|
237
|
-
|
238
|
-
iss: string;
|
239
|
-
status: {
|
258
|
+
status?: {
|
240
259
|
status_assertion: {
|
241
260
|
credential_hash_alg: "sha-256";
|
242
261
|
};
|
243
|
-
}
|
262
|
+
} | {
|
263
|
+
status_attestation: {
|
264
|
+
credential_hash_alg: "sha-256";
|
265
|
+
};
|
266
|
+
} | undefined;
|
267
|
+
"vct#integrity"?: string | undefined;
|
268
|
+
issuing_authority?: string | undefined;
|
269
|
+
issuing_country?: string | undefined;
|
270
|
+
}, {
|
271
|
+
iss: string;
|
244
272
|
sub: string;
|
245
273
|
exp: number;
|
246
274
|
_sd_alg: "sha-256";
|
@@ -271,10 +299,19 @@ export declare const SdJwt4VC: z.ZodObject<{
|
|
271
299
|
};
|
272
300
|
};
|
273
301
|
vct: string;
|
274
|
-
"vct#integrity": string;
|
275
|
-
issuing_authority: string;
|
276
|
-
issuing_country: string;
|
277
302
|
iat?: number | undefined;
|
303
|
+
status?: {
|
304
|
+
status_assertion: {
|
305
|
+
credential_hash_alg: "sha-256";
|
306
|
+
};
|
307
|
+
} | {
|
308
|
+
status_attestation: {
|
309
|
+
credential_hash_alg: "sha-256";
|
310
|
+
};
|
311
|
+
} | undefined;
|
312
|
+
"vct#integrity"?: string | undefined;
|
313
|
+
issuing_authority?: string | undefined;
|
314
|
+
issuing_country?: string | undefined;
|
278
315
|
}>, z.ZodObject<{
|
279
316
|
_sd: z.ZodArray<z.ZodString, "many">;
|
280
317
|
}, "strip", z.ZodTypeAny, {
|
@@ -285,16 +322,14 @@ export declare const SdJwt4VC: z.ZodObject<{
|
|
285
322
|
}, "strip", z.ZodTypeAny, {
|
286
323
|
header: {
|
287
324
|
alg: string;
|
288
|
-
|
289
|
-
|
325
|
+
kid: string;
|
326
|
+
typ: "vc+sd-jwt" | "dc+sd-jwt";
|
327
|
+
trust_chain?: string[] | undefined;
|
328
|
+
x5c?: string[] | undefined;
|
329
|
+
vctm?: string[] | undefined;
|
290
330
|
};
|
291
331
|
payload: {
|
292
332
|
iss: string;
|
293
|
-
status: {
|
294
|
-
status_assertion: {
|
295
|
-
credential_hash_alg: "sha-256";
|
296
|
-
};
|
297
|
-
};
|
298
333
|
sub: string;
|
299
334
|
exp: number;
|
300
335
|
_sd_alg: "sha-256";
|
@@ -325,26 +360,33 @@ export declare const SdJwt4VC: z.ZodObject<{
|
|
325
360
|
};
|
326
361
|
};
|
327
362
|
vct: string;
|
328
|
-
"vct#integrity": string;
|
329
|
-
issuing_authority: string;
|
330
|
-
issuing_country: string;
|
331
363
|
iat?: number | undefined;
|
364
|
+
status?: {
|
365
|
+
status_assertion: {
|
366
|
+
credential_hash_alg: "sha-256";
|
367
|
+
};
|
368
|
+
} | {
|
369
|
+
status_attestation: {
|
370
|
+
credential_hash_alg: "sha-256";
|
371
|
+
};
|
372
|
+
} | undefined;
|
373
|
+
"vct#integrity"?: string | undefined;
|
374
|
+
issuing_authority?: string | undefined;
|
375
|
+
issuing_country?: string | undefined;
|
332
376
|
} & {
|
333
377
|
_sd: string[];
|
334
378
|
};
|
335
379
|
}, {
|
336
380
|
header: {
|
337
381
|
alg: string;
|
338
|
-
|
339
|
-
|
382
|
+
kid: string;
|
383
|
+
typ: "vc+sd-jwt" | "dc+sd-jwt";
|
384
|
+
trust_chain?: string[] | undefined;
|
385
|
+
x5c?: string[] | undefined;
|
386
|
+
vctm?: string[] | undefined;
|
340
387
|
};
|
341
388
|
payload: {
|
342
389
|
iss: string;
|
343
|
-
status: {
|
344
|
-
status_assertion: {
|
345
|
-
credential_hash_alg: "sha-256";
|
346
|
-
};
|
347
|
-
};
|
348
390
|
sub: string;
|
349
391
|
exp: number;
|
350
392
|
_sd_alg: "sha-256";
|
@@ -375,10 +417,19 @@ export declare const SdJwt4VC: z.ZodObject<{
|
|
375
417
|
};
|
376
418
|
};
|
377
419
|
vct: string;
|
378
|
-
"vct#integrity": string;
|
379
|
-
issuing_authority: string;
|
380
|
-
issuing_country: string;
|
381
420
|
iat?: number | undefined;
|
421
|
+
status?: {
|
422
|
+
status_assertion: {
|
423
|
+
credential_hash_alg: "sha-256";
|
424
|
+
};
|
425
|
+
} | {
|
426
|
+
status_attestation: {
|
427
|
+
credential_hash_alg: "sha-256";
|
428
|
+
};
|
429
|
+
} | undefined;
|
430
|
+
"vct#integrity"?: string | undefined;
|
431
|
+
issuing_authority?: string | undefined;
|
432
|
+
issuing_country?: string | undefined;
|
382
433
|
} & {
|
383
434
|
_sd: string[];
|
384
435
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sd-jwt/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,QAAQ,aAAuC,CAAC;AAC7D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC1E,eAAO,MAAM,qBAAqB;;;;;;EAAyC,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,eAAO,MAAM,UAAU,4DAIrB,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sd-jwt/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,QAAQ,aAAuC,CAAC;AAC7D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC1E,eAAO,MAAM,qBAAqB;;;;;;EAAyC,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,eAAO,MAAM,UAAU,4DAIrB,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAMF;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCnB,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAevB,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcvB,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { Out } from "./misc";
|
2
|
+
import type { ObtainCredential } from "../credential/issuance";
|
3
|
+
import type { JWK } from "./jwk";
|
4
|
+
/**
|
5
|
+
* Extracts a JWK from a credential.
|
6
|
+
* @param credential - The credential string, which can be in SD-JWT or CBOR format.
|
7
|
+
* @param format - The format of the credential
|
8
|
+
* @return A Promise that resolves to a JWK object if the credential is in SD-JWT format and contains a JWK, or undefined otherwise.
|
9
|
+
*/
|
10
|
+
export declare const extractJwkFromCredential: (credential: Out<ObtainCredential>["credential"], format: Out<ObtainCredential>["format"]) => Promise<JWK>;
|
11
|
+
//# sourceMappingURL=credentials.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/utils/credentials.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,eACvB,IAAI,gBAAgB,CAAC,CAAC,YAAY,CAAC,UACvC,IAAI,gBAAgB,CAAC,CAAC,QAAQ,CAAC,KACtC,QAAQ,GAAG,CAUb,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../src/utils/crypto.ts"],"names":[],"mappings":"AAOA,OAAO,
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../src/utils/crypto.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,6BAA6B,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,WAAY,MAAM,KAAG,aAsBvD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,6BACJ,aAAa,8BAOrC,CAAC"}
|
@@ -228,4 +228,11 @@ export declare const JWKS: z.ZodObject<{
|
|
228
228
|
}[];
|
229
229
|
}>;
|
230
230
|
export type JWTDecodeResult = ReturnType<typeof decode>;
|
231
|
+
/**
|
232
|
+
* Utility function that checks if two JWKs have the same thumbprint.
|
233
|
+
* @param jwkA The first JWK
|
234
|
+
* @param jwkB The second JWK
|
235
|
+
* @returns Whether the thumbprints match
|
236
|
+
*/
|
237
|
+
export declare const isSameThumbprint: (jwkA: JWK, jwkB: JWK) => Promise<boolean>;
|
231
238
|
//# sourceMappingURL=jwk.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"jwk.d.ts","sourceRoot":"","sources":["../../../src/utils/jwk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"jwk.d.ts","sourceRoot":"","sources":["../../../src/utils/jwk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA6B,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;AACtC,eAAO,MAAM,GAAG;IACd,uCAAuC;;;;;;;IAOvC,yCAAyC;;;IAGzC,gDAAgD;;IAEhD,oCAAoC;;IAEpC;;kCAE8B;;;;;;IAM9B,4CAA4C;;;;IAI5C,qDAAqD;;IAErD,gEAAgE;;IAEhE,mEAAmE;;IAEnE,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEvC,CAAC;AAEH;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAUpD;AAED,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACxC,eAAO,MAAM,IAAI;;QAzDf,uCAAuC;;;;;;;QAOvC,yCAAyC;;;QAGzC,gDAAgD;;QAEhD,oCAAoC;;QAEpC;;sCAE8B;;;;;;QAM9B,4CAA4C;;;;QAI5C,qDAAqD;;QAErD,gEAAgE;;QAEhE,mEAAmE;;QAEnE,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BvC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AAExD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,SAAgB,GAAG,QAAQ,GAAG,qBAM1D,CAAC"}
|
package/package.json
CHANGED