@sphereon/ssi-sdk-ext.jwt-service 0.28.1-feature.oyd.cmsm.improv.20 → 0.28.1-next.53
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 +37739 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +278 -0
- package/dist/index.d.ts +273 -8
- package/dist/index.js +37709 -30
- package/dist/index.js.map +1 -1
- package/package.json +38 -23
- package/plugin.schema.json +35838 -4811
- package/src/agent/JwtService.ts +21 -18
- package/src/functions/JWE.ts +18 -14
- package/src/functions/index.ts +36 -21
- package/src/types/IJwtService.ts +4 -4
- package/dist/agent/JwtService.d.ts +0 -17
- package/dist/agent/JwtService.d.ts.map +0 -1
- package/dist/agent/JwtService.js +0 -137
- package/dist/agent/JwtService.js.map +0 -1
- package/dist/functions/JWE.d.ts +0 -75
- package/dist/functions/JWE.d.ts.map +0 -1
- package/dist/functions/JWE.js +0 -280
- package/dist/functions/JWE.js.map +0 -1
- package/dist/functions/index.d.ts +0 -35
- package/dist/functions/index.d.ts.map +0 -1
- package/dist/functions/index.js +0 -385
- package/dist/functions/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/types/IJwtService.d.ts +0 -222
- package/dist/types/IJwtService.d.ts.map +0 -1
- package/dist/types/IJwtService.js +0 -75
- package/dist/types/IJwtService.js.map +0 -1
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JweEncs = exports.JweAlgs = exports.COMPACT_JWE_REGEX = exports.COMPACT_JWS_REGEX = exports.jwtServiceContextMethods = void 0;
|
|
4
|
-
exports.isJwsCompact = isJwsCompact;
|
|
5
|
-
exports.isJweCompact = isJweCompact;
|
|
6
|
-
exports.isJwsJsonFlattened = isJwsJsonFlattened;
|
|
7
|
-
exports.isJwsJsonGeneral = isJwsJsonGeneral;
|
|
8
|
-
exports.isJweJsonFlattened = isJweJsonFlattened;
|
|
9
|
-
exports.isJweJsonGeneral = isJweJsonGeneral;
|
|
10
|
-
exports.isJwsHeader = isJwsHeader;
|
|
11
|
-
exports.isJweHeader = isJweHeader;
|
|
12
|
-
exports.jweAlg = jweAlg;
|
|
13
|
-
exports.jweEnc = jweEnc;
|
|
14
|
-
exports.jwtServiceContextMethods = [
|
|
15
|
-
'jwtPrepareJws',
|
|
16
|
-
'jwtCreateJwsJsonGeneralSignature',
|
|
17
|
-
'jwtCreateJwsJsonFlattenedSignature',
|
|
18
|
-
'jwtCreateJwsCompactSignature',
|
|
19
|
-
'jwtVerifyJwsSignature',
|
|
20
|
-
'jwtEncryptJweCompactJwt',
|
|
21
|
-
'jwtDecryptJweCompactJwt',
|
|
22
|
-
];
|
|
23
|
-
function isJwsCompact(jws) {
|
|
24
|
-
return typeof jws === 'string' && jws.split('~')[0].match(exports.COMPACT_JWS_REGEX) !== null;
|
|
25
|
-
}
|
|
26
|
-
function isJweCompact(jwe) {
|
|
27
|
-
return typeof jwe === 'string' && jwe.split('~')[0].match(exports.COMPACT_JWE_REGEX) !== null;
|
|
28
|
-
}
|
|
29
|
-
function isJwsJsonFlattened(jws) {
|
|
30
|
-
return typeof jws === 'object' && 'signature' in jws && 'protected' in jws && !('ciphertext' in jws);
|
|
31
|
-
}
|
|
32
|
-
function isJwsJsonGeneral(jws) {
|
|
33
|
-
return typeof jws === 'object' && 'signatures' in jws && !('ciphertext' in jws);
|
|
34
|
-
}
|
|
35
|
-
function isJweJsonFlattened(jwe) {
|
|
36
|
-
return typeof jwe === 'object' && 'signature' in jwe && 'ciphertext' in jwe && !('payload' in jwe);
|
|
37
|
-
}
|
|
38
|
-
function isJweJsonGeneral(jwe) {
|
|
39
|
-
return typeof jwe === 'object' && 'signatures' in jwe && 'ciphertext' in jwe && !('payload' in jwe);
|
|
40
|
-
}
|
|
41
|
-
function isJwsHeader(header) {
|
|
42
|
-
return header && !isJweHeader(header);
|
|
43
|
-
}
|
|
44
|
-
function isJweHeader(header) {
|
|
45
|
-
return ('enc' in header && header.enc && jweEnc(header.enc)) || (header.alg && jweAlg(header.alg));
|
|
46
|
-
}
|
|
47
|
-
exports.COMPACT_JWS_REGEX = /^([a-zA-Z0-9_=-]+).([a-zA-Z0-9_=-]+)?.([a-zA-Z0-9_=-]+)?$/;
|
|
48
|
-
exports.COMPACT_JWE_REGEX = /^([a-zA-Z0-9_=-]+)\.([a-zA-Z0-9_=-]+)?\.([a-zA-Z0-9_=-]+)\.([a-zA-Z0-9_=-]+)?\.([a-zA-Z0-9_=-]+)?$/;
|
|
49
|
-
exports.JweAlgs = [
|
|
50
|
-
'RSA1_5',
|
|
51
|
-
'RSA-OAEP',
|
|
52
|
-
'RSA-OAEP-256',
|
|
53
|
-
'A128KW',
|
|
54
|
-
'A192KW',
|
|
55
|
-
'A256KW',
|
|
56
|
-
'dir',
|
|
57
|
-
'ECDH-ES' /*interop value*/,
|
|
58
|
-
'ECDH-ES+A128KW',
|
|
59
|
-
'ECDH-ES+A192KW',
|
|
60
|
-
'ECDH-ES+A256KW',
|
|
61
|
-
'A128GCMKW',
|
|
62
|
-
'A192GCMKW',
|
|
63
|
-
'A256GCMKW',
|
|
64
|
-
'PBES2-HS256+A128KW',
|
|
65
|
-
'PBES2-HS384+A192KW',
|
|
66
|
-
'PBES2-HS512+A256KW',
|
|
67
|
-
];
|
|
68
|
-
function jweAlg(alg) {
|
|
69
|
-
return exports.JweAlgs.find((supportedVal) => supportedVal === alg);
|
|
70
|
-
}
|
|
71
|
-
exports.JweEncs = ['A128CBC-HS256', 'A192CBC-HS384', 'A256CBC-HS512', 'A128GCM', 'A192GCM', 'A256GCM' /*interop value*/];
|
|
72
|
-
function jweEnc(alg) {
|
|
73
|
-
return exports.JweEncs.find((supportedVal) => supportedVal === alg);
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=IJwtService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IJwt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