@sphereon/ssi-types 0.17.6-unstable.8 → 0.18.0
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/dist/mapper/credential-mapper.d.ts +70 -7
- package/dist/mapper/credential-mapper.d.ts.map +1 -1
- package/dist/mapper/credential-mapper.js +168 -8
- package/dist/mapper/credential-mapper.js.map +1 -1
- package/dist/types/generic.d.ts +1 -0
- package/dist/types/generic.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/sd-jwt-vc.d.ts +171 -0
- package/dist/types/sd-jwt-vc.d.ts.map +1 -0
- package/dist/types/sd-jwt-vc.js +87 -0
- package/dist/types/sd-jwt-vc.js.map +1 -0
- package/dist/types/vc.d.ts +13 -250
- package/dist/types/vc.d.ts.map +1 -1
- package/dist/types/vc.js +10 -20
- package/dist/types/vc.js.map +1 -1
- package/dist/types/w3c-vc.d.ts +248 -0
- package/dist/types/w3c-vc.d.ts.map +1 -0
- package/dist/types/w3c-vc.js +30 -0
- package/dist/types/w3c-vc.js.map +1 -0
- package/dist/utils/object.d.ts +1 -1
- package/dist/utils/object.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/mapper/credential-mapper.ts +214 -24
- package/src/types/generic.ts +2 -0
- package/src/types/index.ts +2 -0
- package/src/types/sd-jwt-vc.ts +248 -0
- package/src/types/vc.ts +44 -293
- package/src/types/w3c-vc.ts +300 -0
- package/src/utils/object.ts +1 -1
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { OriginalType, WrappedVerifiableCredential, WrappedVerifiablePresentation } from './vc';
|
|
2
|
+
type JsonValue = string | number | boolean | {
|
|
3
|
+
[x: string]: JsonValue | undefined;
|
|
4
|
+
} | Array<JsonValue>;
|
|
5
|
+
type SdJwtJsonValue = string | number | boolean | {
|
|
6
|
+
[x: string]: SdJwtJsonValue | undefined;
|
|
7
|
+
_sd?: string[];
|
|
8
|
+
} | Array<SdJwtJsonValue | {
|
|
9
|
+
'...': string;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Decoded 'pretty' SD JWT Verifiable Credential. This representation has all the `_sd` properties
|
|
13
|
+
* removed, and includes the disclosures directly within the payload.
|
|
14
|
+
*/
|
|
15
|
+
export interface SdJwtDecodedVerifiableCredentialPayload {
|
|
16
|
+
vct: string;
|
|
17
|
+
iss: string;
|
|
18
|
+
iat: number;
|
|
19
|
+
nbf?: number;
|
|
20
|
+
exp?: number;
|
|
21
|
+
cnf?: {
|
|
22
|
+
jwk?: any;
|
|
23
|
+
kid?: string;
|
|
24
|
+
};
|
|
25
|
+
status?: {
|
|
26
|
+
idx: number;
|
|
27
|
+
uri: string;
|
|
28
|
+
};
|
|
29
|
+
sub?: string;
|
|
30
|
+
[key: string]: JsonValue | undefined;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Represents a selective disclosure JWT vc in compact form.
|
|
34
|
+
*/
|
|
35
|
+
export type CompactSdJwtVc = string;
|
|
36
|
+
/**
|
|
37
|
+
* The signed payload of an SD-JWT. Includes fields such as `_sd`, `...` and `_sd_alg`
|
|
38
|
+
*/
|
|
39
|
+
interface SdJwtSignedVerifiableCredentialPayload extends SdJwtDecodedVerifiableCredentialPayload {
|
|
40
|
+
_sd?: string[];
|
|
41
|
+
_sd_alg?: string;
|
|
42
|
+
[x: string]: SdJwtJsonValue | undefined;
|
|
43
|
+
}
|
|
44
|
+
type SdJwtFrameValue = boolean | Array<SdJwtFrameValue> | {
|
|
45
|
+
[x: string]: SdJwtFrameValue;
|
|
46
|
+
};
|
|
47
|
+
export type SdJwtDisclosureFrame = Record<string, SdJwtFrameValue>;
|
|
48
|
+
export type SdJwtPresentationFrame = Record<string, SdJwtFrameValue>;
|
|
49
|
+
/**
|
|
50
|
+
* Input for creating a SD JWT Verifiable Credential. This representation optionally includes the disclosure frame,
|
|
51
|
+
* (as `__disclosureFrame`) to indicate which fields in the signed SD-JWT should be selectively discloseable
|
|
52
|
+
*/
|
|
53
|
+
export interface SdJwtCredentialInput extends SdJwtDecodedVerifiableCredentialPayload {
|
|
54
|
+
/**
|
|
55
|
+
* Disclosure frame, indicating which fields in the signed SD-JWT should be selectively discloseable
|
|
56
|
+
* Will be removed from the actual SD-JWT payload before signing
|
|
57
|
+
*/
|
|
58
|
+
__disclosureFrame?: SdJwtDisclosureFrame;
|
|
59
|
+
}
|
|
60
|
+
export type SdJwtDecodedDisclosure = [string, string, JsonValue] | [string, JsonValue];
|
|
61
|
+
export interface SdJwtDisclosure {
|
|
62
|
+
encoded: string;
|
|
63
|
+
decoded: SdJwtDecodedDisclosure;
|
|
64
|
+
digest: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The decoded SD JWT Verifiable Credential. This representation includes multiple representations of the
|
|
68
|
+
* 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
|
|
69
|
+
* certain disclosures from the compact SD-JWT.
|
|
70
|
+
*
|
|
71
|
+
* This representation is useful as it doesn't require a hasher implementation to match the different digests in the signed SD-JWT
|
|
72
|
+
* payload, with the different disclosures.
|
|
73
|
+
*/
|
|
74
|
+
export interface SdJwtDecodedVerifiableCredential {
|
|
75
|
+
/**
|
|
76
|
+
* The compact sd jwt is the sd-jwt encoded as string. It is a normal JWT,
|
|
77
|
+
* with the disclosures and kb-jwt appended separated by ~ */
|
|
78
|
+
compactSdJwtVc: string;
|
|
79
|
+
/**
|
|
80
|
+
* The disclosures included within the SD-JWT in both encoded and decoded format.
|
|
81
|
+
* The digests are also included, and allows the disclosures to be linked against
|
|
82
|
+
* the digests in the signed payload.
|
|
83
|
+
*/
|
|
84
|
+
disclosures: Array<SdJwtDisclosure>;
|
|
85
|
+
/**
|
|
86
|
+
* The signed payload is the payload of the sd-jwt that is actually signed, and that includes
|
|
87
|
+
* the `_sd` and `...` digests.
|
|
88
|
+
*/
|
|
89
|
+
signedPayload: SdJwtSignedVerifiableCredentialPayload;
|
|
90
|
+
/**
|
|
91
|
+
* The decoded payload is the payload when all `_sd` and `...` digests have been replaced
|
|
92
|
+
* by the actual values from the disclosures. This format could also be seen as the 'pretty`
|
|
93
|
+
* version of the SD JWT payload.
|
|
94
|
+
*
|
|
95
|
+
* This is useful for displaying the contents of the SD JWT VC to the user, or for example
|
|
96
|
+
* for querying the contents of the SD JWT VC using a PEX presentation definition path.
|
|
97
|
+
*/
|
|
98
|
+
decodedPayload: SdJwtDecodedVerifiableCredentialPayload;
|
|
99
|
+
}
|
|
100
|
+
export interface WrappedSdJwtVerifiableCredential {
|
|
101
|
+
/**
|
|
102
|
+
* Original VC that we've received. Can be either the encoded or decoded variant.
|
|
103
|
+
*/
|
|
104
|
+
original: SdJwtDecodedVerifiableCredential | CompactSdJwtVc;
|
|
105
|
+
/**
|
|
106
|
+
* Decoded version of the SD-JWT payload. This is the decoded payload, rather than the whole SD-JWT as the `decoded` property
|
|
107
|
+
* is used in e.g. PEX to check for path filters from fields. The full decoded credential can be found in the `credential` field.
|
|
108
|
+
*/
|
|
109
|
+
decoded: SdJwtDecodedVerifiableCredentialPayload;
|
|
110
|
+
/**
|
|
111
|
+
* Type of this credential.
|
|
112
|
+
*/
|
|
113
|
+
type: OriginalType.SD_JWT_VC_DECODED | OriginalType.SD_JWT_VC_ENCODED;
|
|
114
|
+
/**
|
|
115
|
+
* The claim format, typically used during exchange transport protocols
|
|
116
|
+
*/
|
|
117
|
+
format: 'vc+sd-jwt';
|
|
118
|
+
/**
|
|
119
|
+
* Internal stable representation of a Credential
|
|
120
|
+
*/
|
|
121
|
+
credential: SdJwtDecodedVerifiableCredential;
|
|
122
|
+
}
|
|
123
|
+
export interface WrappedSdJwtVerifiablePresentation {
|
|
124
|
+
/**
|
|
125
|
+
* Original VP that we've received. Can be either the encoded or decoded variant.
|
|
126
|
+
*/
|
|
127
|
+
original: SdJwtDecodedVerifiableCredential | CompactSdJwtVc;
|
|
128
|
+
/**
|
|
129
|
+
* Decoded version of the SD-JWT payload. This is the decoded payload, rather than the whole SD-JWT.
|
|
130
|
+
*/
|
|
131
|
+
decoded: SdJwtDecodedVerifiableCredentialPayload;
|
|
132
|
+
/**
|
|
133
|
+
* Type of this Presentation.
|
|
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 Presentation
|
|
142
|
+
*/
|
|
143
|
+
presentation: SdJwtDecodedVerifiableCredential;
|
|
144
|
+
/**
|
|
145
|
+
* Wrapped Verifiable Credentials belonging to the Presentation. Will always be an array
|
|
146
|
+
* with a single SdJwtVerifiableCredential entry.
|
|
147
|
+
*/
|
|
148
|
+
vcs: [WrappedSdJwtVerifiableCredential];
|
|
149
|
+
}
|
|
150
|
+
export declare function isWrappedSdJwtVerifiableCredential(vc: WrappedVerifiableCredential): vc is WrappedSdJwtVerifiableCredential;
|
|
151
|
+
export declare function isWrappedSdJwtVerifiablePresentation(vp: WrappedVerifiablePresentation): vp is WrappedSdJwtVerifiablePresentation;
|
|
152
|
+
export type Hasher = (data: string, alg: string) => Uint8Array;
|
|
153
|
+
export type AsyncHasher = (data: string, alg: string) => Promise<Uint8Array>;
|
|
154
|
+
/**
|
|
155
|
+
* Decode an SD-JWT vc from its compact format (string) to an object containing the disclosures,
|
|
156
|
+
* signed payload, decoded payload and the compact SD-JWT vc.
|
|
157
|
+
*
|
|
158
|
+
* Both the input and output interfaces of this method are defined in `@sphereon/ssi-types`, so
|
|
159
|
+
* this method hides the actual implementation of SD-JWT (which is currently based on @sd-jwt/core)
|
|
160
|
+
*/
|
|
161
|
+
export declare function decodeSdJwtVc(compactSdJwtVc: CompactSdJwtVc, hasher: Hasher): SdJwtDecodedVerifiableCredential;
|
|
162
|
+
/**
|
|
163
|
+
* Decode an SD-JWT vc from its compact format (string) to an object containing the disclosures,
|
|
164
|
+
* signed payload, decoded payload and the compact SD-JWT vc.
|
|
165
|
+
*
|
|
166
|
+
* Both the input and output interfaces of this method are defined in `@sphereon/ssi-types`, so
|
|
167
|
+
* this method hides the actual implementation of SD-JWT (which is currently based on @sd-jwt/core)
|
|
168
|
+
*/
|
|
169
|
+
export declare function decodeSdJwtVcAsync(compactSdJwtVc: CompactSdJwtVc, hasher: AsyncHasher): Promise<SdJwtDecodedVerifiableCredential>;
|
|
170
|
+
export {};
|
|
171
|
+
//# sourceMappingURL=sd-jwt-vc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AAG/F,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,EAAE,CAAA;CACf,GACD,KAAK,CAAC,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAE7C;;;GAGG;AACH,MAAM,WAAW,uCAAuC;IACtD,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;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C,UAAU,CAAC,CAAA;AAE5E;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,gCAAgC,CAuB9G;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAyBvI"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _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.decodeSdJwtVcAsync = exports.decodeSdJwtVc = exports.isWrappedSdJwtVerifiablePresentation = exports.isWrappedSdJwtVerifiableCredential = void 0;
|
|
13
|
+
const core_1 = require("@sd-jwt/core");
|
|
14
|
+
const swapClaim_1 = require("@sd-jwt/core/build/sdJwt/swapClaim");
|
|
15
|
+
function isWrappedSdJwtVerifiableCredential(vc) {
|
|
16
|
+
return vc.format === 'vc+sd-jwt';
|
|
17
|
+
}
|
|
18
|
+
exports.isWrappedSdJwtVerifiableCredential = isWrappedSdJwtVerifiableCredential;
|
|
19
|
+
function isWrappedSdJwtVerifiablePresentation(vp) {
|
|
20
|
+
return vp.format === 'vc+sd-jwt';
|
|
21
|
+
}
|
|
22
|
+
exports.isWrappedSdJwtVerifiablePresentation = isWrappedSdJwtVerifiablePresentation;
|
|
23
|
+
/**
|
|
24
|
+
* Decode an SD-JWT vc from its compact format (string) to an object containing the disclosures,
|
|
25
|
+
* signed payload, decoded payload and the compact SD-JWT vc.
|
|
26
|
+
*
|
|
27
|
+
* Both the input and output interfaces of this method are defined in `@sphereon/ssi-types`, so
|
|
28
|
+
* this method hides the actual implementation of SD-JWT (which is currently based on @sd-jwt/core)
|
|
29
|
+
*/
|
|
30
|
+
function decodeSdJwtVc(compactSdJwtVc, hasher) {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
const sdJwtVc = core_1.SdJwtVc.fromCompact(compactSdJwtVc);
|
|
33
|
+
// Default (should be handled by the sd-jwt library)
|
|
34
|
+
let sdAlg = 'sha-256';
|
|
35
|
+
try {
|
|
36
|
+
sdAlg = sdJwtVc.getClaimInPayload('_sd_alg');
|
|
37
|
+
}
|
|
38
|
+
catch (_c) {
|
|
39
|
+
/* no-op */
|
|
40
|
+
}
|
|
41
|
+
const disclosuresWithDigests = (_b = (_a = sdJwtVc.disclosures) === null || _a === void 0 ? void 0 : _a.map((d) => d.withCalculateDigest((data) => hasher(data, sdAlg)))) !== null && _b !== void 0 ? _b : [];
|
|
42
|
+
return {
|
|
43
|
+
compactSdJwtVc: compactSdJwtVc,
|
|
44
|
+
decodedPayload: (0, swapClaim_1.swapClaims)(sdJwtVc.payload, disclosuresWithDigests),
|
|
45
|
+
disclosures: disclosuresWithDigests.map((d) => ({
|
|
46
|
+
decoded: d.decoded,
|
|
47
|
+
digest: d.digest,
|
|
48
|
+
encoded: d.encoded,
|
|
49
|
+
})),
|
|
50
|
+
signedPayload: sdJwtVc.payload,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
exports.decodeSdJwtVc = decodeSdJwtVc;
|
|
54
|
+
/**
|
|
55
|
+
* Decode an SD-JWT vc from its compact format (string) to an object containing the disclosures,
|
|
56
|
+
* signed payload, decoded payload and the compact SD-JWT vc.
|
|
57
|
+
*
|
|
58
|
+
* Both the input and output interfaces of this method are defined in `@sphereon/ssi-types`, so
|
|
59
|
+
* this method hides the actual implementation of SD-JWT (which is currently based on @sd-jwt/core)
|
|
60
|
+
*/
|
|
61
|
+
function decodeSdJwtVcAsync(compactSdJwtVc, hasher) {
|
|
62
|
+
var _a, _b;
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const sdJwtVc = core_1.SdJwtVc.fromCompact(compactSdJwtVc);
|
|
65
|
+
// Default (should be handled by the sd-jwt library)
|
|
66
|
+
let sdAlg = 'sha-256';
|
|
67
|
+
try {
|
|
68
|
+
sdAlg = sdJwtVc.getClaimInPayload('_sd_alg');
|
|
69
|
+
}
|
|
70
|
+
catch (_c) {
|
|
71
|
+
/* no-op */
|
|
72
|
+
}
|
|
73
|
+
const disclosuresWithDigests = yield Promise.all((_b = (_a = sdJwtVc.disclosures) === null || _a === void 0 ? void 0 : _a.map((d) => d.withCalculateDigest((data) => hasher(data, sdAlg)))) !== null && _b !== void 0 ? _b : []);
|
|
74
|
+
return {
|
|
75
|
+
compactSdJwtVc: compactSdJwtVc,
|
|
76
|
+
decodedPayload: (0, swapClaim_1.swapClaims)(sdJwtVc.payload, disclosuresWithDigests),
|
|
77
|
+
disclosures: disclosuresWithDigests.map((d) => ({
|
|
78
|
+
decoded: d.decoded,
|
|
79
|
+
digest: d.digest,
|
|
80
|
+
encoded: d.encoded,
|
|
81
|
+
})),
|
|
82
|
+
signedPayload: sdJwtVc.payload,
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
exports.decodeSdJwtVcAsync = decodeSdJwtVcAsync;
|
|
87
|
+
//# sourceMappingURL=sd-jwt-vc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sd-jwt-vc.js","sourceRoot":"","sources":["../../src/types/sd-jwt-vc.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,uCAAsC;AACtC,kEAA+D;AA0K/D,SAAgB,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CAAC,cAAc,CAAC,CAAA;QAEnD,oDAAoD;QACpD,IAAI,KAAK,GAAG,SAAS,CAAA;QACrB,IAAI;YACF,KAAK,GAAG,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAA;SAC7C;QAAC,WAAM;YACN,WAAW;SACZ;QAED,MAAM,sBAAsB,GAAG,MAAM,OAAO,CAAC,GAAG,CAC9C,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,mCAAI,EAAE,CACpG,CAAA;QAED,OAAO;YACL,cAAc,EAAE,cAAc;YAC9B,cAAc,EAAE,IAAA,sBAAU,EAAC,OAAO,CAAC,OAAO,EAAE,sBAAsB,CAA4C;YAC9G,WAAW,EAAE,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC9C,OAAO,EAAE,CAAC,CAAC,OAAiC;gBAC5C,MAAM,EAAE,CAAC,CAAC,MAAM;gBAChB,OAAO,EAAE,CAAC,CAAC,OAAO;aACnB,CAAC,CAAC;YACH,aAAa,EAAE,OAAO,CAAC,OAAkD;SAC1E,CAAA;;CACF;AAzBD,gDAyBC"}
|
package/dist/types/vc.d.ts
CHANGED
|
@@ -1,261 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export interface ICredential {
|
|
6
|
-
'@context': ICredentialContextType | ICredentialContextType[];
|
|
7
|
-
type: string[];
|
|
8
|
-
credentialSchema?: undefined | ICredentialSchemaType | ICredentialSchemaType[];
|
|
9
|
-
issuer: IIssuerId | IIssuer;
|
|
10
|
-
issuanceDate: string;
|
|
11
|
-
credentialSubject: (ICredentialSubject & AdditionalClaims) | (ICredentialSubject & AdditionalClaims)[];
|
|
12
|
-
expirationDate?: string;
|
|
13
|
-
id?: string;
|
|
14
|
-
credentialStatus?: ICredentialStatus;
|
|
15
|
-
description?: string;
|
|
16
|
-
name?: string;
|
|
17
|
-
[x: string]: any;
|
|
18
|
-
}
|
|
19
|
-
export interface ICredentialSubject {
|
|
20
|
-
id?: string;
|
|
21
|
-
}
|
|
22
|
-
export type ICredentialContextType = (ICredentialContext & AdditionalClaims) | string;
|
|
23
|
-
export interface ICredentialContext {
|
|
24
|
-
name?: string;
|
|
25
|
-
did?: string;
|
|
26
|
-
}
|
|
27
|
-
export type ICredentialSchemaType = ICredentialSchema | string;
|
|
28
|
-
export interface ICredentialSchema {
|
|
29
|
-
id: string;
|
|
30
|
-
type?: string;
|
|
31
|
-
}
|
|
32
|
-
export interface IProof {
|
|
33
|
-
type: IProofType | string;
|
|
34
|
-
created: string;
|
|
35
|
-
proofPurpose: IProofPurpose | string;
|
|
36
|
-
verificationMethod: string;
|
|
37
|
-
challenge?: string;
|
|
38
|
-
domain?: string;
|
|
39
|
-
proofValue?: string;
|
|
40
|
-
jws?: string;
|
|
41
|
-
jwt?: string;
|
|
42
|
-
nonce?: string;
|
|
43
|
-
requiredRevealStatements?: string[];
|
|
44
|
-
[x: string]: any;
|
|
45
|
-
}
|
|
46
|
-
export interface ICredentialStatus {
|
|
47
|
-
id: string;
|
|
48
|
-
type: string;
|
|
49
|
-
}
|
|
50
|
-
export interface IIssuer {
|
|
51
|
-
id: string;
|
|
52
|
-
[x: string]: any;
|
|
53
|
-
}
|
|
54
|
-
export interface IHasProof {
|
|
55
|
-
proof: IProof | IProof[];
|
|
56
|
-
}
|
|
57
|
-
export type IVerifiableCredential = ICredential & IHasProof;
|
|
58
|
-
/**
|
|
59
|
-
* Represents a Json Web Token in compact form.
|
|
60
|
-
*/
|
|
61
|
-
export type CompactJWT = string;
|
|
62
|
-
/**
|
|
63
|
-
* Represents a signed Verifiable Credential (includes proof), in either JSON or compact JWT format.
|
|
64
|
-
* See {@link https://www.w3.org/TR/vc-data-model/#credentials | VC data model}
|
|
65
|
-
* See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats}
|
|
66
|
-
*/
|
|
67
|
-
export type W3CVerifiableCredential = IVerifiableCredential | CompactJWT;
|
|
68
|
-
export interface IPresentation {
|
|
69
|
-
id?: string;
|
|
70
|
-
'@context': ICredentialContextType | ICredentialContextType[];
|
|
71
|
-
type?: string | string[];
|
|
72
|
-
verifiableCredential?: W3CVerifiableCredential[];
|
|
73
|
-
presentation_submission?: PresentationSubmission;
|
|
74
|
-
holder?: string;
|
|
75
|
-
verifier?: string;
|
|
76
|
-
[x: string]: any;
|
|
77
|
-
}
|
|
78
|
-
export type IVerifiablePresentation = IPresentation & IHasProof;
|
|
79
|
-
/**
|
|
80
|
-
* Represents a signed Verifiable Presentation (includes proof), in either JSON or compact JWT format.
|
|
81
|
-
* See {@link https://www.w3.org/TR/vc-data-model/#presentations | VC data model}
|
|
82
|
-
* See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats}
|
|
83
|
-
*/
|
|
84
|
-
export type W3CVerifiablePresentation = IVerifiablePresentation | CompactJWT;
|
|
85
|
-
export interface WrappedVerifiableCredential {
|
|
86
|
-
/**
|
|
87
|
-
* Original VC that we've received
|
|
88
|
-
*/
|
|
89
|
-
original: OriginalVerifiableCredential;
|
|
90
|
-
/**
|
|
91
|
-
* In case of JWT credential it will be the decoded version. In other cases it will be the same as original one
|
|
92
|
-
*/
|
|
93
|
-
decoded: JwtDecodedVerifiableCredential | IVerifiableCredential;
|
|
94
|
-
/**
|
|
95
|
-
* Type of this credential. Supported types are json-ld and jwt (decoded/encoded)
|
|
96
|
-
*/
|
|
97
|
-
type: OriginalType;
|
|
98
|
-
/**
|
|
99
|
-
* The claim format, typically used during exchange transport protocols
|
|
100
|
-
*/
|
|
101
|
-
format: CredentialFormat;
|
|
102
|
-
/**
|
|
103
|
-
* Internal stable representation of a Credential
|
|
104
|
-
*/
|
|
105
|
-
credential: IVerifiableCredential;
|
|
106
|
-
}
|
|
107
|
-
export interface WrappedVerifiablePresentation {
|
|
108
|
-
/**
|
|
109
|
-
* Original VP that we've received
|
|
110
|
-
*/
|
|
111
|
-
original: OriginalVerifiablePresentation;
|
|
112
|
-
/**
|
|
113
|
-
* In case of JWT VP it will be the decoded version. In other cases it will be the same as original one
|
|
114
|
-
*/
|
|
115
|
-
decoded: JwtDecodedVerifiablePresentation | IVerifiablePresentation;
|
|
116
|
-
/**
|
|
117
|
-
* Type of this Presentation. Supported types are json-ld and jwt (decoded/encoded)
|
|
118
|
-
*/
|
|
119
|
-
type: OriginalType;
|
|
120
|
-
/**
|
|
121
|
-
* The claim format, typically used during exchange transport protocols
|
|
122
|
-
*/
|
|
123
|
-
format: PresentationFormat;
|
|
124
|
-
/**
|
|
125
|
-
* Internal stable representation of a Presentation without proofs, created based on https://www.w3.org/TR/vc-data-model/#jwt-decoding
|
|
126
|
-
*/
|
|
127
|
-
presentation: UniformVerifiablePresentation;
|
|
128
|
-
/**
|
|
129
|
-
* Wrapped Verifiable Credentials belonging to the Presentation
|
|
130
|
-
*/
|
|
131
|
-
vcs: WrappedVerifiableCredential[];
|
|
132
|
-
}
|
|
1
|
+
import { SdJwtDecodedVerifiableCredential, WrappedSdJwtVerifiableCredential, WrappedSdJwtVerifiablePresentation } from './sd-jwt-vc';
|
|
2
|
+
import { JwtDecodedVerifiableCredential, JwtDecodedVerifiablePresentation, W3CVerifiableCredential, W3CVerifiablePresentation, WrappedW3CVerifiableCredential, WrappedW3CVerifiablePresentation } from './w3c-vc';
|
|
3
|
+
export type WrappedVerifiableCredential = WrappedW3CVerifiableCredential | WrappedSdJwtVerifiableCredential;
|
|
4
|
+
export type WrappedVerifiablePresentation = WrappedW3CVerifiablePresentation | WrappedSdJwtVerifiablePresentation;
|
|
133
5
|
export declare enum OriginalType {
|
|
134
6
|
JSONLD = "json-ld",
|
|
135
7
|
JWT_ENCODED = "jwt-encoded",
|
|
136
|
-
JWT_DECODED = "jwt-decoded"
|
|
8
|
+
JWT_DECODED = "jwt-decoded",
|
|
9
|
+
SD_JWT_VC_ENCODED = "sd-jwt-vc-encoded",
|
|
10
|
+
SD_JWT_VC_DECODED = "sd-jwt-vc-decoded"
|
|
137
11
|
}
|
|
138
|
-
export
|
|
139
|
-
|
|
140
|
-
type: string | string[];
|
|
141
|
-
verifiableCredential: WrappedVerifiableCredential[];
|
|
142
|
-
presentation_submission?: PresentationSubmission;
|
|
143
|
-
holder?: string;
|
|
144
|
-
}
|
|
145
|
-
export interface JwtDecodedVerifiableCredential {
|
|
146
|
-
vc: IVerifiableCredential;
|
|
147
|
-
exp: string;
|
|
148
|
-
iss: string;
|
|
149
|
-
nbf: string;
|
|
150
|
-
sub: string;
|
|
151
|
-
jti: string;
|
|
152
|
-
[x: string]: any;
|
|
153
|
-
}
|
|
154
|
-
export interface JwtDecodedVerifiablePresentation {
|
|
155
|
-
vp: IVerifiablePresentation;
|
|
156
|
-
exp: string;
|
|
157
|
-
iss: string;
|
|
158
|
-
nbf: string;
|
|
159
|
-
sub: string;
|
|
160
|
-
jti: string;
|
|
161
|
-
aud: string;
|
|
162
|
-
iat: string;
|
|
163
|
-
[x: string]: any;
|
|
164
|
-
}
|
|
165
|
-
export type CredentialFormat = 'jwt' | 'ldp' | 'jwt_vc' | 'ldp_vc' | string;
|
|
166
|
-
export type PresentationFormat = 'jwt' | 'ldp' | 'jwt_vp' | 'ldp_vp' | string;
|
|
12
|
+
export type CredentialFormat = 'jwt_vc' | 'ldp_vc' | 'vc+sd-jwt' | 'jwt' | 'ldp' | string;
|
|
13
|
+
export type PresentationFormat = 'jwt_vp' | 'ldp_vp' | 'vc+sd-jwt' | 'jwt' | 'ldp' | string;
|
|
167
14
|
export type ClaimFormat = CredentialFormat | PresentationFormat;
|
|
168
|
-
export type OriginalVerifiableCredential = W3CVerifiableCredential | JwtDecodedVerifiableCredential;
|
|
169
|
-
export type OriginalVerifiablePresentation = W3CVerifiablePresentation | JwtDecodedVerifiablePresentation;
|
|
15
|
+
export type OriginalVerifiableCredential = W3CVerifiableCredential | JwtDecodedVerifiableCredential | SdJwtDecodedVerifiableCredential;
|
|
16
|
+
export type OriginalVerifiablePresentation = W3CVerifiablePresentation | JwtDecodedVerifiablePresentation | SdJwtDecodedVerifiableCredential;
|
|
170
17
|
export type Original = OriginalVerifiablePresentation | OriginalVerifiableCredential;
|
|
171
18
|
export declare const enum DocumentFormat {
|
|
172
19
|
JWT = 0,
|
|
173
20
|
JSONLD = 1,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
export declare const JWT_PROOF_TYPE_2020 = "JwtProof2020";
|
|
177
|
-
export interface IVerifyStatusResult {
|
|
178
|
-
verified: boolean;
|
|
179
|
-
/**
|
|
180
|
-
* Optional Error object for the
|
|
181
|
-
* but currently the machine readable errors are not exported from DID-JWT package to be imported here
|
|
182
|
-
*/
|
|
183
|
-
error?: IError | undefined;
|
|
184
|
-
/**
|
|
185
|
-
* Other options can be specified for verification.
|
|
186
|
-
* They will be forwarded to the lower level modules. that performt the checks
|
|
187
|
-
*/
|
|
188
|
-
[x: string]: any;
|
|
189
|
-
}
|
|
190
|
-
export interface IVerifyResult {
|
|
191
|
-
/**
|
|
192
|
-
* This value is used to transmit the global result of verification.
|
|
193
|
-
*/
|
|
194
|
-
verified: boolean;
|
|
195
|
-
results?: [
|
|
196
|
-
{
|
|
197
|
-
credential?: ICredential;
|
|
198
|
-
presentation?: IPresentation;
|
|
199
|
-
verified: boolean;
|
|
200
|
-
error?: IError;
|
|
201
|
-
log: [{
|
|
202
|
-
id: string;
|
|
203
|
-
valid: boolean;
|
|
204
|
-
}];
|
|
205
|
-
}
|
|
206
|
-
];
|
|
207
|
-
statusResult?: IVerifyStatusResult;
|
|
208
|
-
/**
|
|
209
|
-
* Optional Error object for the
|
|
210
|
-
* but currently the machine readable errors are not exported from DID-JWT package to be imported here
|
|
211
|
-
*/
|
|
212
|
-
error?: IError | undefined;
|
|
213
|
-
/**
|
|
214
|
-
* Other options can be specified for verification.
|
|
215
|
-
* They will be forwarded to the lower level modules. that performt the checks
|
|
216
|
-
*/
|
|
217
|
-
[x: string]: any;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* An error object, which can contain a code.
|
|
221
|
-
* @beta
|
|
222
|
-
*/
|
|
223
|
-
export interface IError {
|
|
224
|
-
name?: string;
|
|
225
|
-
errors?: IError[];
|
|
226
|
-
/**
|
|
227
|
-
* The details of the error being thrown or forwarded
|
|
228
|
-
*/
|
|
229
|
-
message?: string;
|
|
230
|
-
/**
|
|
231
|
-
* The stack of the error
|
|
232
|
-
*/
|
|
233
|
-
stack?: string | string[];
|
|
234
|
-
details?: IErrorDetails;
|
|
235
|
-
/**
|
|
236
|
-
* The code for the error being throw
|
|
237
|
-
*/
|
|
238
|
-
errorCode?: string;
|
|
239
|
-
}
|
|
240
|
-
export interface IErrorDetails {
|
|
241
|
-
code?: string;
|
|
242
|
-
url?: string;
|
|
243
|
-
cause?: IError;
|
|
244
|
-
}
|
|
245
|
-
export declare enum StatusListType {
|
|
246
|
-
StatusList2021 = "StatusList2021"
|
|
247
|
-
}
|
|
248
|
-
export type StatusPurpose2021 = 'revocation' | 'suspension' | string;
|
|
249
|
-
export declare enum StatusListCredentialIdMode {
|
|
250
|
-
ISSUANCE = "ISSUANCE",
|
|
251
|
-
PERSISTENCE = "PERSISTENCE",
|
|
252
|
-
NEVER = "NEVER"
|
|
253
|
-
}
|
|
254
|
-
export type StatusListIndexingDirection = 'rightToLeft';
|
|
255
|
-
export declare enum StatusListDriverType {
|
|
256
|
-
AGENT_TYPEORM = "agent_typeorm",
|
|
257
|
-
AGENT_KV_STORE = "agent_kv_store",
|
|
258
|
-
GITHUB = "github",
|
|
259
|
-
AGENT_FILESYSTEM = "agent_filesystem"
|
|
21
|
+
SD_JWT_VC = 2,
|
|
22
|
+
EIP712 = 3
|
|
260
23
|
}
|
|
261
24
|
//# sourceMappingURL=vc.d.ts.map
|
package/dist/types/vc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc.d.ts","sourceRoot":"","sources":["../../src/types/vc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"vc.d.ts","sourceRoot":"","sources":["../../src/types/vc.ts"],"names":[],"mappings":"AAAA,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,CAAA;AAE3G,MAAM,MAAM,6BAA6B,GAAG,gCAAgC,GAAG,kCAAkC,CAAA;AAEjH,oBAAY,YAAY;IAEtB,MAAM,YAAY;IAClB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAG3B,iBAAiB,sBAAsB;IACvC,iBAAiB,sBAAsB;CACxC;AAED,MAAM,MAAM,gBAAgB,GAExB,QAAQ,GACR,QAAQ,GAER,WAAW,GAEX,KAAK,GACL,KAAK,GACL,MAAM,CAAA;AAEV,MAAM,MAAM,kBAAkB,GAE1B,QAAQ,GACR,QAAQ,GAER,WAAW,GAEX,KAAK,GACL,KAAK,GACL,MAAM,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,kBAAkB,CAAA;AAE/D,MAAM,MAAM,4BAA4B,GAAG,uBAAuB,GAAG,8BAA8B,GAAG,gCAAgC,CAAA;AACtI,MAAM,MAAM,8BAA8B,GAAG,yBAAyB,GAAG,gCAAgC,GAAG,gCAAgC,CAAA;AAC5I,MAAM,MAAM,QAAQ,GAAG,8BAA8B,GAAG,4BAA4B,CAAA;AAEpF,0BAAkB,cAAc;IAE9B,GAAG,IAAA;IACH,MAAM,IAAA;IAEN,SAAS,IAAA;IAET,MAAM,IAAA;CACP"}
|
package/dist/types/vc.js
CHANGED
|
@@ -1,34 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DocumentFormat = exports.OriginalType = void 0;
|
|
4
4
|
var OriginalType;
|
|
5
5
|
(function (OriginalType) {
|
|
6
|
+
// W3C
|
|
6
7
|
OriginalType["JSONLD"] = "json-ld";
|
|
7
8
|
OriginalType["JWT_ENCODED"] = "jwt-encoded";
|
|
8
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";
|
|
9
13
|
})(OriginalType = exports.OriginalType || (exports.OriginalType = {}));
|
|
10
14
|
var DocumentFormat;
|
|
11
15
|
(function (DocumentFormat) {
|
|
16
|
+
// W3C
|
|
12
17
|
DocumentFormat[DocumentFormat["JWT"] = 0] = "JWT";
|
|
13
18
|
DocumentFormat[DocumentFormat["JSONLD"] = 1] = "JSONLD";
|
|
14
|
-
|
|
19
|
+
// SD-JWT
|
|
20
|
+
DocumentFormat[DocumentFormat["SD_JWT_VC"] = 2] = "SD_JWT_VC";
|
|
21
|
+
// Remaining
|
|
22
|
+
DocumentFormat[DocumentFormat["EIP712"] = 3] = "EIP712";
|
|
15
23
|
})(DocumentFormat = exports.DocumentFormat || (exports.DocumentFormat = {}));
|
|
16
|
-
exports.JWT_PROOF_TYPE_2020 = 'JwtProof2020';
|
|
17
|
-
var StatusListType;
|
|
18
|
-
(function (StatusListType) {
|
|
19
|
-
StatusListType["StatusList2021"] = "StatusList2021";
|
|
20
|
-
})(StatusListType = exports.StatusListType || (exports.StatusListType = {}));
|
|
21
|
-
var StatusListCredentialIdMode;
|
|
22
|
-
(function (StatusListCredentialIdMode) {
|
|
23
|
-
StatusListCredentialIdMode["ISSUANCE"] = "ISSUANCE";
|
|
24
|
-
StatusListCredentialIdMode["PERSISTENCE"] = "PERSISTENCE";
|
|
25
|
-
StatusListCredentialIdMode["NEVER"] = "NEVER";
|
|
26
|
-
})(StatusListCredentialIdMode = exports.StatusListCredentialIdMode || (exports.StatusListCredentialIdMode = {}));
|
|
27
|
-
var StatusListDriverType;
|
|
28
|
-
(function (StatusListDriverType) {
|
|
29
|
-
StatusListDriverType["AGENT_TYPEORM"] = "agent_typeorm";
|
|
30
|
-
StatusListDriverType["AGENT_KV_STORE"] = "agent_kv_store";
|
|
31
|
-
StatusListDriverType["GITHUB"] = "github";
|
|
32
|
-
StatusListDriverType["AGENT_FILESYSTEM"] = "agent_filesystem";
|
|
33
|
-
})(StatusListDriverType = exports.StatusListDriverType || (exports.StatusListDriverType = {}));
|
|
34
24
|
//# sourceMappingURL=vc.js.map
|
package/dist/types/vc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc.js","sourceRoot":"","sources":["../../src/types/vc.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"vc.js","sourceRoot":"","sources":["../../src/types/vc.ts"],"names":[],"mappings":";;;AAcA,IAAY,YASX;AATD,WAAY,YAAY;IACtB,MAAM;IACN,kCAAkB,CAAA;IAClB,2CAA2B,CAAA;IAC3B,2CAA2B,CAAA;IAE3B,SAAS;IACT,uDAAuC,CAAA;IACvC,uDAAuC,CAAA;AACzC,CAAC,EATW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QASvB;AA8BD,IAAkB,cAQjB;AARD,WAAkB,cAAc;IAC9B,MAAM;IACN,iDAAG,CAAA;IACH,uDAAM,CAAA;IACN,SAAS;IACT,6DAAS,CAAA;IACT,YAAY;IACZ,uDAAM,CAAA;AACR,CAAC,EARiB,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAQ/B"}
|