@sphereon/ssi-types 0.33.1-next.2 → 0.33.1-next.68

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.
Files changed (122) hide show
  1. package/dist/index.cjs +1773 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +1589 -0
  4. package/dist/index.d.ts +1589 -6
  5. package/dist/index.js +1741 -24
  6. package/dist/index.js.map +1 -1
  7. package/package.json +23 -14
  8. package/src/index.ts +3 -2
  9. package/src/logging/index.ts +6 -4
  10. package/src/mapper/credential-constraints.ts +14 -1
  11. package/src/mapper/credential-mapper.ts +61 -23
  12. package/src/mapper/index.ts +1 -0
  13. package/src/types/cose.ts +5 -51
  14. package/src/types/did.ts +0 -90
  15. package/src/types/index.ts +13 -13
  16. package/src/types/jose.ts +18 -65
  17. package/src/types/mso_mdoc.ts +10 -138
  18. package/src/types/sd-jwt-vc.ts +4 -178
  19. package/src/types/status-list.ts +1 -8
  20. package/src/types/vc.ts +7 -29
  21. package/src/types/w3c-vc.ts +3 -26
  22. package/src/utils/cose.ts +46 -0
  23. package/src/utils/did.ts +91 -0
  24. package/src/utils/hasher.ts +5 -2
  25. package/src/utils/index.ts +6 -0
  26. package/src/utils/jose.ts +47 -0
  27. package/src/utils/mdoc.ts +144 -0
  28. package/src/utils/sd-jwt.ts +179 -0
  29. package/src/utils/vc.ts +54 -0
  30. package/dist/events/index.d.ts +0 -116
  31. package/dist/events/index.d.ts.map +0 -1
  32. package/dist/events/index.js +0 -165
  33. package/dist/events/index.js.map +0 -1
  34. package/dist/index.d.ts.map +0 -1
  35. package/dist/logging/index.d.ts +0 -73
  36. package/dist/logging/index.d.ts.map +0 -1
  37. package/dist/logging/index.js +0 -186
  38. package/dist/logging/index.js.map +0 -1
  39. package/dist/mapper/credential-constraints.d.ts +0 -16
  40. package/dist/mapper/credential-constraints.d.ts.map +0 -1
  41. package/dist/mapper/credential-constraints.js +0 -3
  42. package/dist/mapper/credential-constraints.js.map +0 -1
  43. package/dist/mapper/credential-mapper.d.ts +0 -124
  44. package/dist/mapper/credential-mapper.d.ts.map +0 -1
  45. package/dist/mapper/credential-mapper.js +0 -774
  46. package/dist/mapper/credential-mapper.js.map +0 -1
  47. package/dist/mapper/index.d.ts +0 -3
  48. package/dist/mapper/index.d.ts.map +0 -1
  49. package/dist/mapper/index.js +0 -19
  50. package/dist/mapper/index.js.map +0 -1
  51. package/dist/mapper/jsonld-language-values.d.ts +0 -18
  52. package/dist/mapper/jsonld-language-values.d.ts.map +0 -1
  53. package/dist/mapper/jsonld-language-values.js +0 -79
  54. package/dist/mapper/jsonld-language-values.js.map +0 -1
  55. package/dist/types/cose.d.ts +0 -77
  56. package/dist/types/cose.d.ts.map +0 -1
  57. package/dist/types/cose.js +0 -51
  58. package/dist/types/cose.js.map +0 -1
  59. package/dist/types/dcql.d.ts +0 -33
  60. package/dist/types/dcql.d.ts.map +0 -1
  61. package/dist/types/dcql.js +0 -4
  62. package/dist/types/dcql.js.map +0 -1
  63. package/dist/types/did.d.ts +0 -186
  64. package/dist/types/did.d.ts.map +0 -1
  65. package/dist/types/did.js +0 -78
  66. package/dist/types/did.js.map +0 -1
  67. package/dist/types/generic.d.ts +0 -44
  68. package/dist/types/generic.d.ts.map +0 -1
  69. package/dist/types/generic.js +0 -3
  70. package/dist/types/generic.js.map +0 -1
  71. package/dist/types/index.d.ts +0 -14
  72. package/dist/types/index.d.ts.map +0 -1
  73. package/dist/types/index.js +0 -30
  74. package/dist/types/index.js.map +0 -1
  75. package/dist/types/jose.d.ts +0 -89
  76. package/dist/types/jose.d.ts.map +0 -1
  77. package/dist/types/jose.js +0 -55
  78. package/dist/types/jose.js.map +0 -1
  79. package/dist/types/metadata-types.d.ts +0 -5
  80. package/dist/types/metadata-types.d.ts.map +0 -1
  81. package/dist/types/metadata-types.js +0 -3
  82. package/dist/types/metadata-types.js.map +0 -1
  83. package/dist/types/mso_mdoc.d.ts +0 -94
  84. package/dist/types/mso_mdoc.d.ts.map +0 -1
  85. package/dist/types/mso_mdoc.js +0 -121
  86. package/dist/types/mso_mdoc.js.map +0 -1
  87. package/dist/types/pex.d.ts +0 -36
  88. package/dist/types/pex.d.ts.map +0 -1
  89. package/dist/types/pex.js +0 -3
  90. package/dist/types/pex.js.map +0 -1
  91. package/dist/types/sd-jwt-type-metadata.d.ts +0 -191
  92. package/dist/types/sd-jwt-type-metadata.d.ts.map +0 -1
  93. package/dist/types/sd-jwt-type-metadata.js +0 -3
  94. package/dist/types/sd-jwt-type-metadata.js.map +0 -1
  95. package/dist/types/sd-jwt-vc.d.ts +0 -196
  96. package/dist/types/sd-jwt-vc.d.ts.map +0 -1
  97. package/dist/types/sd-jwt-vc.js +0 -142
  98. package/dist/types/sd-jwt-vc.js.map +0 -1
  99. package/dist/types/status-list.d.ts +0 -10
  100. package/dist/types/status-list.d.ts.map +0 -1
  101. package/dist/types/status-list.js +0 -9
  102. package/dist/types/status-list.js.map +0 -1
  103. package/dist/types/vc.d.ts +0 -28
  104. package/dist/types/vc.d.ts.map +0 -1
  105. package/dist/types/vc.js +0 -28
  106. package/dist/types/vc.js.map +0 -1
  107. package/dist/types/w3c-vc.d.ts +0 -243
  108. package/dist/types/w3c-vc.d.ts.map +0 -1
  109. package/dist/types/w3c-vc.js +0 -26
  110. package/dist/types/w3c-vc.js.map +0 -1
  111. package/dist/utils/hasher.d.ts +0 -4
  112. package/dist/utils/hasher.d.ts.map +0 -1
  113. package/dist/utils/hasher.js +0 -40
  114. package/dist/utils/hasher.js.map +0 -1
  115. package/dist/utils/index.d.ts +0 -3
  116. package/dist/utils/index.d.ts.map +0 -1
  117. package/dist/utils/index.js +0 -19
  118. package/dist/utils/index.js.map +0 -1
  119. package/dist/utils/object.d.ts +0 -8
  120. package/dist/utils/object.d.ts.map +0 -1
  121. package/dist/utils/object.js +0 -28
  122. package/dist/utils/object.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"pex.js","sourceRoot":"","sources":["../../src/types/pex.ts"],"names":[],"mappings":""}
