@sd-jwt/decode 0.2.1 → 2.0.2-next.26
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/LICENSE +201 -0
- package/dist/index.d.mts +57 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.js +282 -0
- package/dist/index.mjs +249 -0
- package/package.json +57 -46
- package/src/decode.ts +323 -0
- package/src/index.ts +1 -0
- package/src/test/decode.spec.ts +150 -0
- package/tsconfig.json +7 -0
- package/vitest.config.mts +4 -0
- package/README.md +0 -97
- package/build/disclosures/calculateDigest.d.ts +0 -4
- package/build/disclosures/calculateDigest.js +0 -14
- package/build/disclosures/calculateDigest.js.map +0 -1
- package/build/disclosures/decodePayload.d.ts +0 -2
- package/build/disclosures/decodePayload.js +0 -75
- package/build/disclosures/decodePayload.js.map +0 -1
- package/build/disclosures/fromArray.d.ts +0 -2
- package/build/disclosures/fromArray.js +0 -8
- package/build/disclosures/fromArray.js.map +0 -1
- package/build/disclosures/fromString.d.ts +0 -2
- package/build/disclosures/fromString.js +0 -11
- package/build/disclosures/fromString.js.map +0 -1
- package/build/disclosures/index.d.ts +0 -5
- package/build/disclosures/index.js +0 -22
- package/build/disclosures/index.js.map +0 -1
- package/build/disclosures/toArray.d.ts +0 -2
- package/build/disclosures/toArray.js +0 -6
- package/build/disclosures/toArray.js.map +0 -1
- package/build/index.d.ts +0 -5
- package/build/index.js +0 -20
- package/build/index.js.map +0 -1
- package/build/jwt/fromCompact.d.ts +0 -5
- package/build/jwt/fromCompact.js +0 -26
- package/build/jwt/fromCompact.js.map +0 -1
- package/build/jwt/index.d.ts +0 -1
- package/build/jwt/index.js +0 -18
- package/build/jwt/index.js.map +0 -1
- package/build/keyBinding/assertValid.d.ts +0 -0
- package/build/keyBinding/assertValid.js +0 -2
- package/build/keyBinding/assertValid.js.map +0 -1
- package/build/keyBinding/fromCompact.d.ts +0 -5
- package/build/keyBinding/fromCompact.js +0 -24
- package/build/keyBinding/fromCompact.js.map +0 -1
- package/build/keyBinding/index.d.ts +0 -2
- package/build/keyBinding/index.js +0 -19
- package/build/keyBinding/index.js.map +0 -1
- package/build/keyBinding/sdHash.d.ts +0 -2
- package/build/keyBinding/sdHash.js +0 -17
- package/build/keyBinding/sdHash.js.map +0 -1
- package/build/sdJwt/fromCompact.d.ts +0 -17
- package/build/sdJwt/fromCompact.js +0 -39
- package/build/sdJwt/fromCompact.js.map +0 -1
- package/build/sdJwt/index.d.ts +0 -1
- package/build/sdJwt/index.js +0 -18
- package/build/sdJwt/index.js.map +0 -1
- package/build/sdJwtVc/decode.d.ts +0 -12
- package/build/sdJwtVc/decode.js +0 -38
- package/build/sdJwtVc/decode.js.map +0 -1
- package/build/sdJwtVc/fromCompact.d.ts +0 -17
- package/build/sdJwtVc/fromCompact.js +0 -24
- package/build/sdJwtVc/fromCompact.js.map +0 -1
- package/build/sdJwtVc/index.d.ts +0 -2
- package/build/sdJwtVc/index.js +0 -19
- package/build/sdJwtVc/index.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import type { HasherAndAlgorithm, AsyncHasher, Hasher } from '@sd-jwt/types';
|
|
2
|
-
export declare function calculateSdHash<HasherImplementation extends Hasher | AsyncHasher>(compactSdJwt: string, hasherAndAlgorithm: HasherAndAlgorithm<HasherImplementation>): ReturnType<HasherImplementation> extends Promise<any> ? Promise<string> : string;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calculateSdHash = void 0;
|
|
4
|
-
const utils_1 = require("@sd-jwt/utils");
|
|
5
|
-
function calculateSdHash(compactSdJwt, hasherAndAlgorithm) {
|
|
6
|
-
// If we don't end with a '~' we probably need to remove the
|
|
7
|
-
// kb-jwt first
|
|
8
|
-
const sdJwtWithoutKbJwt = compactSdJwt.endsWith('~')
|
|
9
|
-
? compactSdJwt
|
|
10
|
-
: compactSdJwt.split('~').slice(0, -1).join('~') + '~';
|
|
11
|
-
const hashResult = hasherAndAlgorithm.hasher(sdJwtWithoutKbJwt, hasherAndAlgorithm.algorithm);
|
|
12
|
-
return ((0, utils_1.isPromise)(hashResult)
|
|
13
|
-
? hashResult.then((hash) => utils_1.Base64url.encode(hash))
|
|
14
|
-
: utils_1.Base64url.encode(hashResult));
|
|
15
|
-
}
|
|
16
|
-
exports.calculateSdHash = calculateSdHash;
|
|
17
|
-
//# sourceMappingURL=sdHash.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdHash.js","sourceRoot":"","sources":["../../src/keyBinding/sdHash.ts"],"names":[],"mappings":";;;AACA,yCAAoD;AAEpD,SAAgB,eAAe,CAG3B,YAAoB,EACpB,kBAA4D;IAI5D,4DAA4D;IAC5D,eAAe;IACf,MAAM,iBAAiB,GAAG,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC;QAChD,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAA;IAE1D,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CACxC,iBAAiB,EACjB,kBAAkB,CAAC,SAAS,CAC/B,CAAA;IAED,OAAO,CACH,IAAA,iBAAS,EAAC,UAAU,CAAC;QACjB,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACnD,CAAC,CAAC,iBAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAC9B,CAAA;AACZ,CAAC;AAxBD,0CAwBC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const sdJwtFromCompact: <Header extends Record<string, unknown> = Record<string, unknown>, Payload extends Record<string, unknown> = Record<string, unknown>>(compact: string) => {
|
|
2
|
-
header: Header;
|
|
3
|
-
payload: Payload;
|
|
4
|
-
signature: Uint8Array;
|
|
5
|
-
keyBinding?: undefined;
|
|
6
|
-
disclosures?: undefined;
|
|
7
|
-
} | {
|
|
8
|
-
header: Header;
|
|
9
|
-
payload: Payload;
|
|
10
|
-
signature: Uint8Array;
|
|
11
|
-
keyBinding: {
|
|
12
|
-
header: Record<string, unknown>;
|
|
13
|
-
payload: Record<string, unknown>;
|
|
14
|
-
signature: Uint8Array;
|
|
15
|
-
} | undefined;
|
|
16
|
-
disclosures: import("@sd-jwt/types").Disclosure[];
|
|
17
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sdJwtFromCompact = void 0;
|
|
4
|
-
const fromString_1 = require("../disclosures/fromString");
|
|
5
|
-
const jwt_1 = require("../jwt");
|
|
6
|
-
const keyBinding_1 = require("../keyBinding");
|
|
7
|
-
const sdJwtFromCompact = (compact) => {
|
|
8
|
-
if (!compact.includes('~')) {
|
|
9
|
-
throw new Error('compact is not a valid sd-jwt. It must contain at least one ~');
|
|
10
|
-
}
|
|
11
|
-
const [jwtWithoutDisclosures, ...encodedDisclosures] = compact.split('~');
|
|
12
|
-
const { header, payload, signature } = (0, jwt_1.jwtFromCompact)(jwtWithoutDisclosures);
|
|
13
|
-
// No KB-JWT or disclosures
|
|
14
|
-
if (encodedDisclosures.length === 1 && encodedDisclosures[0] === '') {
|
|
15
|
-
return {
|
|
16
|
-
header,
|
|
17
|
-
payload,
|
|
18
|
-
signature
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
// If the disclosure array ends with an `~` we do not have
|
|
22
|
-
// a key binding and `String.split` takes it as an empty string
|
|
23
|
-
// as element which we would not like to include in the disclosures.
|
|
24
|
-
const compactKeyBinding = encodedDisclosures.pop();
|
|
25
|
-
const hasKeyBinding = compactKeyBinding && compactKeyBinding !== '';
|
|
26
|
-
const keyBinding = hasKeyBinding
|
|
27
|
-
? (0, keyBinding_1.keyBindingFromCompact)(compactKeyBinding)
|
|
28
|
-
: undefined;
|
|
29
|
-
const disclosures = encodedDisclosures.map(fromString_1.disclosureFromString);
|
|
30
|
-
return {
|
|
31
|
-
header,
|
|
32
|
-
payload,
|
|
33
|
-
signature,
|
|
34
|
-
keyBinding,
|
|
35
|
-
disclosures
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
exports.sdJwtFromCompact = sdJwtFromCompact;
|
|
39
|
-
//# sourceMappingURL=fromCompact.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fromCompact.js","sourceRoot":"","sources":["../../src/sdJwt/fromCompact.ts"],"names":[],"mappings":";;;AAAA,0DAAgE;AAChE,gCAAuC;AACvC,8CAAqD;AAE9C,MAAM,gBAAgB,GAAG,CAI5B,OAAe,EACjB,EAAE;IACA,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACX,+DAA+D,CAClE,CAAA;IACL,CAAC;IACD,MAAM,CAAC,qBAAqB,EAAE,GAAG,kBAAkB,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAEzE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAA,oBAAc,EACjD,qBAAqB,CACxB,CAAA;IAED,2BAA2B;IAC3B,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;QAClE,OAAO;YACH,MAAM;YACN,OAAO;YACP,SAAS;SACZ,CAAA;IACL,CAAC;IAED,0DAA0D;IAC1D,+DAA+D;IAC/D,oEAAoE;IACpE,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,EAAE,CAAA;IAClD,MAAM,aAAa,GAAG,iBAAiB,IAAI,iBAAiB,KAAK,EAAE,CAAA;IAEnE,MAAM,UAAU,GAAG,aAAa;QAC5B,CAAC,CAAC,IAAA,kCAAqB,EAAC,iBAAiB,CAAC;QAC1C,CAAC,CAAC,SAAS,CAAA;IAEf,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,iCAAoB,CAAC,CAAA;IAEhE,OAAO;QACH,MAAM;QACN,OAAO;QACP,SAAS;QACT,UAAU;QACV,WAAW;KACd,CAAA;AACL,CAAC,CAAA;AA7CY,QAAA,gBAAgB,oBA6C5B"}
|
package/build/sdJwt/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './fromCompact';
|
package/build/sdJwt/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
__exportStar(require("./fromCompact"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/build/sdJwt/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sdJwt/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { AsyncHasher, DisclosureWithDigest, Hasher } from '@sd-jwt/types';
|
|
2
|
-
interface DecodeSdJwtVcResult {
|
|
3
|
-
compactSdJwtVc: string;
|
|
4
|
-
signedPayload: Record<string, unknown>;
|
|
5
|
-
header: Record<string, unknown>;
|
|
6
|
-
signature: Uint8Array;
|
|
7
|
-
keyBinding?: Record<string, unknown>;
|
|
8
|
-
disclosures: Array<DisclosureWithDigest>;
|
|
9
|
-
decodedPayload: Record<string, unknown>;
|
|
10
|
-
}
|
|
11
|
-
export declare const decodeSdJwtVc: <HI extends Hasher | AsyncHasher>(compact: string, hasher: HI) => HI extends AsyncHasher ? Promise<DecodeSdJwtVcResult> : DecodeSdJwtVcResult;
|
|
12
|
-
export {};
|
package/build/sdJwtVc/decode.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.decodeSdJwtVc = void 0;
|
|
4
|
-
const types_1 = require("@sd-jwt/types");
|
|
5
|
-
const utils_1 = require("@sd-jwt/utils");
|
|
6
|
-
const fromCompact_1 = require("./fromCompact");
|
|
7
|
-
const utils_2 = require("@sd-jwt/utils");
|
|
8
|
-
const calculateDigest_1 = require("../disclosures/calculateDigest");
|
|
9
|
-
const disclosures_1 = require("../disclosures");
|
|
10
|
-
const decodeSdJwtVc = (compact, hasher) => {
|
|
11
|
-
var _a, _b;
|
|
12
|
-
const { header, payload, signature, keyBinding, disclosures } = (0, fromCompact_1.sdJwtVcFromCompact)(compact);
|
|
13
|
-
const hasherAlgorithm = (_a = (0, utils_2.getValueByKeyAnyLevel)(payload, '_sd_alg')) !== null && _a !== void 0 ? _a : types_1.HasherAlgorithm.Sha256;
|
|
14
|
-
const disclosuresWithDigestsResult = ((_b = disclosures === null || disclosures === void 0 ? void 0 : disclosures.map((disclosure) => {
|
|
15
|
-
const digestResult = (0, calculateDigest_1.disclosureCalculateDigest)(disclosure, hasherAlgorithm, hasher);
|
|
16
|
-
return (0, utils_1.isPromise)(digestResult)
|
|
17
|
-
? digestResult.then((digest) => (Object.assign(Object.assign({}, disclosure), { digest })))
|
|
18
|
-
: Object.assign(Object.assign({}, disclosure), { digest: digestResult });
|
|
19
|
-
})) !== null && _b !== void 0 ? _b : []);
|
|
20
|
-
const basePayload = {
|
|
21
|
-
compactSdJwtVc: compact,
|
|
22
|
-
signedPayload: payload,
|
|
23
|
-
header,
|
|
24
|
-
signature,
|
|
25
|
-
keyBinding
|
|
26
|
-
};
|
|
27
|
-
if (isAsyncCalculateDigestReturnType(disclosuresWithDigestsResult)) {
|
|
28
|
-
return Promise.all(disclosuresWithDigestsResult).then((disclosureWithDigests) => (Object.assign(Object.assign({}, basePayload), { disclosures: disclosureWithDigests, decodedPayload: (0, disclosures_1.decodeDisclosuresInPayload)(basePayload.signedPayload, disclosureWithDigests) })));
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
return Object.assign(Object.assign({}, basePayload), { disclosures: disclosuresWithDigestsResult, decodedPayload: (0, disclosures_1.decodeDisclosuresInPayload)(basePayload.signedPayload, disclosuresWithDigestsResult) });
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
exports.decodeSdJwtVc = decodeSdJwtVc;
|
|
35
|
-
function isAsyncCalculateDigestReturnType(disclosureWithDigests) {
|
|
36
|
-
return (0, utils_1.isPromise)(disclosureWithDigests[0]);
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=decode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decode.js","sourceRoot":"","sources":["../../src/sdJwtVc/decode.ts"],"names":[],"mappings":";;;AACA,yCAA+C;AAC/C,yCAAyC;AACzC,+CAAkD;AAClD,yCAAqD;AACrD,oEAA0E;AAC1E,gDAA2D;AAYpD,MAAM,aAAa,GAAG,CACzB,OAAe,EACf,MAAU,EAGY,EAAE;;IACxB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,GACzD,IAAA,gCAAkB,EAAC,OAAO,CAAC,CAAA;IAE/B,MAAM,eAAe,GACjB,MAAA,IAAA,6BAAqB,EAAkB,OAAO,EAAE,SAAS,CAAC,mCAC1D,uBAAe,CAAC,MAAM,CAAA;IAE1B,MAAM,4BAA4B,GAAG,CAAC,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;QAClE,MAAM,YAAY,GAAG,IAAA,2CAAyB,EAC1C,UAAU,EACV,eAAe,EACf,MAAM,CACT,CAAA;QAED,OAAO,IAAA,iBAAS,EAAC,YAAY,CAAC;YAC1B,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,iCAAM,UAAU,KAAE,MAAM,IAAG,CAAC;YAC5D,CAAC,iCAAM,UAAU,KAAE,MAAM,EAAE,YAAY,GAAE,CAAA;IACjD,CAAC,CAAC,mCAAI,EAAE,CAEkC,CAAA;IAE1C,MAAM,WAAW,GAAG;QAChB,cAAc,EAAE,OAAO;QACvB,aAAa,EAAE,OAAO;QACtB,MAAM;QACN,SAAS;QACT,UAAU;KACJ,CAAA;IAEV,IAAI,gCAAgC,CAAC,4BAA4B,CAAC,EAAE,CAAC;QACjE,OAAO,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,IAAI,CACjD,CAAC,qBAAqB,EAAE,EAAE,CAAC,iCACpB,WAAW,KACd,WAAW,EAAE,qBAAqB,EAClC,cAAc,EAAE,IAAA,wCAA0B,EACtC,WAAW,CAAC,aAAa,EACzB,qBAAqB,CACxB,IACH,CAGmB,CAAA;IAC7B,CAAC;SAAM,CAAC;QACJ,OAAO,gCACA,WAAW,KACd,WAAW,EAAE,4BAA4B,EACzC,cAAc,EAAE,IAAA,wCAA0B,EACtC,WAAW,CAAC,aAAa,EACzB,4BAA4B,CAC/B,GAGoB,CAAA;IAC7B,CAAC;AACL,CAAC,CAAA;AA5DY,QAAA,aAAa,iBA4DzB;AAED,SAAS,gCAAgC,CACrC,qBAEC;IAED,OAAO,IAAA,iBAAS,EAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAA;AAC9C,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const sdJwtVcFromCompact: <Header extends Record<string, unknown> = Record<string, unknown>, Payload extends Record<string, unknown> = Record<string, unknown>>(compact: string) => {
|
|
2
|
-
header: Header;
|
|
3
|
-
payload: Payload;
|
|
4
|
-
signature: Uint8Array;
|
|
5
|
-
keyBinding?: undefined;
|
|
6
|
-
disclosures?: undefined;
|
|
7
|
-
} | {
|
|
8
|
-
header: Header;
|
|
9
|
-
payload: Payload;
|
|
10
|
-
signature: Uint8Array;
|
|
11
|
-
keyBinding: {
|
|
12
|
-
header: Record<string, unknown>;
|
|
13
|
-
payload: Record<string, unknown>;
|
|
14
|
-
signature: Uint8Array;
|
|
15
|
-
} | undefined;
|
|
16
|
-
disclosures: import("@sd-jwt/types").Disclosure[];
|
|
17
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sdJwtVcFromCompact = void 0;
|
|
4
|
-
const utils_1 = require("@sd-jwt/utils");
|
|
5
|
-
const fromCompact_1 = require("../sdJwt/fromCompact");
|
|
6
|
-
const sdJwtVcFromCompact = (compact) => {
|
|
7
|
-
const sdJwt = (0, fromCompact_1.sdJwtFromCompact)(compact);
|
|
8
|
-
try {
|
|
9
|
-
(0, utils_1.assertClaimInObject)(sdJwt.header, 'typ', 'vc+sd-jwt');
|
|
10
|
-
(0, utils_1.assertClaimInObject)(sdJwt.header, 'alg');
|
|
11
|
-
(0, utils_1.assertClaimInObject)(sdJwt.payload, 'iss');
|
|
12
|
-
(0, utils_1.assertClaimInObject)(sdJwt.payload, 'vct');
|
|
13
|
-
(0, utils_1.assertClaimInObject)(sdJwt.payload, 'iat');
|
|
14
|
-
}
|
|
15
|
-
catch (e) {
|
|
16
|
-
if (e instanceof Error) {
|
|
17
|
-
e.message = `jwt is not valid for usage with sd-jwt-vc. Error: ${e.message}`;
|
|
18
|
-
}
|
|
19
|
-
throw e;
|
|
20
|
-
}
|
|
21
|
-
return sdJwt;
|
|
22
|
-
};
|
|
23
|
-
exports.sdJwtVcFromCompact = sdJwtVcFromCompact;
|
|
24
|
-
//# sourceMappingURL=fromCompact.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fromCompact.js","sourceRoot":"","sources":["../../src/sdJwtVc/fromCompact.ts"],"names":[],"mappings":";;;AAAA,yCAAmD;AACnD,sDAAuD;AAEhD,MAAM,kBAAkB,GAAG,CAI9B,OAAe,EACjB,EAAE;IACA,MAAM,KAAK,GAAG,IAAA,8BAAgB,EAAkB,OAAO,CAAC,CAAA;IAExD,IAAI,CAAC;QACD,IAAA,2BAAmB,EAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,CAAA;QACrD,IAAA,2BAAmB,EAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QACxC,IAAA,2BAAmB,EAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACzC,IAAA,2BAAmB,EAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACzC,IAAA,2BAAmB,EAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAC7C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;YACrB,CAAC,CAAC,OAAO,GAAG,qDAAqD,CAAC,CAAC,OAAO,EAAE,CAAA;QAChF,CAAC;QAED,MAAM,CAAC,CAAA;IACX,CAAC;IAED,OAAO,KAAK,CAAA;AAChB,CAAC,CAAA;AAvBY,QAAA,kBAAkB,sBAuB9B"}
|
package/build/sdJwtVc/index.d.ts
DELETED
package/build/sdJwtVc/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
__exportStar(require("./decode"), exports);
|
|
18
|
-
__exportStar(require("./fromCompact"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sdJwtVc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,gDAA6B"}
|