@sphereon/ssi-sdk.vc-status-list 0.33.1-next.3 → 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.
- package/dist/index.cjs +979 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +275 -0
- package/dist/index.d.ts +273 -3
- package/dist/index.js +946 -19
- package/dist/index.js.map +1 -1
- package/package.json +28 -17
- package/src/functions.ts +9 -7
- package/src/impl/IStatusList.ts +3 -3
- package/src/impl/OAuthStatusList.ts +7 -7
- package/src/impl/StatusList2021.ts +17 -9
- package/src/impl/StatusListFactory.ts +1 -1
- package/src/impl/encoding/cbor.ts +53 -42
- package/src/impl/encoding/common.ts +1 -1
- package/src/impl/encoding/jwt.ts +6 -6
- package/src/types/index.ts +19 -19
- package/src/utils.ts +6 -6
- package/dist/functions.d.ts +0 -69
- package/dist/functions.d.ts.map +0 -1
- package/dist/functions.js +0 -200
- package/dist/functions.js.map +0 -1
- package/dist/impl/IStatusList.d.ts +0 -26
- package/dist/impl/IStatusList.d.ts.map +0 -1
- package/dist/impl/IStatusList.js +0 -3
- package/dist/impl/IStatusList.js.map +0 -1
- package/dist/impl/OAuthStatusList.d.ts +0 -21
- package/dist/impl/OAuthStatusList.d.ts.map +0 -1
- package/dist/impl/OAuthStatusList.js +0 -155
- package/dist/impl/OAuthStatusList.js.map +0 -1
- package/dist/impl/StatusList2021.d.ts +0 -16
- package/dist/impl/StatusList2021.d.ts.map +0 -1
- package/dist/impl/StatusList2021.js +0 -186
- package/dist/impl/StatusList2021.js.map +0 -1
- package/dist/impl/StatusListFactory.d.ts +0 -11
- package/dist/impl/StatusListFactory.d.ts.map +0 -1
- package/dist/impl/StatusListFactory.js +0 -32
- package/dist/impl/StatusListFactory.js.map +0 -1
- package/dist/impl/encoding/cbor.d.ts +0 -6
- package/dist/impl/encoding/cbor.d.ts.map +0 -1
- package/dist/impl/encoding/cbor.js +0 -140
- package/dist/impl/encoding/cbor.js.map +0 -1
- package/dist/impl/encoding/common.d.ts +0 -12
- package/dist/impl/encoding/common.d.ts.map +0 -1
- package/dist/impl/encoding/common.js +0 -17
- package/dist/impl/encoding/common.js.map +0 -1
- package/dist/impl/encoding/jwt.d.ts +0 -9
- package/dist/impl/encoding/jwt.d.ts.map +0 -1
- package/dist/impl/encoding/jwt.js +0 -74
- package/dist/impl/encoding/jwt.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -209
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -15
- package/dist/types/index.js.map +0 -1
- package/dist/utils.d.ts +0 -17
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -88
- package/dist/utils.js.map +0 -1
|
@@ -1,155 +0,0 @@
|
|
|
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.OAuthStatusListImplementation = exports.DEFAULT_PROOF_FORMAT = exports.DEFAULT_LIST_LENGTH = exports.DEFAULT_BITS_PER_STATUS = void 0;
|
|
13
|
-
const ssi_types_1 = require("@sphereon/ssi-types");
|
|
14
|
-
const utils_1 = require("../utils");
|
|
15
|
-
const jwt_status_list_1 = require("@sd-jwt/jwt-status-list");
|
|
16
|
-
const jwt_1 = require("./encoding/jwt");
|
|
17
|
-
const cbor_1 = require("./encoding/cbor");
|
|
18
|
-
exports.DEFAULT_BITS_PER_STATUS = 1; // 1 bit is sufficient for 0x00 - "VALID" 0x01 - "INVALID" saving space in the process
|
|
19
|
-
exports.DEFAULT_LIST_LENGTH = 250000;
|
|
20
|
-
exports.DEFAULT_PROOF_FORMAT = 'jwt';
|
|
21
|
-
class OAuthStatusListImplementation {
|
|
22
|
-
createNewStatusList(args, context) {
|
|
23
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
var _a, _b;
|
|
25
|
-
if (!args.oauthStatusList) {
|
|
26
|
-
throw new Error('OAuthStatusList options are required for type OAuthStatusList');
|
|
27
|
-
}
|
|
28
|
-
const proofFormat = (_a = args === null || args === void 0 ? void 0 : args.proofFormat) !== null && _a !== void 0 ? _a : exports.DEFAULT_PROOF_FORMAT;
|
|
29
|
-
const { issuer, id, oauthStatusList, keyRef } = args;
|
|
30
|
-
const { bitsPerStatus, expiresAt } = oauthStatusList;
|
|
31
|
-
const length = (_b = args.length) !== null && _b !== void 0 ? _b : exports.DEFAULT_LIST_LENGTH;
|
|
32
|
-
const issuerString = typeof issuer === 'string' ? issuer : issuer.id;
|
|
33
|
-
const correlationId = (0, utils_1.getAssertedValue)('correlationId', args.correlationId);
|
|
34
|
-
const statusList = new jwt_status_list_1.StatusList(new Array(length).fill(0), bitsPerStatus !== null && bitsPerStatus !== void 0 ? bitsPerStatus : exports.DEFAULT_BITS_PER_STATUS);
|
|
35
|
-
const encodedList = statusList.compressStatusList();
|
|
36
|
-
const { statusListCredential } = yield this.createSignedStatusList(proofFormat, context, statusList, issuerString, id, expiresAt, keyRef);
|
|
37
|
-
return {
|
|
38
|
-
encodedList,
|
|
39
|
-
statusListCredential,
|
|
40
|
-
oauthStatusList: { bitsPerStatus },
|
|
41
|
-
length,
|
|
42
|
-
type: ssi_types_1.StatusListType.OAuthStatusList,
|
|
43
|
-
proofFormat,
|
|
44
|
-
id,
|
|
45
|
-
correlationId,
|
|
46
|
-
issuer,
|
|
47
|
-
statuslistContentType: this.buildContentType(proofFormat),
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
updateStatusListIndex(args, context) {
|
|
52
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
const { statusListCredential, value, expiresAt, keyRef } = args;
|
|
54
|
-
if (typeof statusListCredential !== 'string') {
|
|
55
|
-
return Promise.reject('statusListCredential in neither JWT nor CWT');
|
|
56
|
-
}
|
|
57
|
-
const proofFormat = (0, utils_1.determineProofFormat)(statusListCredential);
|
|
58
|
-
const decoded = proofFormat === 'jwt' ? (0, jwt_1.decodeStatusListJWT)(statusListCredential) : (0, cbor_1.decodeStatusListCWT)(statusListCredential);
|
|
59
|
-
const { statusList, issuer, id } = decoded;
|
|
60
|
-
const index = typeof args.statusListIndex === 'number' ? args.statusListIndex : parseInt(args.statusListIndex);
|
|
61
|
-
if (index < 0 || index >= statusList.statusList.length) {
|
|
62
|
-
throw new Error('Status list index out of bounds');
|
|
63
|
-
}
|
|
64
|
-
statusList.setStatus(index, value);
|
|
65
|
-
const { statusListCredential: signedCredential, encodedList } = yield this.createSignedStatusList(proofFormat, context, statusList, issuer, id, expiresAt, keyRef);
|
|
66
|
-
return {
|
|
67
|
-
statusListCredential: signedCredential,
|
|
68
|
-
encodedList,
|
|
69
|
-
oauthStatusList: {
|
|
70
|
-
bitsPerStatus: statusList.getBitsPerStatus(),
|
|
71
|
-
},
|
|
72
|
-
length: statusList.statusList.length,
|
|
73
|
-
type: ssi_types_1.StatusListType.OAuthStatusList,
|
|
74
|
-
proofFormat,
|
|
75
|
-
id,
|
|
76
|
-
issuer,
|
|
77
|
-
statuslistContentType: this.buildContentType(proofFormat),
|
|
78
|
-
};
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
// FIXME: This still assumes only two values (boolean), whilst this list supports 8 bits max
|
|
82
|
-
updateStatusListFromEncodedList(args, context) {
|
|
83
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
-
if (!args.oauthStatusList) {
|
|
85
|
-
throw new Error('OAuthStatusList options are required for type OAuthStatusList');
|
|
86
|
-
}
|
|
87
|
-
const { proofFormat, oauthStatusList, keyRef } = args;
|
|
88
|
-
const { bitsPerStatus, expiresAt } = oauthStatusList;
|
|
89
|
-
const { issuer, id } = (0, utils_1.getAssertedValues)(args);
|
|
90
|
-
const issuerString = typeof issuer === 'string' ? issuer : issuer.id;
|
|
91
|
-
const listToUpdate = jwt_status_list_1.StatusList.decompressStatusList(args.encodedList, bitsPerStatus !== null && bitsPerStatus !== void 0 ? bitsPerStatus : exports.DEFAULT_BITS_PER_STATUS);
|
|
92
|
-
const index = typeof args.statusListIndex === 'number' ? args.statusListIndex : parseInt(args.statusListIndex);
|
|
93
|
-
// FIXME: See above.
|
|
94
|
-
listToUpdate.setStatus(index, args.value ? 1 : 0);
|
|
95
|
-
const { statusListCredential, encodedList } = yield this.createSignedStatusList(proofFormat !== null && proofFormat !== void 0 ? proofFormat : exports.DEFAULT_PROOF_FORMAT, context, listToUpdate, issuerString, id, expiresAt, keyRef);
|
|
96
|
-
return {
|
|
97
|
-
encodedList,
|
|
98
|
-
statusListCredential,
|
|
99
|
-
oauthStatusList: {
|
|
100
|
-
bitsPerStatus,
|
|
101
|
-
expiresAt,
|
|
102
|
-
},
|
|
103
|
-
length: listToUpdate.statusList.length,
|
|
104
|
-
type: ssi_types_1.StatusListType.OAuthStatusList,
|
|
105
|
-
proofFormat: proofFormat !== null && proofFormat !== void 0 ? proofFormat : exports.DEFAULT_PROOF_FORMAT,
|
|
106
|
-
id,
|
|
107
|
-
issuer,
|
|
108
|
-
statuslistContentType: this.buildContentType(proofFormat),
|
|
109
|
-
};
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
buildContentType(proofFormat) {
|
|
113
|
-
return `application/statuslist+${proofFormat === 'cbor' ? 'cwt' : 'jwt'}`;
|
|
114
|
-
}
|
|
115
|
-
checkStatusIndex(args) {
|
|
116
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
-
const { statusListCredential, statusListIndex } = args;
|
|
118
|
-
if (typeof statusListCredential !== 'string') {
|
|
119
|
-
return Promise.reject('statusListCredential in neither JWT nor CWT');
|
|
120
|
-
}
|
|
121
|
-
const proofFormat = (0, utils_1.determineProofFormat)(statusListCredential);
|
|
122
|
-
const { statusList } = proofFormat === 'jwt' ? (0, jwt_1.decodeStatusListJWT)(statusListCredential) : (0, cbor_1.decodeStatusListCWT)(statusListCredential);
|
|
123
|
-
const index = typeof statusListIndex === 'number' ? statusListIndex : parseInt(statusListIndex);
|
|
124
|
-
if (index < 0 || index >= statusList.statusList.length) {
|
|
125
|
-
throw new Error('Status list index out of bounds');
|
|
126
|
-
}
|
|
127
|
-
return statusList.getStatus(index);
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
toStatusListDetails(args) {
|
|
131
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
-
const { statusListPayload } = args;
|
|
133
|
-
const proofFormat = (0, utils_1.determineProofFormat)(statusListPayload);
|
|
134
|
-
const decoded = proofFormat === 'jwt' ? (0, jwt_1.decodeStatusListJWT)(statusListPayload) : (0, cbor_1.decodeStatusListCWT)(statusListPayload);
|
|
135
|
-
const { statusList, issuer, id, exp } = decoded;
|
|
136
|
-
return Object.assign(Object.assign({ id, encodedList: statusList.compressStatusList(), issuer, type: ssi_types_1.StatusListType.OAuthStatusList, proofFormat, length: statusList.statusList.length, statusListCredential: statusListPayload, statuslistContentType: this.buildContentType(proofFormat), oauthStatusList: Object.assign({ bitsPerStatus: statusList.getBitsPerStatus() }, (exp && { expiresAt: new Date(exp * 1000) })) }, (args.correlationId && { correlationId: args.correlationId })), (args.driverType && { driverType: args.driverType }));
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
createSignedStatusList(proofFormat, context, statusList, issuerString, id, expiresAt, keyRef) {
|
|
140
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
-
switch (proofFormat) {
|
|
142
|
-
case 'jwt': {
|
|
143
|
-
return yield (0, jwt_1.createSignedJwt)(context, statusList, issuerString, id, expiresAt, keyRef);
|
|
144
|
-
}
|
|
145
|
-
case 'cbor': {
|
|
146
|
-
return yield (0, cbor_1.createSignedCbor)(context, statusList, issuerString, id, expiresAt, keyRef);
|
|
147
|
-
}
|
|
148
|
-
default:
|
|
149
|
-
throw new Error(`Invalid proof format '${proofFormat}' for OAuthStatusList`);
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
exports.OAuthStatusListImplementation = OAuthStatusListImplementation;
|
|
155
|
-
//# sourceMappingURL=OAuthStatusList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OAuthStatusList.js","sourceRoot":"","sources":["../../src/impl/OAuthStatusList.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mDAAkF;AAWlF,oCAAoF;AAEpF,6DAAoD;AAGpD,wCAAqE;AACrE,0CAAuE;AAI1D,QAAA,uBAAuB,GAAG,CAAC,CAAA,CAAC,uFAAuF;AACnH,QAAA,mBAAmB,GAAG,MAAM,CAAA;AAC5B,QAAA,oBAAoB,GAAG,KAAoB,CAAA;AAExD,MAAa,6BAA6B;IAClC,mBAAmB,CAAC,IAA0B,EAAE,OAAyB;;;YAC7E,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAA;YAClF,CAAC;YAED,MAAM,WAAW,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,mCAAI,4BAAoB,CAAA;YAC7D,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;YACpD,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,eAAe,CAAA;YACpD,MAAM,MAAM,GAAG,MAAA,IAAI,C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AE,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;gBACzF,CAAC;gBACD;oBACE,MAAM,IAAI,KAAK,CAAC,yBAAyB,WAAW,uBAAuB,CAAC,CAAA;YAChF,CAAC;QACH,CAAC;KAAA;CACF;AAnLD,sEAmLC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IAgentContext, ICredentialPlugin, ProofFormat as VeramoProofFormat } from '@veramo/core';
|
|
2
|
-
import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
3
|
-
import { IStatusList } from './IStatusList';
|
|
4
|
-
import { CheckStatusIndexArgs, CreateStatusListArgs, Status2021, StatusListResult, ToStatusListDetailsArgs, UpdateStatusListFromEncodedListArgs, UpdateStatusListIndexArgs } from '../types';
|
|
5
|
-
export declare const DEFAULT_LIST_LENGTH = 250000;
|
|
6
|
-
export declare const DEFAULT_PROOF_FORMAT: VeramoProofFormat;
|
|
7
|
-
export declare class StatusList2021Implementation implements IStatusList {
|
|
8
|
-
createNewStatusList(args: CreateStatusListArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
9
|
-
updateStatusListIndex(args: UpdateStatusListIndexArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
10
|
-
updateStatusListFromEncodedList(args: UpdateStatusListFromEncodedListArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
11
|
-
checkStatusIndex(args: CheckStatusIndexArgs): Promise<number | Status2021>;
|
|
12
|
-
toStatusListDetails(args: ToStatusListDetailsArgs): Promise<StatusListResult>;
|
|
13
|
-
private createVerifiableCredential;
|
|
14
|
-
private buildContentType;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=StatusList2021.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatusList2021.d.ts","sourceRoot":"","sources":["../../src/impl/StatusList2021.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACjG,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAInF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,uBAAuB,EACvB,mCAAmC,EACnC,yBAAyB,EAC1B,MAAM,UAAU,CAAA;AAGjB,eAAO,MAAM,mBAAmB,SAAS,CAAA;AACzC,eAAO,MAAM,oBAAoB,EAAY,iBAAiB,CAAA;AAE9D,qBAAa,4BAA6B,YAAW,WAAW;IACxD,mBAAmB,CACvB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,EAAE,aAAa,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,GAChE,OAAO,CAAC,gBAAgB,CAAC;IAuCtB,qBAAqB,CACzB,IAAI,EAAE,yBAAyB,EAC/B,OAAO,EAAE,aAAa,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,GAChE,OAAO,CAAC,gBAAgB,CAAC;IAwCtB,+BAA+B,CACnC,IAAI,EAAE,mCAAmC,EACzC,OAAO,EAAE,aAAa,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,GAChE,OAAO,CAAC,gBAAgB,CAAC;IAyCtB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,GAAG,UAAU,CAAC;IAU1E,mBAAmB,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC;YA6BrE,0BAA0B;IAuCxC,OAAO,CAAC,gBAAgB;CAYzB"}
|
|
@@ -1,186 +0,0 @@
|
|
|
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.StatusList2021Implementation = exports.DEFAULT_PROOF_FORMAT = exports.DEFAULT_LIST_LENGTH = void 0;
|
|
13
|
-
const ssi_types_1 = require("@sphereon/ssi-types");
|
|
14
|
-
const vc_status_list_1 = require("@sphereon/vc-status-list");
|
|
15
|
-
const types_1 = require("../types");
|
|
16
|
-
const utils_1 = require("../utils");
|
|
17
|
-
exports.DEFAULT_LIST_LENGTH = 250000;
|
|
18
|
-
exports.DEFAULT_PROOF_FORMAT = 'lds';
|
|
19
|
-
class StatusList2021Implementation {
|
|
20
|
-
createNewStatusList(args, context) {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
var _a, _b;
|
|
23
|
-
const length = (_a = args === null || args === void 0 ? void 0 : args.length) !== null && _a !== void 0 ? _a : exports.DEFAULT_LIST_LENGTH;
|
|
24
|
-
const proofFormat = (_b = args === null || args === void 0 ? void 0 : args.proofFormat) !== null && _b !== void 0 ? _b : exports.DEFAULT_PROOF_FORMAT;
|
|
25
|
-
(0, utils_1.assertValidProofType)(ssi_types_1.StatusListType.StatusList2021, proofFormat);
|
|
26
|
-
const veramoProofFormat = proofFormat;
|
|
27
|
-
const { issuer, id } = args;
|
|
28
|
-
const correlationId = (0, utils_1.getAssertedValue)('correlationId', args.correlationId);
|
|
29
|
-
const list = new vc_status_list_1.StatusList({ length });
|
|
30
|
-
const encodedList = yield list.encode();
|
|
31
|
-
const statusPurpose = 'revocation';
|
|
32
|
-
const statusListCredential = yield this.createVerifiableCredential(Object.assign(Object.assign({}, args), { encodedList, proofFormat: veramoProofFormat }), context);
|
|
33
|
-
return {
|
|
34
|
-
encodedList,
|
|
35
|
-
statusListCredential: statusListCredential,
|
|
36
|
-
statusList2021: {
|
|
37
|
-
statusPurpose,
|
|
38
|
-
indexingDirection: 'rightToLeft',
|
|
39
|
-
},
|
|
40
|
-
length,
|
|
41
|
-
type: ssi_types_1.StatusListType.StatusList2021,
|
|
42
|
-
proofFormat,
|
|
43
|
-
id,
|
|
44
|
-
correlationId,
|
|
45
|
-
issuer,
|
|
46
|
-
statuslistContentType: this.buildContentType(proofFormat),
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
updateStatusListIndex(args, context) {
|
|
51
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
const credential = args.statusListCredential;
|
|
53
|
-
const uniform = ssi_types_1.CredentialMapper.toUniformCredential(credential);
|
|
54
|
-
const { issuer, credentialSubject } = uniform;
|
|
55
|
-
const id = (0, utils_1.getAssertedValue)('id', uniform.id);
|
|
56
|
-
const origEncodedList = (0, utils_1.getAssertedProperty)('encodedList', credentialSubject);
|
|
57
|
-
const index = typeof args.statusListIndex === 'number' ? args.statusListIndex : parseInt(args.statusListIndex);
|
|
58
|
-
const statusList = yield vc_status_list_1.StatusList.decode({ encodedList: origEncodedList });
|
|
59
|
-
statusList.setStatus(index, args.value != 0);
|
|
60
|
-
const encodedList = yield statusList.encode();
|
|
61
|
-
const proofFormat = ssi_types_1.CredentialMapper.detectDocumentType(credential) === 0 /* DocumentFormat.JWT */ ? 'jwt' : 'lds';
|
|
62
|
-
const updatedCredential = yield this.createVerifiableCredential(Object.assign(Object.assign({}, args), { id,
|
|
63
|
-
issuer,
|
|
64
|
-
encodedList, proofFormat: proofFormat }), context);
|
|
65
|
-
return {
|
|
66
|
-
statusListCredential: updatedCredential,
|
|
67
|
-
encodedList,
|
|
68
|
-
statusList2021: Object.assign(Object.assign({}, ('statusPurpose' in credentialSubject ? { statusPurpose: credentialSubject.statusPurpose } : {})), { indexingDirection: 'rightToLeft' }),
|
|
69
|
-
length: statusList.length - 1,
|
|
70
|
-
type: ssi_types_1.StatusListType.StatusList2021,
|
|
71
|
-
proofFormat: proofFormat,
|
|
72
|
-
id,
|
|
73
|
-
issuer,
|
|
74
|
-
statuslistContentType: this.buildContentType(proofFormat),
|
|
75
|
-
};
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
updateStatusListFromEncodedList(args, context) {
|
|
79
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
var _a, _b;
|
|
81
|
-
if (!args.statusList2021) {
|
|
82
|
-
throw new Error('statusList2021 options required for type StatusList2021');
|
|
83
|
-
}
|
|
84
|
-
const proofFormat = (_a = args === null || args === void 0 ? void 0 : args.proofFormat) !== null && _a !== void 0 ? _a : exports.DEFAULT_PROOF_FORMAT;
|
|
85
|
-
(0, utils_1.assertValidProofType)(ssi_types_1.StatusListType.StatusList2021, proofFormat);
|
|
86
|
-
const veramoProofFormat = proofFormat;
|
|
87
|
-
const { issuer, id } = (0, utils_1.getAssertedValues)(args);
|
|
88
|
-
const statusList = yield vc_status_list_1.StatusList.decode({ encodedList: args.encodedList });
|
|
89
|
-
const index = typeof args.statusListIndex === 'number' ? args.statusListIndex : parseInt(args.statusListIndex);
|
|
90
|
-
statusList.setStatus(index, args.value);
|
|
91
|
-
const newEncodedList = yield statusList.encode();
|
|
92
|
-
const credential = yield this.createVerifiableCredential({
|
|
93
|
-
id,
|
|
94
|
-
issuer,
|
|
95
|
-
encodedList: newEncodedList,
|
|
96
|
-
proofFormat: veramoProofFormat,
|
|
97
|
-
keyRef: args.keyRef,
|
|
98
|
-
}, context);
|
|
99
|
-
return {
|
|
100
|
-
type: ssi_types_1.StatusListType.StatusList2021,
|
|
101
|
-
statusListCredential: credential,
|
|
102
|
-
encodedList: newEncodedList,
|
|
103
|
-
statusList2021: {
|
|
104
|
-
statusPurpose: args.statusList2021.statusPurpose,
|
|
105
|
-
indexingDirection: 'rightToLeft',
|
|
106
|
-
},
|
|
107
|
-
length: statusList.length,
|
|
108
|
-
proofFormat: (_b = args.proofFormat) !== null && _b !== void 0 ? _b : 'lds',
|
|
109
|
-
id: id,
|
|
110
|
-
issuer: issuer,
|
|
111
|
-
statuslistContentType: this.buildContentType(proofFormat),
|
|
112
|
-
};
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
checkStatusIndex(args) {
|
|
116
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
-
const uniform = ssi_types_1.CredentialMapper.toUniformCredential(args.statusListCredential);
|
|
118
|
-
const { credentialSubject } = uniform;
|
|
119
|
-
const encodedList = (0, utils_1.getAssertedProperty)('encodedList', credentialSubject);
|
|
120
|
-
const statusList = yield vc_status_list_1.StatusList.decode({ encodedList });
|
|
121
|
-
const status = statusList.getStatus(typeof args.statusListIndex === 'number' ? args.statusListIndex : parseInt(args.statusListIndex));
|
|
122
|
-
return status ? types_1.Status2021.Invalid : types_1.Status2021.Valid;
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
toStatusListDetails(args) {
|
|
126
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
-
const { statusListPayload } = args;
|
|
128
|
-
const uniform = ssi_types_1.CredentialMapper.toUniformCredential(statusListPayload);
|
|
129
|
-
const { issuer, credentialSubject } = uniform;
|
|
130
|
-
const id = (0, utils_1.getAssertedValue)('id', uniform.id);
|
|
131
|
-
const encodedList = (0, utils_1.getAssertedProperty)('encodedList', credentialSubject);
|
|
132
|
-
const proofFormat = ssi_types_1.CredentialMapper.detectDocumentType(statusListPayload) === 0 /* DocumentFormat.JWT */ ? 'jwt' : 'lds';
|
|
133
|
-
const statusPurpose = (0, utils_1.getAssertedProperty)('statusPurpose', credentialSubject);
|
|
134
|
-
const list = yield vc_status_list_1.StatusList.decode({ encodedList });
|
|
135
|
-
return Object.assign(Object.assign({ id,
|
|
136
|
-
encodedList,
|
|
137
|
-
issuer, type: ssi_types_1.StatusListType.StatusList2021, proofFormat, length: list.length, statusListCredential: statusListPayload, statuslistContentType: this.buildContentType(proofFormat), statusList2021: {
|
|
138
|
-
indexingDirection: 'rightToLeft',
|
|
139
|
-
statusPurpose,
|
|
140
|
-
} }, (args.correlationId && { correlationId: args.correlationId })), (args.driverType && { driverType: args.driverType }));
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
createVerifiableCredential(args, context) {
|
|
144
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
-
var _a;
|
|
146
|
-
const identifier = yield context.agent.identifierManagedGet({
|
|
147
|
-
identifier: typeof args.issuer === 'string' ? args.issuer : args.issuer.id,
|
|
148
|
-
vmRelationship: 'assertionMethod',
|
|
149
|
-
offlineWhenNoDIDRegistered: true,
|
|
150
|
-
});
|
|
151
|
-
const credential = {
|
|
152
|
-
'@context': ['https://www.w3.org/2018/credentials/v1', 'https://w3id.org/vc/status-list/2021/v1'],
|
|
153
|
-
id: args.id,
|
|
154
|
-
issuer: args.issuer,
|
|
155
|
-
type: ['VerifiableCredential', 'StatusList2021Credential'],
|
|
156
|
-
credentialSubject: {
|
|
157
|
-
id: args.id,
|
|
158
|
-
type: 'StatusList2021',
|
|
159
|
-
statusPurpose: 'revocation',
|
|
160
|
-
encodedList: args.encodedList,
|
|
161
|
-
},
|
|
162
|
-
};
|
|
163
|
-
const verifiableCredential = yield context.agent.createVerifiableCredential({
|
|
164
|
-
credential,
|
|
165
|
-
keyRef: (_a = args.keyRef) !== null && _a !== void 0 ? _a : identifier.kmsKeyRef,
|
|
166
|
-
proofFormat: args.proofFormat,
|
|
167
|
-
fetchRemoteContexts: true,
|
|
168
|
-
});
|
|
169
|
-
return ssi_types_1.CredentialMapper.toWrappedVerifiableCredential(verifiableCredential).original;
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
buildContentType(proofFormat) {
|
|
173
|
-
switch (proofFormat) {
|
|
174
|
-
case 'jwt':
|
|
175
|
-
return `application/statuslist+jwt`;
|
|
176
|
-
case 'cbor':
|
|
177
|
-
return `application/statuslist+cwt`;
|
|
178
|
-
case 'lds':
|
|
179
|
-
return 'application/statuslist+ld+json';
|
|
180
|
-
default:
|
|
181
|
-
throw Error(`Unsupported content type '${proofFormat}' for status lists`);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
exports.StatusList2021Implementation = StatusList2021Implementation;
|
|
186
|
-
//# sourceMappingURL=StatusList2021.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatusList2021.js","sourceRoot":"","sources":["../../src/impl/StatusList2021.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,mDAAkI;AAElI,6DAAqD;AAErD,oCAQiB;AACjB,oCAAyG;AAE5F,QAAA,mBAAmB,GAAG,MAAM,CAAA;AAC5B,QAAA,oBAAoB,GAAG,KAA0B,CAAA;AAE9D,MAAa,4BAA4B;IACjC,mBAAmB,CACvB,IAA0B,EAC1B,OAAiE;;;YAEjE,MAAM,MAAM,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,mCAAI,2BAAmB,CAAA;YAClD,MAAM,WAAW,GAAgB,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,mCAAI,4BAAoB,CAAA;YAC1E,IAAA,4BAAoB,EAAC,0BAAc,CAAC,cAAc,EAAE,WAAW,CAAC,CAAA;YAChE,MAAM,iBAAiB,GAAsB,WAAgC,CAAA;YAE7E,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,CAAA;YAC3B,MAAM,aAAa,GAAG,IAAA,wBAAgB,EAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAE3E,MAAM,IAAI,GAAG,IAAI,2BAAU,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;YACvC,MAAM,WAAW,GAAG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C,SAAS;gBAC3C,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,mBAAmB,EAAE,IAAI;aAC1B,CAAC,CAAA;YAEF,OAAO,4BAAgB,CAAC,6BAA6B,CAAC,oBAA4C,CAAC,CAAC,QAAgC,CAAA;QACtI,CAAC;KAAA;IAEO,gBAAgB,CAAC,WAA+E;QACtG,QAAQ,WAAW,EAAE,CAAC;YACpB,KAAK,KAAK;gBACR,OAAO,4BAA4B,CAAA;YACrC,KAAK,MAAM;gBACT,OAAO,4BAA4B,CAAA;YACrC,KAAK,KAAK;gBACR,OAAO,gCAAgC,CAAA;YACzC;gBACE,MAAM,KAAK,CAAC,6BAA6B,WAAW,oBAAoB,CAAC,CAAA;QAC7E,CAAC;IACH,CAAC;CACF;AA5ND,oEA4NC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IStatusList } from './IStatusList';
|
|
2
|
-
import { StatusListType } from '@sphereon/ssi-types';
|
|
3
|
-
export declare class StatusListFactory {
|
|
4
|
-
private static instance;
|
|
5
|
-
private implementations;
|
|
6
|
-
private constructor();
|
|
7
|
-
static getInstance(): StatusListFactory;
|
|
8
|
-
getByType(type: StatusListType): IStatusList;
|
|
9
|
-
}
|
|
10
|
-
export declare function getStatusListImplementation(type: StatusListType): IStatusList;
|
|
11
|
-
//# sourceMappingURL=StatusListFactory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatusListFactory.d.ts","sourceRoot":"","sources":["../../src/impl/StatusListFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAG3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAmB;IAC1C,OAAO,CAAC,eAAe,CAAkC;IAEzD,OAAO;WAMO,WAAW,IAAI,iBAAiB;IAOvC,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,WAAW;CAOpD;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,cAAc,GAAG,WAAW,CAE7E"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StatusListFactory = void 0;
|
|
4
|
-
exports.getStatusListImplementation = getStatusListImplementation;
|
|
5
|
-
const StatusList2021_1 = require("./StatusList2021");
|
|
6
|
-
const OAuthStatusList_1 = require("./OAuthStatusList");
|
|
7
|
-
const ssi_types_1 = require("@sphereon/ssi-types");
|
|
8
|
-
class StatusListFactory {
|
|
9
|
-
constructor() {
|
|
10
|
-
this.implementations = new Map();
|
|
11
|
-
this.implementations.set(ssi_types_1.StatusListType.StatusList2021, new StatusList2021_1.StatusList2021Implementation());
|
|
12
|
-
this.implementations.set(ssi_types_1.StatusListType.OAuthStatusList, new OAuthStatusList_1.OAuthStatusListImplementation());
|
|
13
|
-
}
|
|
14
|
-
static getInstance() {
|
|
15
|
-
if (!StatusListFactory.instance) {
|
|
16
|
-
StatusListFactory.instance = new StatusListFactory();
|
|
17
|
-
}
|
|
18
|
-
return StatusListFactory.instance;
|
|
19
|
-
}
|
|
20
|
-
getByType(type) {
|
|
21
|
-
const statusList = this.implementations.get(type);
|
|
22
|
-
if (!statusList) {
|
|
23
|
-
throw new Error(`No implementation found for status list type: ${type}`);
|
|
24
|
-
}
|
|
25
|
-
return statusList;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.StatusListFactory = StatusListFactory;
|
|
29
|
-
function getStatusListImplementation(type) {
|
|
30
|
-
return StatusListFactory.getInstance().getByType(type);
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=StatusListFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatusListFactory.js","sourceRoot":"","sources":["../../src/impl/StatusListFactory.ts"],"names":[],"mappings":";;;AA+BA,kEAEC;AAhCD,qDAA+D;AAC/D,uDAAiE;AACjE,mDAAoD;AAEpD,MAAa,iBAAiB;IAI5B;QACE,IAAI,CAAC,eAAe,GAAG,IAAI,GAAG,EAAE,CAAA;QAChC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,0BAAc,CAAC,cAAc,EAAE,IAAI,6CAA4B,EAAE,CAAC,CAAA;QAC3F,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,0BAAc,CAAC,eAAe,EAAE,IAAI,+CAA6B,EAAE,CAAC,CAAA;IAC/F,CAAC;IAEM,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;YAChC,iBAAiB,CAAC,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAA;QACtD,CAAC;QACD,OAAO,iBAAiB,CAAC,QAAQ,CAAA;IACnC,CAAC;IAEM,SAAS,CAAC,IAAoB;QACnC,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACjD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,iDAAiD,IAAI,EAAE,CAAC,CAAA;QAC1E,CAAC;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;CACF;AAxBD,8CAwBC;AAED,SAAgB,2BAA2B,CAAC,IAAoB;IAC9D,OAAO,iBAAiB,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACxD,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { StatusList } from '@sd-jwt/jwt-status-list';
|
|
2
|
-
import { IRequiredContext, SignedStatusListData } from '../../types';
|
|
3
|
-
import { DecodedStatusListPayload } from './common';
|
|
4
|
-
export declare const createSignedCbor: (context: IRequiredContext, statusList: StatusList, issuerString: string, id: string, expiresAt?: Date, keyRef?: string) => Promise<SignedStatusListData>;
|
|
5
|
-
export declare const decodeStatusListCWT: (cwt: string) => DecodedStatusListPayload;
|
|
6
|
-
//# sourceMappingURL=cbor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cbor.d.ts","sourceRoot":"","sources":["../../../src/impl/encoding/cbor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAIpD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACpE,OAAO,EAAE,wBAAwB,EAAqB,MAAM,UAAU,CAAA;AAgBtE,eAAO,MAAM,gBAAgB,YAClB,gBAAgB,cACb,UAAU,gBACR,MAAM,MAChB,MAAM,cACE,IAAI,WACP,MAAM,KACd,OAAO,CAAC,oBAAoB,CAgD9B,CAAA;AAyDD,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,wBAqCjD,CAAA"}
|
|
@@ -1,140 +0,0 @@
|
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.decodeStatusListCWT = exports.createSignedCbor = void 0;
|
|
16
|
-
const jwt_status_list_1 = require("@sd-jwt/jwt-status-list");
|
|
17
|
-
const pako_1 = require("pako");
|
|
18
|
-
const kmp_cbor_1 = require("@sphereon/kmp-cbor");
|
|
19
|
-
const base64url_1 = __importDefault(require("base64url"));
|
|
20
|
-
const common_1 = require("./common");
|
|
21
|
-
const cbor = kmp_cbor_1.com.sphereon.cbor;
|
|
22
|
-
const kmp = kmp_cbor_1.com.sphereon.kmp;
|
|
23
|
-
const decompressRawStatusList = jwt_status_list_1.StatusList.decodeStatusList.bind(jwt_status_list_1.StatusList);
|
|
24
|
-
const CWT_CLAIMS = {
|
|
25
|
-
SUBJECT: 2,
|
|
26
|
-
ISSUER: 1,
|
|
27
|
-
ISSUED_AT: 6,
|
|
28
|
-
EXPIRATION: 4,
|
|
29
|
-
TIME_TO_LIVE: 65534,
|
|
30
|
-
STATUS_LIST: 65533,
|
|
31
|
-
};
|
|
32
|
-
const createSignedCbor = (context, statusList, issuerString, id, expiresAt, keyRef) => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
-
const identifier = yield (0, common_1.resolveIdentifier)(context, issuerString, keyRef);
|
|
34
|
-
const encodeStatusList = statusList.encodeStatusList();
|
|
35
|
-
const compressedList = (0, pako_1.deflate)(encodeStatusList, { level: 9 });
|
|
36
|
-
const compressedBytes = new Int8Array(compressedList);
|
|
37
|
-
const statusListMap = new cbor.CborMap(kmp_cbor_1.kotlin.collections.KtMutableMap.fromJsMap(new Map([
|
|
38
|
-
[new cbor.CborString('bits'), new cbor.CborUInt(kmp.LongKMP.fromNumber(statusList.getBitsPerStatus()))],
|
|
39
|
-
[new cbor.CborString('lst'), new cbor.CborByteString(compressedBytes)],
|
|
40
|
-
])));
|
|
41
|
-
const protectedHeader = new cbor.CborMap(kmp_cbor_1.kotlin.collections.KtMutableMap.fromJsMap(new Map([[new cbor.CborUInt(kmp.LongKMP.fromNumber(16)), new cbor.CborString('statuslist+cwt')]])));
|
|
42
|
-
const protectedHeaderEncoded = cbor.Cbor.encode(protectedHeader);
|
|
43
|
-
const claimsMap = buildClaimsMap(id, issuerString, statusListMap, expiresAt);
|
|
44
|
-
const claimsEncoded = cbor.Cbor.encode(claimsMap);
|
|
45
|
-
const signedCWT = yield context.agent.keyManagerSign({
|
|
46
|
-
keyRef: identifier.kmsKeyRef,
|
|
47
|
-
data: base64url_1.default.encode(Buffer.from(claimsEncoded)), // TODO test on RN
|
|
48
|
-
encoding: undefined,
|
|
49
|
-
});
|
|
50
|
-
const protectedHeaderEncodedInt8 = new Int8Array(protectedHeaderEncoded);
|
|
51
|
-
const claimsEncodedInt8 = new Int8Array(claimsEncoded);
|
|
52
|
-
const signatureBytes = base64url_1.default.decode(signedCWT);
|
|
53
|
-
const signatureInt8 = new Int8Array(Buffer.from(signatureBytes));
|
|
54
|
-
const cwtArrayElements = [
|
|
55
|
-
new cbor.CborByteString(protectedHeaderEncodedInt8),
|
|
56
|
-
new cbor.CborByteString(claimsEncodedInt8),
|
|
57
|
-
new cbor.CborByteString(signatureInt8),
|
|
58
|
-
];
|
|
59
|
-
const cwtArray = new cbor.CborArray(kmp_cbor_1.kotlin.collections.KtMutableList.fromJsArray(cwtArrayElements));
|
|
60
|
-
const cwtEncoded = cbor.Cbor.encode(cwtArray);
|
|
61
|
-
const cwtBuffer = Buffer.from(cwtEncoded);
|
|
62
|
-
return {
|
|
63
|
-
statusListCredential: base64url_1.default.encode(cwtBuffer),
|
|
64
|
-
encodedList: base64url_1.default.encode(compressedList), // JS in @sd-jwt/jwt-status-list drops it in like this, so keep the same method
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
exports.createSignedCbor = createSignedCbor;
|
|
68
|
-
function buildClaimsMap(id, issuerString, statusListMap, expiresAt) {
|
|
69
|
-
const ttl = 65535; // FIXME figure out what value should be / come from and what the difference is with exp
|
|
70
|
-
const claimsEntries = [
|
|
71
|
-
[new cbor.CborUInt(kmp.LongKMP.fromNumber(CWT_CLAIMS.SUBJECT)), new cbor.CborString(id)], // "sub"
|
|
72
|
-
[new cbor.CborUInt(kmp.LongKMP.fromNumber(CWT_CLAIMS.ISSUER)), new cbor.CborString(issuerString)], // "iss"
|
|
73
|
-
[
|
|
74
|
-
new cbor.CborUInt(kmp.LongKMP.fromNumber(CWT_CLAIMS.ISSUED_AT)),
|
|
75
|
-
new cbor.CborUInt(kmp.LongKMP.fromNumber(Math.floor(Date.now() / 1000))), // "iat"
|
|
76
|
-
],
|
|
77
|
-
];
|
|
78
|
-
if (expiresAt) {
|
|
79
|
-
claimsEntries.push([
|
|
80
|
-
new cbor.CborUInt(kmp.LongKMP.fromNumber(CWT_CLAIMS.EXPIRATION)),
|
|
81
|
-
new cbor.CborUInt(kmp.LongKMP.fromNumber(Math.floor(expiresAt.getTime() / 1000))), // "exp"
|
|
82
|
-
]);
|
|
83
|
-
}
|
|
84
|
-
if (ttl) {
|
|
85
|
-
claimsEntries.push([
|
|
86
|
-
new cbor.CborUInt(kmp.LongKMP.fromNumber(CWT_CLAIMS.TIME_TO_LIVE)),
|
|
87
|
-
new cbor.CborUInt(kmp.LongKMP.fromNumber(ttl)), // "time to live"
|
|
88
|
-
]);
|
|
89
|
-
}
|
|
90
|
-
claimsEntries.push([new cbor.CborUInt(kmp.LongKMP.fromNumber(CWT_CLAIMS.STATUS_LIST)), statusListMap]);
|
|
91
|
-
const claimsMap = new cbor.CborMap(kmp_cbor_1.kotlin.collections.KtMutableMap.fromJsMap(new Map(claimsEntries)));
|
|
92
|
-
return claimsMap;
|
|
93
|
-
}
|
|
94
|
-
const getCborValueFromMap = (map, key) => {
|
|
95
|
-
const value = getCborOptionalValueFromMap(map, key);
|
|
96
|
-
if (value === undefined) {
|
|
97
|
-
throw new Error(`Required claim ${key} not found`);
|
|
98
|
-
}
|
|
99
|
-
return value;
|
|
100
|
-
};
|
|
101
|
-
const getCborOptionalValueFromMap = (map, key) => {
|
|
102
|
-
const value = map.get(new kmp_cbor_1.com.sphereon.cbor.CborUInt(kmp.LongKMP.fromNumber(key)));
|
|
103
|
-
if (!value) {
|
|
104
|
-
return undefined;
|
|
105
|
-
}
|
|
106
|
-
return value.value;
|
|
107
|
-
};
|
|
108
|
-
const decodeStatusListCWT = (cwt) => {
|
|
109
|
-
const encodedCbor = base64url_1.default.toBuffer(cwt);
|
|
110
|
-
const encodedCborArray = new Int8Array(encodedCbor);
|
|
111
|
-
const decodedCbor = kmp_cbor_1.com.sphereon.cbor.Cbor.decode(encodedCborArray);
|
|
112
|
-
if (!(decodedCbor instanceof kmp_cbor_1.com.sphereon.cbor.CborArray)) {
|
|
113
|
-
throw new Error('Invalid CWT format: Expected a CBOR array');
|
|
114
|
-
}
|
|
115
|
-
const [, payload] = decodedCbor.value.asJsArrayView();
|
|
116
|
-
if (!(payload instanceof kmp_cbor_1.com.sphereon.cbor.CborByteString)) {
|
|
117
|
-
throw new Error('Invalid payload format: Expected a CBOR ByteString');
|
|
118
|
-
}
|
|
119
|
-
const claims = kmp_cbor_1.com.sphereon.cbor.Cbor.decode(payload.value);
|
|
120
|
-
if (!(claims instanceof kmp_cbor_1.com.sphereon.cbor.CborMap)) {
|
|
121
|
-
throw new Error('Invalid claims format: Expected a CBOR map');
|
|
122
|
-
}
|
|
123
|
-
const claimsMap = claims.value.asJsMapView();
|
|
124
|
-
const statusListMap = claimsMap.get(new kmp_cbor_1.com.sphereon.cbor.CborUInt(kmp.LongKMP.fromNumber(65533))).value.asJsMapView();
|
|
125
|
-
const bits = Number(statusListMap.get(new kmp_cbor_1.com.sphereon.cbor.CborString('bits')).value);
|
|
126
|
-
const decoded = new Uint8Array(statusListMap.get(new kmp_cbor_1.com.sphereon.cbor.CborString('lst')).value);
|
|
127
|
-
const uint8Array = (0, pako_1.inflate)(decoded);
|
|
128
|
-
const rawStatusList = decompressRawStatusList(uint8Array, bits);
|
|
129
|
-
const statusList = new jwt_status_list_1.StatusList(rawStatusList, bits);
|
|
130
|
-
return {
|
|
131
|
-
issuer: getCborValueFromMap(claimsMap, CWT_CLAIMS.ISSUER),
|
|
132
|
-
id: getCborValueFromMap(claimsMap, CWT_CLAIMS.SUBJECT),
|
|
133
|
-
statusList,
|
|
134
|
-
iat: Number(getCborValueFromMap(claimsMap, CWT_CLAIMS.ISSUED_AT)),
|
|
135
|
-
exp: getCborOptionalValueFromMap(claimsMap, CWT_CLAIMS.EXPIRATION),
|
|
136
|
-
ttl: getCborOptionalValueFromMap(claimsMap, CWT_CLAIMS.TIME_TO_LIVE),
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
exports.decodeStatusListCWT = decodeStatusListCWT;
|
|
140
|
-
//# sourceMappingURL=cbor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cbor.js","sourceRoot":"","sources":["../../../src/impl/encoding/cbor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAAoD;AACpD,+BAAuC;AACvC,iDAAgD;AAChD,0DAAiC;AAEjC,qCAAsE;AAGtE,MAAM,IAAI,GAAG,cAAG,CAAC,QAAQ,CAAC,IAAI,CAAA;AAC9B,MAAM,GAAG,GAAG,cAAG,CAAC,QAAQ,CAAC,GAAG,CAAA;AAC5B,MAAM,uBAAuB,GAAI,4BAAkB,CAAC,gBAAgB,CAAC,IAAI,CAAC,4BAAU,CAAC,CAAA;AAErF,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,SAAS,EAAE,CAAC;IACZ,UAAU,EAAE,CAAC;IACb,YAAY,EAAE,KAAK;IACnB,WAAW,EAAE,KAAK;CACV,CAAA;AAEH,MAAM,gBAAgB,GAAG,CAC9B,OAAyB,EACzB,UAAsB,EACtB,YAAoB,EACpB,EAAU,EACV,SAAgB,EAChB,MAAe,EACgB,EAAE;IACjC,MAAM,UAAU,GAAG,MAAM,IAAA,0BAAiB,EAAC,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,CAAA;IAEzE,MAAM,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAA;IACtD,MAAM,cAAc,GAAG,IAAA,cAAO,EAAC,gBAAgB,EAAE,EAAE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G,IAAI,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,cAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;IAChG,MAAM,UAAU,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,CAAA;IACnC,MAAM,aAAa,GAAG,uBAAuB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IAC/D,MAAM,UAAU,GAAG,IAAI,4BAAU,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;IAEtD,OAAO;QACL,MAAM,EAAE,mBAAmB,CAAS,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC;QACjE,EAAE,EAAE,mBAAmB,CAAS,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC;QAC9D,UAAU;QACV,GAAG,EAAE,MAAM,CAAC,mBAAmB,CAAS,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;QACzE,GAAG,EAAE,2BAA2B,CAAS,SAAS,EAAE,UAAU,CAAC,UAAU,CAAC;QAC1E,GAAG,EAAE,2BAA2B,CAAS,SAAS,EAAE,UAAU,CAAC,YAAY,CAAC;KAC7E,CAAA;AACH,CAAC,CAAA;AArCY,QAAA,mBAAmB,uBAqC/B"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IRequiredContext } from '../../types';
|
|
2
|
-
import { StatusList } from '@sd-jwt/jwt-status-list';
|
|
3
|
-
export interface DecodedStatusListPayload {
|
|
4
|
-
issuer: string;
|
|
5
|
-
id: string;
|
|
6
|
-
statusList: StatusList;
|
|
7
|
-
exp?: number;
|
|
8
|
-
ttl?: number;
|
|
9
|
-
iat: number;
|
|
10
|
-
}
|
|
11
|
-
export declare const resolveIdentifier: (context: IRequiredContext, issuer: string, keyRef?: string) => Promise<import("@sphereon/ssi-sdk-ext.identifier-resolution").ManagedIdentifierResult>;
|
|
12
|
-
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/impl/encoding/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEpD,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAA;IACd,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,UAAU,CAAA;IACtB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,eAAO,MAAM,iBAAiB,YAAmB,gBAAgB,UAAU,MAAM,WAAW,MAAM,2FAOjG,CAAA"}
|