@@ -1,191 +0,0 @@
1
- /**
2
- * Represents the metadata associated with a specific SD-JWT VC type.
3
- */
4
- export interface SdJwtTypeMetadata {
5
- /**
6
- * REQUIRED. The VC type URI.
7
- */
8
- vct: string;
9
- /**
10
- * OPTIONAL. A human-readable name for the type.
11
- */
12
- name?: string;
13
- /**
14
- * OPTIONAL. A human-readable description for the type.
15
- */
16
- description?: string;
17
- /**
18
- * OPTIONAL. A URI of another type that this type extends.
19
- */
20
- extends?: string;
21
- /**
22
- * OPTIONAL. Integrity metadata string for the 'extends' field.
23
- */
24
- ['extends#integrity']?: string;
25
- /**
26
- * OPTIONAL. URL pointing towards a JSON Schema document describing the VC's structure.
27
- */
28
- schema_uri?: string;
29
- /**
30
- * OPTIONAL. Integrity metadata string for the 'schema_uri' field.
31
- */
32
- ['schema_uri#integrity']?: string;
33
- /**
34
- * OPTIONAL. Display metadata for various languages.
35
- */
36
- display?: Array<SdJwtTypeDisplayMetadata>;
37
- /**
38
- * OPTIONAL. Metadata for the claims within the VC.
39
- */
40
- claims?: Array<SdJwtClaimMetadata>;
41
- }
42
- /**
43
- * Represents the metadata associated with a specific SD-JWT claim.
44
- */
45
- export interface SdJwtClaimMetadata {
46
- /**
47
- * REQUIRED. An array indicating the claim or claims that are being addressed.
48
- */
49
- path: Array<SdJwtClaimPath>;
50
- /**
51
- * OPTIONAL. Display information for the claim.
52
- */
53
- display?: Array<SdJwtClaimDisplayMetadata>;
54
- /**
55
- * OPTIONAL. A string indicating whether the claim is selectively disclosable.
56
- */
57
- sd?: SdJwtClaimSelectiveDisclosure;
58
- /**
59
- * OPTIONAL. A string defining the ID of the claim for reference in the SVG template.
60
- */
61
- svg_id?: string;
62
- }
63
- /**
64
- * Represents claim display metadata for a specific language.
65
- */
66
- export interface SdJwtClaimDisplayMetadata {
67
- /**
68
- * REQUIRED. Language tag for the display information.
69
- */
70
- lang: string;
71
- /**
72
- * REQUIRED. A human-readable label for the claim, intended for end users.
73
- */
74
- label: string;
75
- /**
76
- * REQUIRED. A human-readable description for the claim, intended for end users.
77
- */
78
- description?: string;
79
- }
80
- /**
81
- * Represents display metadata for a specific language.
82
- */
83
- export interface SdJwtTypeDisplayMetadata {
84
- /**
85
- * REQUIRED. Language tag for the display information.
86
- */
87
- lang: string;
88
- /**
89
- * REQUIRED. Human-readable name for the type.
90
- */
91
- name: string;
92
- /**
93
- * OPTIONAL. Human-readable description for the type.
94
- */
95
- description?: string;
96
- /**
97
- * OPTIONAL. Rendering metadata for the type.
98
- */
99
- rendering?: SdJwtTypeRenderingMetadata;
100
- }
101
- /**
102
- * Contains rendering metadata for different methods.
103
- */
104
- export interface SdJwtTypeRenderingMetadata {
105
- /**
106
- * OPTIONAL. Simple rendering method metadata.
107
- */
108
- simple?: SdJwtSimpleRenderingMetadata;
109
- /**
110
- * OPTIONAL. Metadata for SVG templates.
111
- */
112
- svg_template?: Array<SdJwtSVGTemplateMetadata>;
113
- }
114
- /**
115
- * Represents metadata for simple rendering.
116
- */
117
- export interface SdJwtSimpleRenderingMetadata {
118
- /**
119
- * OPTIONAL. Metadata for the logo image.
120
- */
121
- logo?: SdJwtLogoMetadata;
122
- /**
123
- * OPTIONAL. Background color for the credential.
124
- */
125
- background_color?: string;
126
- /**
127
- * OPTIONAL. Text color for the credential.
128
- */
129
- text_color?: string;
130
- }
131
- /**
132
- * Represents metadata for a logo.
133
- */
134
- export interface SdJwtLogoMetadata {
135
- /**
136
- * REQUIRED. URI pointing to the logo image.
137
- */
138
- uri: string;
139
- /**
140
- * OPTIONAL. Integrity metadata string for the 'uri' field.
141
- */
142
- ['uri#integrity']?: string;
143
- /**
144
- * OPTIONAL. Alternative text for the logo image.
145
- */
146
- alt_text?: string;
147
- }
148
- /**
149
- * Represents metadata for SVG templates.
150
- */
151
- export interface SdJwtSVGTemplateMetadata {
152
- /**
153
- * REQUIRED. URI pointing to the SVG template.
154
- */
155
- uri: string;
156
- /**
157
- * OPTIONAL. Integrity metadata string for the 'uri' field.
158
- */
159
- ['uri#integrity']?: string;
160
- /**
161
- * OPTIONAL. Properties for the SVG template.
162
- */
163
- properties?: SdJwtSVGTemplateProperties;
164
- }
165
- /**
166
- * Contains properties for SVG templates.
167
- */
168
- export interface SdJwtSVGTemplateProperties {
169
- /**
170
- * OPTIONAL. The orientation for which the SVG template is optimized.
171
- */
172
- orientation?: string;
173
- /**
174
- * OPTIONAL. The color scheme for which the SVG template is optimized.
175
- */
176
- color_scheme?: string;
177
- }
178
- /**
179
- * A string indicates that the respective key is to be selected.
180
- * A null value indicates that all elements of the currently selected array(s) are to be selected.
181
- * A non-negative integer indicates that the respective index in an array is to be selected.
182
- */
183
- export type SdJwtClaimPath = string | null | number;
184
- /**
185
- * always: The Issuer MUST make the claim selectively disclosable.
186
- * allowed: The Issuer MAY make the claim selectively disclosable.
187
- * never: The Issuer MUST NOT make the claim selectively disclosable.
188
- */
189
- export type SdJwtClaimSelectiveDisclosure = 'always' | 'allowed' | 'never';
190
- export type SdJwtTypeHasher = (input: any, alg?: string) => string;
191
- //# sourceMappingURL=sd-jwt-type-metadata.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sd-jwt-type-metadata.d.ts","sourceRoot":"","sources":["../../src/types/sd-jwt-type-metadata.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,CAAC,mBAAmB,CAAC,CAAC,EAAE,MAAM,CAAA;IAE9B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,CAAC,sBAAsB,CAAC,CAAC,EAAE,MAAM,CAAA;IAEjC;;OAEG;IACH,OAAO,CAAC,EA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EX;;OAEG;IACH,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,UAAU,CAAC,EAAE,0BAA0B,CAAA;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,CAAA;AAEnD;;;;GAIG;AACH,MAAM,MAAM,6BAA6B,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAA;AAE1E,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=sd-jwt-type-metadata.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sd-jwt-type-metadata.js","sourceRoot":"","sources":["../../src/types/sd-jwt-type-metadata.ts"],"names":[],"mappings":""}
@@ -1,196 +0,0 @@
1
- import { OriginalType, WrappedVerifiableCredential, WrappedVerifiablePresentation } from './vc';
2
- import { CompactJWT, IVerifiableCredential } from './w3c-vc';
3
- import { OrPromise } from './generic';
4
- type JsonValue = string | number | boolean | {
5
- [x: string]: JsonValue | undefined;
6
- } | Array<JsonValue>;
7
- type SdJwtJsonValue = string | number | boolean | {
8
- [x: string]: SdJwtJsonValue | undefined;
9
- _sd?: string[];
10
- } | Array<SdJwtJsonValue | {
11
- '...': string;
12
- }>;
13
- /**
14
- * Decoded 'pretty' SD JWT Verifiable Credential. This representation has all the `_sd` properties
15
- * removed, and includes the disclosures directly within the payload.
16
- */
17
- export interface SdJwtDecodedVerifiableCredentialPayload {
18
- vct: string;
19
- iss: string;
20
- iat: number;
21
- nbf?: number;
22
- exp?: number;
23
- cnf?: {
24
- jwk?: any;
25
- kid?: string;
26
- };
27
- status?: {
28
- idx: number;
29
- uri: string;
30
- };
31
- sub?: string;
32
- [key: string]: JsonValue | undefined;
33
- }
34
- /**
35
- * Represents a selective disclosure JWT vc in compact form.
36
- */
37
- export type CompactSdJwtVc = string;
38
- /**
39
- * The signed payload of an SD-JWT. Includes fields such as `_sd`, `...` and `_sd_alg`
40
- */
41
- interface SdJwtSignedVerifiableCredentialPayload extends SdJwtDecodedVerifiableCredentialPayload {
42
- _sd?: string[];
43
- _sd_alg?: string;
44
- [x: string]: SdJwtJsonValue | undefined;
45
- }
46
- type SdJwtFrameValue = boolean | Array<SdJwtFrameValue> | {
47
- [x: string]: SdJwtFrameValue;
48
- };
49
- export type SdJwtDisclosureFrame = Record<string, SdJwtFrameValue>;
50
- export type SdJwtPresentationFrame = Record<string, SdJwtFrameValue>;
51
- /**
52
- * Input for creating a SD JWT Verifiable Credential. This representation optionally includes the disclosure frame,
53
- * (as `__disclosureFrame`) to indicate which fields in the signed SD-JWT should be selectively discloseable
54
- */
55
- export interface SdJwtCredentialInput extends SdJwtDecodedVerifiableCredentialPayload {
56
- /**
57
- * Disclosure frame, indicating which fields in the signed SD-JWT should be selectively discloseable
58
- * Will be removed from the actual SD-JWT payload before signing
59
- */
60
- __disclosureFrame?: SdJwtDisclosureFrame;
61
- }
62
- export type SdJwtDecodedDisclosure = [string, string, JsonValue] | [string, JsonValue];
63
- export interface SdJwtDisclosure {
64
- encoded: string;
65
- decoded: SdJwtDecodedDisclosure;
66
- digest: string;
67
- }
68
- /**
69
- * The decoded SD JWT Verifiable Credential. This representation includes multiple representations of the
70
- * same SD-JWT, and allows to fully process an SD-JWT, as well as create a presentation SD-JWT (minus the KB-JWT) by removing
71
- * certain disclosures from the compact SD-JWT.
72
- *
73
- * This representation is useful as it doesn't require a hasher implementation to match the different digests in the signed SD-JWT
74
- * payload, with the different disclosures.
75
- */
76
- export interface SdJwtDecodedVerifiableCredential {
77
- /**
78
- * The compact sd jwt is the sd-jwt encoded as string. It is a normal JWT,
79
- * with the disclosures and kb-jwt appended separated by ~ */
80
- compactSdJwtVc: string;
81
- /**
82
- * The disclosures included within the SD-JWT in both encoded and decoded format.
83
- * The digests are also included, and allows the disclosures to be linked against
84
- * the digests in the signed payload.
85
- */
86
- disclosures: Array<SdJwtDisclosure>;
87
- /**
88
- * The signed payload is the payload of the sd-jwt that is actually signed, and that includes
89
- * the `_sd` and `...` digests.
90
- */
91
- signedPayload: SdJwtSignedVerifiableCredentialPayload;
92
- /**
93
- * The decoded payload is the payload when all `_sd` and `...` digests have been replaced
94
- * by the actual values from the disclosures. This format could also be seen as the 'pretty`
95
- * version of the SD JWT payload.
96
- *
97
- * This is useful for displaying the contents of the SD JWT VC to the user, or for example
98
- * for querying the contents of the SD JWT VC using a PEX presentation definition path.
99
- */
100
- decodedPayload: SdJwtDecodedVerifiableCredentialPayload;
101
- /**
102
- * Key binding JWT
103
- */
104
- kbJwt?: {
105
- header: SdJwtVcKbJwtHeader;
106
- payload: SdJwtVcKbJwtPayload;
107
- compact?: CompactJWT;
108
- };
109
- }
110
- export interface SdJwtVcKbJwtHeader {
111
- typ: 'kb+jwt';
112
- alg: string;
113
- [x: string]: any;
114
- }
115
- export interface SdJwtVcKbJwtPayload {
116
- iat: number;
117
- aud: string;
118
- nonce: string;
119
- sd_hash: string;
120
- [key: string]: unknown;
121
- }
122
- export interface WrappedSdJwtVerifiableCredential {
123
- /**
124
- * Original VC that we've received. Can be either the encoded or decoded variant.
125
- */
126
- original: SdJwtDecodedVerifiableCredential | CompactSdJwtVc;
127
- /**
128
- * Decoded version of the SD-JWT payload. This is the decoded payload, rather than the whole SD-JWT as the `decoded` property
129
- * is used in e.g. PEX to check for path filters from fields. The full decoded credential can be found in the `credential` field.
130
- */
131
- decoded: SdJwtDecodedVerifiableCredentialPayload;
132
- /**
133
- * Type of this credential.
134
- */
135
- type: OriginalType.SD_JWT_VC_DECODED | OriginalType.SD_JWT_VC_ENCODED;
136
- /**
137
- * The claim format, typically used during exchange transport protocols
138
- */
139
- format: 'vc+sd-jwt';
140
- /**
141
- * Internal stable representation of a Credential
142
- */
143
- credential: SdJwtDecodedVerifiableCredential;
144
- }
145
- export type HasherSync = (data: string | ArrayBuffer, alg: string) => Uint8Array;
146
- export type Hasher = (data: string | ArrayBuffer, alg: string) => OrPromise<Uint8Array>;
147
- export interface WrappedSdJwtVerifiablePresentation {
148
- /**
149
- * Original VP that we've received. Can be either the encoded or decoded variant.
150
- */
151
- original: SdJwtDecodedVerifiableCredential | CompactSdJwtVc;
152
- /**
153
- * Decoded version of the SD-JWT payload. This is the decoded payload, rather than the whole SD-JWT.
154
- */
155
- decoded: SdJwtDecodedVerifiableCredentialPayload;
156
- /**
157
- * Type of this Presentation.
158
- */
159
- type: OriginalType.SD_JWT_VC_DECODED | OriginalType.SD_JWT_VC_ENCODED;
160
- /**
161
- * The claim format, typically used during exchange transport protocols
162
- */
163
- format: 'vc+sd-jwt';
164
- /**
165
- * Internal stable representation of a Presentation
166
- */
167
- presentation: SdJwtDecodedVerifiableCredential;
168
- /**
169
- * Wrapped Verifiable Credentials belonging to the Presentation. Will always be an array
170
- * with a single SdJwtVerifiableCredential entry.
171
- */
172
- vcs: [WrappedSdJwtVerifiableCredential];
173
- }
174
- export declare function isWrappedSdJwtVerifiableCredential(vc: WrappedVerifiableCredential): vc is WrappedSdJwtVerifiableCredential;
175
- export declare function isWrappedSdJwtVerifiablePresentation(vp: WrappedVerifiablePresentation): vp is WrappedSdJwtVerifiablePresentation;
176
- /**
177
- * Decode an SD-JWT vc from its compact format (string) to an object containing the disclosures,
178
- * signed payload, decoded payload and the compact SD-JWT vc.
179
- *
180
- * Both the input and output interfaces of this method are defined in `@sphereon/ssi-types`, so
181
- * this method hides the actual implementation of SD-JWT (which is currently based on @sd-jwt/core)
182
- */
183
- export declare function decodeSdJwtVc(compactSdJwtVc: CompactSdJwtVc, hasher: HasherSync): SdJwtDecodedVerifiableCredential;
184
- /**
185
- * Decode an SD-JWT vc from its compact format (string) to an object containing the disclosures,
186
- * signed payload, decoded payload and the compact SD-JWT vc.
187
- *
188
- * Both the input and output interfaces of this method are defined in `@sphereon/ssi-types`, so
189
- * this method hides the actual implementation of SD-JWT (which is currently based on @sd-jwt/core)
190
- */
191
- export declare function decodeSdJwtVcAsync(compactSdJwtVc: CompactSdJwtVc, hasher: Hasher): Promise<SdJwtDecodedVerifiableCredential>;
192
- export declare const sdJwtDecodedCredentialToUniformCredential: (decoded: SdJwtDecodedVerifiableCredential, opts?: {
193
- maxTimeSkewInMS?: number;
194
- }) => IVerifiableCredential;
195
- export {};
196
- //# sourceMappingURL=sd-jwt-vc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sd-jwt-vc.d.ts","sourceRoot":"","sources":["../../src/types/sd-jwt-vc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,MAAM,CAAA;AAE/F,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CAAC,CAAA;AAEtG,KAAK,cAAc,GACf,MAAM,GACN,MAAM,GACN,OAAO,GACP;IACE,CAAC,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAA;IACvC,GAAG,CAAC,EAAE,MAAM,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g, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.sdJwtDecodedCredentialToUniformCredential = void 0;
13
- exports.isWrappedSdJwtVerifiableCredential = isWrappedSdJwtVerifiableCredential;
14
- exports.isWrappedSdJwtVerifiablePresentation = isWrappedSdJwtVerifiablePresentation;
15
- exports.decodeSdJwtVc = decodeSdJwtVc;
16
- exports.decodeSdJwtVcAsync = decodeSdJwtVcAsync;
17
- const decode_1 = require("@sd-jwt/decode");
18
- const did_1 = require("./did");
19
- function isWrappedSdJwtVerifiableCredential(vc) {
20
- return vc.format === 'vc+sd-jwt';
21
- }
22
- function isWrappedSdJwtVerifiablePresentation(vp) {
23
- return vp.format === 'vc+sd-jwt';
24
- }
25
- /**
26
- * Decode an SD-JWT vc from its compact format (string) to an object containing the disclosures,
27
- * signed payload, decoded payload and the compact SD-JWT vc.
28
- *
29
- * Both the input and output interfaces of this method are defined in `@sphereon/ssi-types`, so
30
- * this method hides the actual implementation of SD-JWT (which is currently based on @sd-jwt/core)
31
- */
32
- function decodeSdJwtVc(compactSdJwtVc, hasher) {
33
- const { jwt, disclosures, kbJwt } = (0, decode_1.decodeSdJwtSync)(compactSdJwtVc, hasher);
34
- const signedPayload = jwt.payload;
35
- const decodedPayload = (0, decode_1.getClaimsSync)(signedPayload, disclosures, hasher);
36
- const compactKeyBindingJwt = kbJwt ? compactSdJwtVc.split('~').pop() : undefined;
37
- return Object.assign({ compactSdJwtVc, decodedPayload: decodedPayload, disclosures: disclosures.map((d) => {
38
- const decoded = d.key ? [d.salt, d.key, d.value] : [d.salt, d.value];
39
- if (!d._digest)
40
- throw new Error('Implementation error: digest not present in disclosure');
41
- return {
42
- decoded: decoded,
43
- digest: d._digest,
44
- encoded: d.encode(),
45
- };
46
- }), signedPayload: signedPayload }, (compactKeyBindingJwt &&
47
- kbJwt && {
48
- kbJwt: {
49
- header: kbJwt.header,
50
- compact: compactKeyBindingJwt,
51
- payload: kbJwt.payload,
52
- },
53
- }));
54
- }
55
- /**
56
- * Decode an SD-JWT vc from its compact format (string) to an object containing the disclosures,
57
- * signed payload, decoded payload and the compact SD-JWT vc.
58
- *
59
- * Both the input and output interfaces of this method are defined in `@sphereon/ssi-types`, so
60
- * this method hides the actual implementation of SD-JWT (which is currently based on @sd-jwt/core)
61
- */
62
- function decodeSdJwtVcAsync(compactSdJwtVc, hasher) {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- const { jwt, disclosures, kbJwt } = yield (0, decode_1.decodeSdJwt)(compactSdJwtVc, hasher);
65
- const signedPayload = jwt.payload;
66
- const decodedPayload = yield (0, decode_1.getClaims)(signedPayload, disclosures, hasher);
67
- const compactKeyBindingJwt = kbJwt ? compactSdJwtVc.split('~').pop() : undefined;
68
- return Object.assign({ compactSdJwtVc, decodedPayload: decodedPayload, disclosures: disclosures.map((d) => {
69
- const decoded = d.key ? [d.salt, d.key, d.value] : [d.salt, d.value];
70
- if (!d._digest)
71
- throw new Error('Implementation error: digest not present in disclosure');
72
- return {
73
- decoded: decoded,
74
- digest: d._digest,
75
- encoded: d.encode(),
76
- };
77
- }), signedPayload: signedPayload }, (compactKeyBindingJwt &&
78
- kbJwt && {
79
- kbJwt: {
80
- header: kbJwt.header,
81
- payload: kbJwt.payload,
82
- compact: compactKeyBindingJwt,
83
- },
84
- }));
85
- });
86
- }
87
- const sdJwtDecodedCredentialToUniformCredential = (decoded, opts) => {
88
- var _a, _b, _c;
89
- const { decodedPayload } = decoded;
90
- const { exp, nbf, iss, iat, vct, cnf, status, sub, jti } = decodedPayload;
91
- const maxSkewInMS = (_a = opts === null || opts === void 0 ? void 0 : opts.maxTimeSkewInMS) !== null && _a !== void 0 ? _a : 1500;
92
- const expirationDate = jwtDateToISOString({ jwtClaim: exp, claimName: 'exp' });
93
- let issuanceDateStr = jwtDateToISOString({ jwtClaim: iat, claimName: 'iat' });
94
- let nbfDateAsStr;
95
- if (nbf) {
96
- nbfDateAsStr = jwtDateToISOString({ jwtClaim: nbf, claimName: 'nbf' });
97
- if (issuanceDateStr && nbfDateAsStr && issuanceDateStr !== nbfDateAsStr) {
98
- const diff = Math.abs(new Date(nbfDateAsStr).getTime() - new Date(iss).getTime());
99
- if (!maxSkewInMS || diff > maxSkewInMS) {
100
- throw Error(`Inconsistent issuance dates between JWT claim (${nbfDateAsStr}) and VC value (${iss})`);
101
- }
102
- }
103
- issuanceDateStr = nbfDateAsStr;
104
- }
105
- const issuanceDate = issuanceDateStr;
106
- if (!issuanceDate) {
107
- throw Error(`JWT issuance date is required but was not present`);
108
- }
109
- // Filter out the fields we don't want in credentialSubject
110
- const excludedFields = new Set(['vct', 'cnf', 'iss', 'iat', 'exp', 'nbf', 'jti', 'sub']);
111
- const credentialSubject = Object.entries(decodedPayload).reduce((acc, [key, value]) => {
112
- if (!excludedFields.has(key) &&
113
- value !== undefined &&
114
- value !== '' &&
115
- !(typeof value === 'object' && value !== null && Object.keys(value).length === 0)) {
116
- acc[key] = value;
117
- }
118
- return acc;
119
- }, {});
120
- const credential = Object.assign(Object.assign(Object.assign({ type: [vct], '@context': [], credentialSubject: Object.assign(Object.assign({}, credentialSubject), { id: (_c = (_b = credentialSubject.id) !== null && _b !== void 0 ? _b : sub) !== null && _c !== void 0 ? _c : jti }), issuanceDate,
121
- expirationDate, issuer: iss }, (cnf && { cnf })), (status && { status })), { proof: {
122
- type: did_1.IProofType.SdJwtProof2024,
123
- created: nbfDateAsStr !== null && nbfDateAsStr !== void 0 ? nbfDateAsStr : issuanceDate,
124
- proofPurpose: did_1.IProofPurpose.authentication,
125
- verificationMethod: iss,
126
- jwt: decoded.compactSdJwtVc,
127
- } });
128
- return credential;
129
- };
130
- exports.sdJwtDecodedCredentialToUniformCredential = sdJwtDecodedCredentialToUniformCredential;
131
- const jwtDateToISOString = ({ jwtClaim, claimName, isRequired = false, }) => {
132
- if (jwtClaim) {
133
- const claim = parseInt(jwtClaim.toString());
134
- // change JWT seconds to millisecond for the date
135
- return new Date(claim * (claim < 9999999999 ? 1000 : 1)).toISOString().replace(/\.000Z/, 'Z');
136
- }
137
- else if (isRequired) {
138
- throw Error(`JWT claim ${claimName} is required but was not present`);
139
- }
140
- return undefined;
141
- };
142
- //# sourceMappingURL=sd-jwt-vc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sd-jwt-vc.js","sourceRoot":"","sources":["../../src/types/sd-jwt-vc.ts"],"names":[],"mappings":";;;;;;;;;;;;AAyMA,gFAEC;AAED,oFAEC;AASD,sCA6BC;AASD,gDA6BC;AA1RD,2CAAuF;AAEvF,+BAAiD;AAsMjD,SAAgB,kCAAkC,CAAC,EAA+B;IAChF,OAAO,EAAE,CAAC,MAAM,KAAK,WAAW,CAAA;AAClC,CAAC;AAED,SAAgB,oCAAoC,CAAC,EAAiC;IACpF,OAAO,EAAE,CAAC,MAAM,KAAK,WAAW,CAAA;AAClC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,cAA8B,EAAE,MAAkB;IAC9E,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,IAAA,wBAAe,EAAC,cAAc,EAAE,MAAM,CAAC,CAAA;IAE3E,MAAM,aAAa,GAAG,GAAG,CAAC,OAAiD,CAAA;IAC3E,MAAM,cAAc,GAAG,IAAA,sBAAa,EAAC,aAAa,EAAE,WAAW,EAAE,MAAM,CAAC,CAAA;IACxE,MAAM,oBAAoB,GAAG,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAA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AAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;IAC/F,CAAC;SAAM,IAAI,UAAU,EAAE,CAAC;QACtB,MAAM,KAAK,CAAC,aAAa,SAAS,kCAAkC,CAAC,CAAA;IACvE,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA"}
@@ -1,10 +0,0 @@
1
- import { W3CVerifiableCredential } from './w3c-vc';
2
- import { ProofFormat as VeramoProofFormat } from '@veramo/core';
3
- export declare enum StatusListType {
4
- StatusList2021 = "StatusList2021",
5
- OAuthStatusList = "OAuthStatusList"
6
- }
7
- export type CWT = string;
8
- export type StatusListCredential = W3CVerifiableCredential | CWT;
9
- export type ProofFormat = VeramoProofFormat | 'cbor';
10
- //# sourceMappingURL=status-list.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"status-list.d.ts","sourceRoot":"","sources":["../../src/types/status-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAE/D,oBAAY,cAAc;IACxB,cAAc,mBAAmB;IACjC,eAAe,oBAAoB;CACpC;AACD,MAAM,MAAM,GAAG,GAAG,MAAM,CAAA;AAExB,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,GAAG,GAAG,CAAA;AAEhE,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,MAAM,CAAA"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StatusListType = void 0;
4
- var StatusListType;
5
- (function (StatusListType) {
6
- StatusListType["StatusList2021"] = "StatusList2021";
7
- StatusListType["OAuthStatusList"] = "OAuthStatusList";
8
- })(StatusListType || (exports.StatusListType = StatusListType = {}));
9
- //# sourceMappingURL=status-list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"status-list.js","sourceRoot":"","sources":["../../src/types/status-list.ts"],"names":[],"mappings":";;;AAGA,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,mDAAiC,CAAA;IACjC,qDAAmC,CAAA;AACrC,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB"}
@@ -1,28 +0,0 @@
1
- import { MdocDeviceResponse, MdocDocument, MdocOid4vpIssuerSigned, MdocOid4vpMdocVpToken, WrappedMdocCredential, WrappedMdocPresentation } from './mso_mdoc';
2
- import { SdJwtDecodedVerifiableCredential, WrappedSdJwtVerifiableCredential, WrappedSdJwtVerifiablePresentation } from './sd-jwt-vc';
3
- import { JwtDecodedVerifiableCredential, JwtDecodedVerifiablePresentation, W3CVerifiableCredential, W3CVerifiablePresentation, WrappedW3CVerifiableCredential, WrappedW3CVerifiablePresentation } from './w3c-vc';
4
- export type WrappedVerifiableCredential = WrappedW3CVerifiableCredential | WrappedSdJwtVerifiableCredential | WrappedMdocCredential;
5
- export type WrappedVerifiablePresentation = WrappedW3CVerifiablePresentation | WrappedSdJwtVerifiablePresentation | WrappedMdocPresentation;
6
- export declare enum OriginalType {
7
- JSONLD = "json-ld",
8
- JWT_ENCODED = "jwt-encoded",
9
- JWT_DECODED = "jwt-decoded",
10
- SD_JWT_VC_ENCODED = "sd-jwt-vc-encoded",
11
- SD_JWT_VC_DECODED = "sd-jwt-vc-decoded",
12
- MSO_MDOC_ENCODED = "mso_mdoc-encoded",
13
- MSO_MDOC_DECODED = "mso_mdoc-decoded"
14
- }
15
- export type CredentialFormat = 'jwt_vc' | 'ldp_vc' | 'vc+sd-jwt' | 'jwt' | 'ldp' | 'mso_mdoc' | string;
16
- export type PresentationFormat = 'jwt_vp' | 'ldp_vp' | 'vc+sd-jwt' | 'jwt' | 'ldp' | 'mso_mdoc' | string;
17
- export type ClaimFormat = CredentialFormat | PresentationFormat;
18
- export type OriginalVerifiableCredential = W3CVerifiableCredential | JwtDecodedVerifiableCredential | SdJwtDecodedVerifiableCredential | MdocOid4vpIssuerSigned | MdocDocument;
19
- export type OriginalVerifiablePresentation = W3CVerifiablePresentation | JwtDecodedVerifiablePresentation | SdJwtDecodedVerifiableCredential | MdocOid4vpMdocVpToken | MdocDeviceResponse;
20
- export type Original = OriginalVerifiablePresentation | OriginalVerifiableCredential;
21
- export declare const enum DocumentFormat {
22
- JWT = 0,
23
- JSONLD = 1,
24
- SD_JWT_VC = 2,
25
- EIP712 = 3,
26
- MSO_MDOC = 4
27
- }
28
- //# sourceMappingURL=vc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vc.d.ts","sourceRoot":"","sources":["../../src/types/vc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,gCAAgC,EAAE,gCAAgC,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAA;AACpI,OAAO,EACL,8BAA8B,EAC9B,gCAAgC,EAChC,uBAAuB,EACvB,yBAAyB,EACzB,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,UAAU,CAAA;AAEjB,MAAM,MAAM,2BAA2B,GAAG,8BAA8B,GAAG,gCAAgC,GAAG,qBAAqB,CAAA;AAEnI,MAAM,MAAM,6BAA6B,GAAG,gCAAgC,GAAG,kCAAkC,GAAG,uBAAuB,CAAA;AAE3I,oBAAY,YAAY;IAEtB,MAAM,YAAY;IAClB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAG3B,iBAAiB,sBAAsB;IACvC,iBAAiB,sBAAsB;IAGvC,gBAAgB,qBAAqB;IACrC,gBAAgB,qBAAqB;CACtC;AAED,MAAM,MAAM,gBAAgB,GAExB,QAAQ,GACR,QAAQ,GAER,WAAW,GAEX,KAAK,GACL,KAAK,GACL,UAAU,GACV,MAAM,CAAA;AAEV,MAAM,MAAM,kBAAkB,GAE1B,QAAQ,GACR,QAAQ,GAER,WAAW,GAEX,KAAK,GACL,KAAK,GACL,UAAU,GACV,MAAM,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,kBAAkB,CAAA;AAE/D,MAAM,MAAM,4BAA4B,GACpC,uBAAuB,GACvB,8BAA8B,GAC9B,gCAAgC,GAChC,sBAAsB,GACtB,YAAY,CAAA;AAChB,MAAM,MAAM,8BAA8B,GACtC,yBAAyB,GACzB,gCAAgC,GAChC,gCAAgC,GAChC,qBAAqB,GACrB,kBAAkB,CAAA;AACtB,MAAM,MAAM,QAAQ,GAAG,8BAA8B,GAAG,4BAA4B,CAAA;AAEpF,0BAAkB,cAAc;IAE9B,GAAG,IAAA;IACH,MAAM,IAAA;IAEN,SAAS,IAAA;IAET,MAAM,IAAA;IACN,QAAQ,IAAA;CACT"}
package/dist/types/vc.js DELETED
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DocumentFormat = exports.OriginalType = void 0;
4
- var OriginalType;
5
- (function (OriginalType) {
6
- // W3C
7
- OriginalType["JSONLD"] = "json-ld";
8
- OriginalType["JWT_ENCODED"] = "jwt-encoded";
9
- OriginalType["JWT_DECODED"] = "jwt-decoded";
10
- // SD-JWT
11
- OriginalType["SD_JWT_VC_ENCODED"] = "sd-jwt-vc-encoded";
12
- OriginalType["SD_JWT_VC_DECODED"] = "sd-jwt-vc-decoded";
13
- // MSO MDOCS
14
- OriginalType["MSO_MDOC_ENCODED"] = "mso_mdoc-encoded";
15
- OriginalType["MSO_MDOC_DECODED"] = "mso_mdoc-decoded";
16
- })(OriginalType || (exports.OriginalType = OriginalType = {}));
17
- var DocumentFormat;
18
- (function (DocumentFormat) {
19
- // W3C
20
- DocumentFormat[DocumentFormat["JWT"] = 0] = "JWT";
21
- DocumentFormat[DocumentFormat["JSONLD"] = 1] = "JSONLD";
22
- // SD-JWT
23
- DocumentFormat[DocumentFormat["SD_JWT_VC"] = 2] = "SD_JWT_VC";
24
- // Remaining
25
- DocumentFormat[DocumentFormat["EIP712"] = 3] = "EIP712";
26
- DocumentFormat[DocumentFormat["MSO_MDOC"] = 4] = "MSO_MDOC";
27
- })(DocumentFormat || (exports.DocumentFormat = DocumentFormat = {}));
28
- //# sourceMappingURL=vc.js.map