@sphereon/ssi-sdk-ext.jwt-service 0.24.1-next.93

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.
@@ -0,0 +1,50 @@
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.JwtService = void 0;
13
+ const __1 = require("..");
14
+ /**
15
+ * @public
16
+ */
17
+ class JwtService {
18
+ constructor() {
19
+ this.schema = __1.schema.IMnemonicInfoGenerator;
20
+ this.methods = {
21
+ jwtPrepareJws: this.jwtPrepareJws.bind(this),
22
+ jwtCreateJwsJsonGeneralSignature: this.jwtCreateJwsJsonGeneralSignature.bind(this),
23
+ jwtCreateJwsJsonFlattenedSignature: this.jwtCreateJwsJsonFlattenedSignature.bind(this),
24
+ jwtCreateJwsCompactSignature: this.jwtCreateJwsCompactSignature.bind(this),
25
+ };
26
+ }
27
+ jwtPrepareJws(args, context) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ return yield (0, __1.prepareJwsObject)(args, context);
30
+ });
31
+ }
32
+ jwtCreateJwsJsonGeneralSignature(args, context) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ return yield (0, __1.createJwsJsonGeneral)(args, context);
35
+ });
36
+ }
37
+ jwtCreateJwsJsonFlattenedSignature(args, context) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ return yield (0, __1.createJwsJsonFlattened)(args, context);
40
+ });
41
+ }
42
+ jwtCreateJwsCompactSignature(args, context) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ // We wrap it in a json object for remote REST calls
45
+ return { jwt: yield (0, __1.createJwsCompact)(args, context) };
46
+ });
47
+ }
48
+ }
49
+ exports.JwtService = JwtService;
50
+ //# sourceMappingURL=JwtService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JwtService.js","sourceRoot":"","sources":["../../src/agent/JwtService.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,0BAeW;AAEX;;GAEG;AACH,MAAa,UAAU;IAAvB;QACW,WAAM,GAAG,UAAM,CAAC,sBAAsB,CAAA;QACtC,YAAO,GAAgB;YAC9B,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;YAC5C,gCAAgC,EAAE,IAAI,CAAC,gCAAgC,CAAC,IAAI,CAAC,IAAI,CAAC;YAClF,kCAAkC,EAAE,IAAI,CAAC,kCAAkC,CAAC,IAAI,CAAC,IAAI,CAAC;YACtF,4BAA4B,EAAE,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC;SAC3E,CAAA;IAkBH,CAAC;IAhBe,aAAa,CAAC,IAAuB,EAAE,OAAyB;;YAC5E,OAAO,MAAM,IAAA,oBAAgB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAC9C,CAAC;KAAA;IAEa,gCAAgC,CAAC,IAAuB,EAAE,OAAyB;;YAC/F,OAAO,MAAM,IAAA,wBAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAClD,CAAC;KAAA;IAEa,kCAAkC,CAAC,IAA4B,EAAE,OAAyB;;YACtG,OAAO,MAAM,IAAA,0BAAsB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QACpD,CAAC;KAAA;IAEa,4BAA4B,CAAC,IAA0B,EAAE,OAAyB;;YAC9F,oDAAoD;YACpD,OAAO,EAAE,GAAG,EAAE,MAAM,IAAA,oBAAgB,EAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAA;QACvD,CAAC;KAAA;CACF;AAzBD,gCAyBC"}
@@ -0,0 +1,21 @@
1
+ import { ManagedIdentifierResult } from '@sphereon/ssi-sdk-ext.identifier-resolution';
2
+ import { CreateJwsCompactArgs, CreateJwsFlattenedArgs, CreateJwsJsonArgs, CreateJwsMode, IRequiredContext, JwsCompact, JwsJsonFlattened, JwsJsonGeneral, JwtHeader, PreparedJwsObject } from '../types/IJwtService';
3
+ export declare const prepareJwsObject: (args: CreateJwsJsonArgs, context: IRequiredContext) => Promise<PreparedJwsObject>;
4
+ export declare const createJwsCompact: (args: CreateJwsCompactArgs, context: IRequiredContext) => Promise<JwsCompact>;
5
+ export declare const createJwsJsonFlattened: (args: CreateJwsFlattenedArgs, context: IRequiredContext) => Promise<JwsJsonFlattened>;
6
+ export declare const createJwsJsonGeneral: (args: CreateJwsJsonArgs, context: IRequiredContext) => Promise<JwsJsonGeneral>;
7
+ /**
8
+ * Updates the JWT header to include x5c, kid, jwk objects using the supplied issuer identifier that will be used to sign. If not present will automatically make the header objects available
9
+ * @param mode The type of header to check or include
10
+ * @param identifier The identifier of the signer. This identifier will be used later to sign
11
+ * @param header The JWT header
12
+ * @param noIdentifierInHeader
13
+ * @param context
14
+ */
15
+ export declare const checkAndUpdateJwtHeader: ({ mode, identifier, header, noIdentifierInHeader, }: {
16
+ mode?: CreateJwsMode;
17
+ identifier: ManagedIdentifierResult;
18
+ noIdentifierInHeader?: boolean;
19
+ header: JwtHeader;
20
+ }, context: IRequiredContext) => Promise<undefined>;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,uBAAuB,EAExB,MAAM,6CAA6C,CAAA;AAGpD,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,cAAc,EAEd,SAAS,EACT,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAE7B,eAAO,MAAM,gBAAgB,SAAgB,iBAAiB,gCAA8B,QAAQ,iBAAiB,CAmCpH,CAAA;AAED,eAAO,MAAM,gBAAgB,SAAgB,oBAAoB,gCAA8B,QAAQ,UAAU,CAGhH,CAAA;AAED,eAAO,MAAM,sBAAsB,SAAgB,sBAAsB,gCAA8B,QAAQ,gBAAgB,CAS9H,CAAA;AAED,eAAO,MAAM,oBAAoB,SAAgB,iBAAiB,gCAA8B,QAAQ,cAAc,CA4BrH,CAAA;AAED;;;;;;;GAOG;AAEH,eAAO,MAAM,uBAAuB,wDAM/B;IACD,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,UAAU,EAAE,uBAAuB,CAAA;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,MAAM,EAAE,SAAS,CAAA;CAClB,kDAsBF,CAAA"}
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.checkAndUpdateJwtHeader = exports.createJwsJsonGeneral = exports.createJwsJsonFlattened = exports.createJwsCompact = exports.prepareJwsObject = void 0;
36
+ const ssi_sdk_ext_identifier_resolution_1 = require("@sphereon/ssi-sdk-ext.identifier-resolution");
37
+ const utils_1 = require("@veramo/utils");
38
+ const u8a = __importStar(require("uint8arrays"));
39
+ const prepareJwsObject = (args, context) => __awaiter(void 0, void 0, void 0, function* () {
40
+ const { existingSignatures, protectedHeader, unprotectedHeader, issuer, payload, mode = 'auto' } = args;
41
+ const { noIdentifierInHeader = false } = issuer;
42
+ const combinedHeader = Object.assign(Object.assign({}, unprotectedHeader), protectedHeader);
43
+ if (!combinedHeader.alg) {
44
+ return Promise.reject(`No 'alg' key present in the JWS header`);
45
+ }
46
+ const identifier = yield (0, ssi_sdk_ext_identifier_resolution_1.ensureManagedIdentifierResult)(issuer, context);
47
+ yield (0, exports.checkAndUpdateJwtHeader)({ mode, identifier, noIdentifierInHeader, header: protectedHeader }, context);
48
+ const isBytes = payload instanceof Uint8Array;
49
+ const isString = typeof payload === 'string';
50
+ if (!isBytes && !isString) {
51
+ if (issuer.noIssPayloadUpdate !== true && !payload.iss && identifier.issuer) {
52
+ payload.iss = identifier.issuer;
53
+ }
54
+ }
55
+ const payloadBytes = isBytes ? payload : isString ? u8a.fromString(payload, 'base64url') : u8a.fromString(JSON.stringify(payload), 'utf-8');
56
+ const base64urlHeader = (0, utils_1.encodeJoseBlob)(protectedHeader);
57
+ const base64urlPayload = (0, utils_1.bytesToBase64url)(payloadBytes);
58
+ return {
59
+ jws: {
60
+ unprotectedHeader,
61
+ protectedHeader,
62
+ payload: payloadBytes,
63
+ existingSignatures,
64
+ },
65
+ b64: {
66
+ protectedHeader: base64urlHeader,
67
+ payload: base64urlPayload,
68
+ },
69
+ identifier,
70
+ };
71
+ });
72
+ exports.prepareJwsObject = prepareJwsObject;
73
+ const createJwsCompact = (args, context) => __awaiter(void 0, void 0, void 0, function* () {
74
+ const { protected: protectedHeader, payload, signature } = yield (0, exports.createJwsJsonFlattened)(args, context);
75
+ return `${protectedHeader}.${payload}.${signature}`;
76
+ });
77
+ exports.createJwsCompact = createJwsCompact;
78
+ const createJwsJsonFlattened = (args, context) => __awaiter(void 0, void 0, void 0, function* () {
79
+ const jws = yield (0, exports.createJwsJsonGeneral)(args, context);
80
+ if (jws.signatures.length !== 1) {
81
+ return Promise.reject(Error(`JWS flattened signature can only contain 1 signature. Found ${jws.signatures.length}`));
82
+ }
83
+ return Object.assign(Object.assign({}, jws.signatures[0]), { payload: jws.payload });
84
+ });
85
+ exports.createJwsJsonFlattened = createJwsJsonFlattened;
86
+ const createJwsJsonGeneral = (args, context) => __awaiter(void 0, void 0, void 0, function* () {
87
+ const { payload, protectedHeader, unprotectedHeader, existingSignatures, mode, issuer } = args;
88
+ const { b64, identifier } = yield (0, exports.prepareJwsObject)({
89
+ protectedHeader,
90
+ unprotectedHeader,
91
+ payload,
92
+ existingSignatures,
93
+ issuer,
94
+ mode,
95
+ }, context);
96
+ // const algorithm = await signatureAlgorithmFromKey({ key: identifier.key })
97
+ const signature = yield context.agent.keyManagerSign({
98
+ keyRef: identifier.kmsKeyRef,
99
+ data: `${b64.protectedHeader}.${b64.payload}`,
100
+ encoding: undefined,
101
+ });
102
+ const jsonSignature = {
103
+ protected: b64.protectedHeader,
104
+ header: unprotectedHeader,
105
+ signature,
106
+ };
107
+ return {
108
+ payload: b64.payload,
109
+ signatures: [...(existingSignatures !== null && existingSignatures !== void 0 ? existingSignatures : []), jsonSignature],
110
+ };
111
+ });
112
+ exports.createJwsJsonGeneral = createJwsJsonGeneral;
113
+ /**
114
+ * Updates the JWT header to include x5c, kid, jwk objects using the supplied issuer identifier that will be used to sign. If not present will automatically make the header objects available
115
+ * @param mode The type of header to check or include
116
+ * @param identifier The identifier of the signer. This identifier will be used later to sign
117
+ * @param header The JWT header
118
+ * @param noIdentifierInHeader
119
+ * @param context
120
+ */
121
+ const checkAndUpdateJwtHeader = (_a, context_1) => __awaiter(void 0, [_a, context_1], void 0, function* ({ mode = 'auto', identifier, header, noIdentifierInHeader = false, }, context) {
122
+ if (isMode(mode, identifier.method, 'did')) {
123
+ // kid is VM of the DID
124
+ // @see https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.4
125
+ yield checkAndUpdateDidHeader({ header, identifier, noIdentifierInHeader }, context);
126
+ }
127
+ else if (isMode(mode, identifier.method, 'x5c')) {
128
+ // Include the x5c in the header. No kid
129
+ // @see https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.6
130
+ yield checkAndUpdateX5cHeader({ header, identifier, noIdentifierInHeader }, context);
131
+ }
132
+ else if (isMode(mode, identifier.method, 'kid', false)) {
133
+ yield checkAndUpdateKidHeader({ header, identifier, noIdentifierInHeader }, context);
134
+ }
135
+ else if (isMode(mode, identifier.method, 'jwk', false)) {
136
+ // Include the JWK in the header as well as its kid if present
137
+ // @see https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.3
138
+ // @see https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.4
139
+ yield checkAndUpdateJwkHeader({ header, identifier, noIdentifierInHeader }, context);
140
+ }
141
+ else {
142
+ // Better safe than sorry. We could let it pass, but we want to force implementers to make a conscious choice
143
+ return Promise.reject(`Invalid combination of JWS creation mode ${mode} and identifier method ${identifier.method} chosen`);
144
+ }
145
+ });
146
+ exports.checkAndUpdateJwtHeader = checkAndUpdateJwtHeader;
147
+ const checkAndUpdateX5cHeader = (_b, context_2) => __awaiter(void 0, [_b, context_2], void 0, function* ({ header, identifier, noIdentifierInHeader = false, }, context) {
148
+ const { x5c } = header;
149
+ if (x5c) {
150
+ // let's resolve the provided x5c to be sure
151
+ const x5cIdentifier = yield context.agent.identifierManagedGetByX5c({ identifier: x5c });
152
+ if (x5cIdentifier.kmsKeyRef !== identifier.kmsKeyRef) {
153
+ return Promise.reject(Error(`An x5c header was present, but its issuer public key did not match the provided signing public key!`));
154
+ }
155
+ }
156
+ else if (!noIdentifierInHeader) {
157
+ if (!(0, ssi_sdk_ext_identifier_resolution_1.isManagedIdentifierX5cResult)(identifier)) {
158
+ return Promise.reject(Error('No x5c header in the JWT, but mode was x5c and also no x5x identifier was provided!'));
159
+ }
160
+ else if (header.jwk || header.kid) {
161
+ return Promise.reject(Error('x5c mode was choosen, but jwk or kid headers were provided. These cannot be used together!'));
162
+ }
163
+ header.x5c = identifier.x5c;
164
+ }
165
+ });
166
+ const checkAndUpdateDidHeader = (_c, context_3) => __awaiter(void 0, [_c, context_3], void 0, function* ({ header, identifier, noIdentifierInHeader = false, }, context) {
167
+ const { kid } = header;
168
+ if (kid) {
169
+ // let's resolve the provided x5c to be sure
170
+ const vmIdentifier = yield context.agent.identifierManagedGetByDid({ identifier: kid });
171
+ if (vmIdentifier.kmsKeyRef !== identifier.kmsKeyRef) {
172
+ return Promise.reject(Error(`A kid header was present, but its value did not match the provided signing kid!`));
173
+ }
174
+ }
175
+ else if (!noIdentifierInHeader) {
176
+ if (!(0, ssi_sdk_ext_identifier_resolution_1.isManagedIdentifierDidResult)(identifier)) {
177
+ return Promise.reject(Error('No kid header in the JWT, but mode was did and also no DID identifier was provided!'));
178
+ }
179
+ else if (header.jwk || header.x5c) {
180
+ return Promise.reject(Error('did mode was chosen, but jwk or x5c headers were provided. These cannot be used together!'));
181
+ }
182
+ header.kid = identifier.kid;
183
+ }
184
+ });
185
+ const checkAndUpdateJwkHeader = (_d, context_4) => __awaiter(void 0, [_d, context_4], void 0, function* ({ header, identifier, noIdentifierInHeader = false, }, context) {
186
+ const { jwk } = header;
187
+ if (jwk) {
188
+ // let's resolve the provided x5c to be sure
189
+ const jwkIdentifier = yield context.agent.identifierManagedGetByJwk({ identifier: jwk });
190
+ if (jwkIdentifier.kmsKeyRef !== identifier.kmsKeyRef) {
191
+ return Promise.reject(Error(`A jwk header was present, but its value did not match the provided signing jwk or kid!`));
192
+ }
193
+ }
194
+ else if (!noIdentifierInHeader) {
195
+ // We basically accept everything for this mode, as we can always create JWKs from any key
196
+ if (header.x5c) {
197
+ return Promise.reject(Error('jwk mode was chosen, but x5c headers were provided. These cannot be used together!'));
198
+ }
199
+ header.jwk = identifier.jwk;
200
+ }
201
+ });
202
+ const checkAndUpdateKidHeader = (_e, context_5) => __awaiter(void 0, [_e, context_5], void 0, function* ({ header, identifier, noIdentifierInHeader = false, }, context) {
203
+ const { kid } = header;
204
+ if (kid) {
205
+ // let's resolve the provided x5c to be sure
206
+ const kidIdentifier = yield context.agent.identifierManagedGetByKid({ identifier: kid });
207
+ if (kidIdentifier.kmsKeyRef !== identifier.kmsKeyRef) {
208
+ return Promise.reject(Error(`A kid header was present, but its value did not match the provided signing kid!`));
209
+ }
210
+ }
211
+ else if (!noIdentifierInHeader) {
212
+ // We basically accept everything for this mode, as we can always create JWKs from any key
213
+ if (header.x5c) {
214
+ return Promise.reject(Error('kid mode was chosen, but x5c headers were provided. These cannot be used together!'));
215
+ }
216
+ header.kid = identifier.kid;
217
+ }
218
+ });
219
+ const isMode = (mode, identifierMethod, checkMode, loose = true) => {
220
+ if (loose && (checkMode === 'jwk' || checkMode === 'kid')) {
221
+ // we always have the kid and jwk at hand no matter the identifier method, so we are okay with that
222
+ // todo: check the impact on the above expressions, as this will now always return true for the both of them
223
+ return true;
224
+ }
225
+ if (mode === checkMode) {
226
+ if (checkMode !== 'auto' && mode !== identifierMethod) {
227
+ throw Error(`Provided mode ${mode} conflicts with identifier method ${identifierMethod}`);
228
+ }
229
+ return true;
230
+ }
231
+ // we always have the kid and jwk at hand no matter the identifier method, so we are okay with that
232
+ return mode === 'auto' && identifierMethod === checkMode;
233
+ };
234
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mGAMoD;AACpD,yCAAgE;AAChE,iDAAkC;AAe3B,MAAM,gBAAgB,GAAG,CAAO,IAAuB,EAAE,OAAyB,EAA8B,EAAE;IACvH,MAAM,EAAE,kBAAkB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;IAEvG,MAAM,EAAE,oBAAoB,GAAG,KAAK,EAAE,GAAG,MAAM,CAAA;IAC/C,MAAM,cAAc,mCAAQ,iBAAiB,GAAK,eAAe,CAAE,CAAA;IACnE,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC;QACxB,OAAO,OAAO,CAAC,MAAM,CAAC,wCAAwC,CAAC,CAAA;IACjE,CAAC;IACD,MAAM,UAAU,GAAG,MAAM,IAAA,iEAA6B,EAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvE,MAAM,IAAA,+BAAuB,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,OAAO,CAAC,CAAA;IAE3G,MAAM,OAAO,GAAG,OAAO,YAAY,UAAU,CAAA;IAC7C,MAAM,QAAQ,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAA;IAC5C,IAAI,CAAC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC1B,IAAI,MAAM,CAAC,kBAAkB,KAAK,IAAI,IAAI,CAAC,OAAO,CAA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E,CAAC;YACtD,MAAM,KAAK,CAAC,iBAAiB,IAAI,qCAAqC,gBAAgB,EAAE,CAAC,CAAA;QAC3F,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IACD,mGAAmG;IACnG,OAAO,IAAI,KAAK,MAAM,IAAI,gBAAgB,KAAK,SAAS,CAAA;AAC1D,CAAC,CAAA"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ declare const schema: any;
5
+ export { schema };
6
+ /**
7
+ * @public
8
+ */
9
+ export { JwtService } from './agent/JwtService';
10
+ export * from './functions';
11
+ export * from './types/IJwtService';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,QAAA,MAAM,MAAM,KAAmC,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.JwtService = exports.schema = void 0;
18
+ /**
19
+ * @internal
20
+ */
21
+ const schema = require('../plugin.schema.json');
22
+ exports.schema = schema;
23
+ /**
24
+ * @public
25
+ */
26
+ var JwtService_1 = require("./agent/JwtService");
27
+ Object.defineProperty(exports, "JwtService", { enumerable: true, get: function () { return JwtService_1.JwtService; } });
28
+ __exportStar(require("./functions"), exports);
29
+ __exportStar(require("./types/IJwtService"), exports);
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,MAAM,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACtC,wBAAM;AACf;;GAEG;AACH,iDAA+C;AAAtC,wGAAA,UAAU,OAAA;AACnB,8CAA2B;AAC3B,sDAAmC"}
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.47.5"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,93 @@
1
+ import { IIdentifierResolution, ManagedIdentifierOptsOrResult, ManagedIdentifierResult } from '@sphereon/ssi-sdk-ext.identifier-resolution';
2
+ import { ISphereonKeyManager } from '@sphereon/ssi-sdk-ext.key-manager';
3
+ import { JWK, SignatureAlgorithmJwa } from '@sphereon/ssi-sdk-ext.key-utils';
4
+ import { IAgentContext, IPluginMethodMap } from '@veramo/core';
5
+ export type IRequiredContext = IAgentContext<IIdentifierResolution & ISphereonKeyManager>;
6
+ export interface IJwtService extends IPluginMethodMap {
7
+ jwtPrepareJws(args: CreateJwsJsonArgs, context: IRequiredContext): Promise<PreparedJwsObject>;
8
+ jwtCreateJwsJsonGeneralSignature(args: CreateJwsJsonArgs, context: IRequiredContext): Promise<JwsJsonGeneral>;
9
+ jwtCreateJwsJsonFlattenedSignature(args: CreateJwsFlattenedArgs, context: IRequiredContext): Promise<JwsJsonFlattened>;
10
+ jwtCreateJwsCompactSignature(args: CreateJwsCompactArgs, context: IRequiredContext): Promise<JwsCompactResult>;
11
+ }
12
+ export interface PreparedJws {
13
+ protectedHeader: JwtHeader;
14
+ payload: Uint8Array;
15
+ unprotectedHeader?: JwtHeader;
16
+ existingSignatures?: Array<JwsJsonSignature>;
17
+ }
18
+ export interface JwsJsonSignature {
19
+ protected: string;
20
+ header?: JwtHeader;
21
+ signature: string;
22
+ }
23
+ export type JwsCompact = string;
24
+ export interface JwsJsonFlattened {
25
+ payload: string;
26
+ protected: string;
27
+ header?: JwtHeader;
28
+ signature: string;
29
+ }
30
+ export interface JwsJsonGeneral {
31
+ payload: string;
32
+ signatures: Array<JwsJsonSignature>;
33
+ }
34
+ export interface PreparedJwsObject {
35
+ jws: PreparedJws;
36
+ b64: {
37
+ payload: string;
38
+ protectedHeader: string;
39
+ };
40
+ identifier: ManagedIdentifierResult;
41
+ }
42
+ export interface BaseJwtHeader {
43
+ typ?: string;
44
+ alg?: string;
45
+ kid?: string;
46
+ }
47
+ export interface BaseJwtPayload {
48
+ iss?: string;
49
+ sub?: string;
50
+ aud?: string[] | string;
51
+ exp?: number;
52
+ nbf?: number;
53
+ iat?: number;
54
+ jti?: string;
55
+ }
56
+ export interface JwtHeader extends BaseJwtHeader {
57
+ kid?: string;
58
+ jwk?: JWK;
59
+ x5c?: string[];
60
+ [key: string]: unknown;
61
+ }
62
+ export interface JwtPayload extends BaseJwtPayload {
63
+ [key: string]: unknown;
64
+ }
65
+ export interface JwsHeaderOpts {
66
+ als: SignatureAlgorithmJwa;
67
+ }
68
+ export type CreateJwsMode = 'x5c' | 'kid' | 'jwk' | 'did' | 'auto';
69
+ export type CreateJwsArgs = {
70
+ mode?: CreateJwsMode;
71
+ issuer: ManagedIdentifierOptsOrResult & {
72
+ noIssPayloadUpdate?: boolean;
73
+ noIdentifierInHeader?: boolean;
74
+ };
75
+ protectedHeader: JwtHeader;
76
+ payload: JwtPayload | Uint8Array | string;
77
+ };
78
+ export type CreateJwsCompactArgs = CreateJwsArgs;
79
+ export type CreateJwsFlattenedArgs = Exclude<CreateJwsJsonArgs, 'existingSignatures'>;
80
+ /**
81
+ * @public
82
+ */
83
+ export type CreateJwsJsonArgs = CreateJwsArgs & {
84
+ unprotectedHeader?: JwtHeader;
85
+ existingSignatures?: Array<JwsJsonSignature>;
86
+ };
87
+ /**
88
+ * @public
89
+ */
90
+ export interface JwsCompactResult {
91
+ jwt: JwsCompact;
92
+ }
93
+ //# sourceMappingURL=IJwtService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IJwtService.d.ts","sourceRoot":"","sources":["../../src/types/IJwtService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAA;AAC3I,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAE9D,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC,qBAAqB,GAAG,mBAAmB,CAAC,CAAA;AACzF,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACnD,aAAa,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAE7F,gCAAgC,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;IAE7G,kCAAkC,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAEtH,4BAA4B,C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+1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // export const COMPACT_JWS_REGEX = /^([a-zA-Z0-9_=-]+)\.([a-zA-Z0-9_=-]+)?\.([a-zA-Z0-9_=-]+)$/
4
+ //# sourceMappingURL=IJwtService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IJwtService.js","sourceRoot":"","sources":["../../src/types/IJwtService.ts"],"names":[],"mappings":";;AAgHA,gGAAgG"}
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@sphereon/ssi-sdk-ext.jwt-service",
3
+ "version": "0.24.1-next.93+d271292",
4
+ "source": "src/index.ts",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "veramo": {
8
+ "pluginInterfaces": {
9
+ "IJwtService": "./src/types/IJwtService.ts"
10
+ }
11
+ },
12
+ "scripts": {
13
+ "build": "tsc --build",
14
+ "build:clean": "tsc --build --clean && tsc --build",
15
+ "generate-plugin-schema": "sphereon dev generate-plugin-schema"
16
+ },
17
+ "dependencies": {
18
+ "@sphereon/ssi-sdk-ext.did-utils": "0.24.1-next.93+d271292",
19
+ "@sphereon/ssi-sdk-ext.identifier-resolution": "0.24.1-next.93+d271292",
20
+ "@sphereon/ssi-sdk-ext.key-manager": "0.24.1-next.93+d271292",
21
+ "@sphereon/ssi-sdk-ext.key-utils": "0.24.1-next.93+d271292",
22
+ "@sphereon/ssi-sdk-ext.x509-utils": "0.24.1-next.93+d271292",
23
+ "@sphereon/ssi-sdk.agent-config": "0.29.1-unstable.75",
24
+ "@sphereon/ssi-types": "0.29.1-unstable.75",
25
+ "@veramo/core": "4.2.0",
26
+ "@veramo/utils": "4.2.0",
27
+ "debug": "^4.3.4",
28
+ "jwt-decode": "^4.0.0",
29
+ "uint8arrays": "^3.1.1"
30
+ },
31
+ "devDependencies": {
32
+ "@sphereon/ssi-sdk-ext.did-provider-jwk": "0.24.1-next.93+d271292",
33
+ "@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.24.1-next.93+d271292",
34
+ "@sphereon/ssi-sdk-ext.kms-local": "0.24.1-next.93+d271292",
35
+ "@sphereon/ssi-sdk.dev": "0.29.1-unstable.75",
36
+ "@veramo/data-store": "4.2.0",
37
+ "@veramo/did-manager": "4.2.0",
38
+ "@veramo/did-resolver": "4.2.0",
39
+ "@veramo/key-manager": "4.2.0",
40
+ "@veramo/kms-local": "4.2.0",
41
+ "@veramo/remote-client": "4.2.0",
42
+ "@veramo/remote-server": "4.2.0",
43
+ "did-resolver": "^4.1.0",
44
+ "js-crypto-key-utils": "^1.0.7",
45
+ "typeorm": "0.3.20"
46
+ },
47
+ "files": [
48
+ "dist/**/*",
49
+ "src/**/*",
50
+ "plugin.schema.json",
51
+ "README.md",
52
+ "LICENSE"
53
+ ],
54
+ "private": false,
55
+ "publishConfig": {
56
+ "access": "public"
57
+ },
58
+ "repository": "git@github.com:Sphereon-OpenSource/SSI-SDK-crypto-extensions.git",
59
+ "author": "Sphereon <dev@sphereon.com>",
60
+ "license": "Apache-2.0",
61
+ "keywords": [
62
+ "Sphereon",
63
+ "Identifier resolution",
64
+ "JWK",
65
+ "DID",
66
+ "X.509 Certificates",
67
+ "ARF"
68
+ ],
69
+ "gitHead": "d2712929c883f3f2e4dfce30b7b448c573f0b529"
70
+ }