@sd-jwt/core 0.9.2-next.3 → 0.9.2-next.7
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.js +2 -21
- package/dist/index.mjs +2 -20
- package/package.json +7 -7
- package/src/index.ts +1 -20
package/dist/index.js
CHANGED
|
@@ -597,30 +597,11 @@ var GeneralJSON = class _GeneralJSON {
|
|
|
597
597
|
};
|
|
598
598
|
|
|
599
599
|
// src/index.ts
|
|
600
|
-
var IANA_HASH_ALGORITHMS = [
|
|
601
|
-
"sha-256",
|
|
602
|
-
"sha-256-128",
|
|
603
|
-
"sha-256-120",
|
|
604
|
-
"sha-256-96",
|
|
605
|
-
"sha-256-64",
|
|
606
|
-
"sha-256-32",
|
|
607
|
-
"sha-384",
|
|
608
|
-
"sha-512",
|
|
609
|
-
"sha3-224",
|
|
610
|
-
"sha3-256",
|
|
611
|
-
"sha3-384",
|
|
612
|
-
"sha3-512",
|
|
613
|
-
"blake2s-256",
|
|
614
|
-
"blake2b-256",
|
|
615
|
-
"blake2b-512",
|
|
616
|
-
"k12-256",
|
|
617
|
-
"k12-512"
|
|
618
|
-
];
|
|
619
600
|
var _SDJwtInstance = class _SDJwtInstance {
|
|
620
601
|
constructor(userConfig) {
|
|
621
602
|
this.userConfig = {};
|
|
622
603
|
if (userConfig) {
|
|
623
|
-
if (userConfig.hashAlg && !IANA_HASH_ALGORITHMS.includes(userConfig.hashAlg)) {
|
|
604
|
+
if (userConfig.hashAlg && !import_types5.IANA_HASH_ALGORITHMS.includes(userConfig.hashAlg)) {
|
|
624
605
|
throw new import_utils7.SDJWTException(
|
|
625
606
|
`Invalid hash algorithm: ${userConfig.hashAlg}`
|
|
626
607
|
);
|
|
@@ -876,7 +857,7 @@ var SDJwtGeneralJSONInstance = class {
|
|
|
876
857
|
constructor(userConfig) {
|
|
877
858
|
this.userConfig = {};
|
|
878
859
|
if (userConfig) {
|
|
879
|
-
if (userConfig.hashAlg && !IANA_HASH_ALGORITHMS.includes(userConfig.hashAlg)) {
|
|
860
|
+
if (userConfig.hashAlg && !import_types5.IANA_HASH_ALGORITHMS.includes(userConfig.hashAlg)) {
|
|
880
861
|
throw new import_utils7.SDJWTException(
|
|
881
862
|
`Invalid hash algorithm: ${userConfig.hashAlg}`
|
|
882
863
|
);
|
package/dist/index.mjs
CHANGED
|
@@ -418,7 +418,8 @@ var pack = (claims, disclosureFrame, hash, saltGenerator) => __async(void 0, nul
|
|
|
418
418
|
|
|
419
419
|
// src/index.ts
|
|
420
420
|
import {
|
|
421
|
-
KB_JWT_TYP as KB_JWT_TYP2
|
|
421
|
+
KB_JWT_TYP as KB_JWT_TYP2,
|
|
422
|
+
IANA_HASH_ALGORITHMS
|
|
422
423
|
} from "@sd-jwt/types";
|
|
423
424
|
import { getSDAlgAndPayload as getSDAlgAndPayload2 } from "@sd-jwt/decode";
|
|
424
425
|
|
|
@@ -581,25 +582,6 @@ var GeneralJSON = class _GeneralJSON {
|
|
|
581
582
|
};
|
|
582
583
|
|
|
583
584
|
// src/index.ts
|
|
584
|
-
var IANA_HASH_ALGORITHMS = [
|
|
585
|
-
"sha-256",
|
|
586
|
-
"sha-256-128",
|
|
587
|
-
"sha-256-120",
|
|
588
|
-
"sha-256-96",
|
|
589
|
-
"sha-256-64",
|
|
590
|
-
"sha-256-32",
|
|
591
|
-
"sha-384",
|
|
592
|
-
"sha-512",
|
|
593
|
-
"sha3-224",
|
|
594
|
-
"sha3-256",
|
|
595
|
-
"sha3-384",
|
|
596
|
-
"sha3-512",
|
|
597
|
-
"blake2s-256",
|
|
598
|
-
"blake2b-256",
|
|
599
|
-
"blake2b-512",
|
|
600
|
-
"k12-256",
|
|
601
|
-
"k12-512"
|
|
602
|
-
];
|
|
603
585
|
var _SDJwtInstance = class _SDJwtInstance {
|
|
604
586
|
constructor(userConfig) {
|
|
605
587
|
this.userConfig = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sd-jwt/core",
|
|
3
|
-
"version": "0.9.2-next.
|
|
3
|
+
"version": "0.9.2-next.7+76d1b7b",
|
|
4
4
|
"description": "sd-jwt draft 7 implementation in typescript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
},
|
|
39
39
|
"license": "Apache-2.0",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@sd-jwt/crypto-nodejs": "0.9.2-next.
|
|
41
|
+
"@sd-jwt/crypto-nodejs": "0.9.2-next.7+76d1b7b"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@sd-jwt/decode": "0.9.2-next.
|
|
45
|
-
"@sd-jwt/present": "0.9.2-next.
|
|
46
|
-
"@sd-jwt/types": "0.9.2-next.
|
|
47
|
-
"@sd-jwt/utils": "0.9.2-next.
|
|
44
|
+
"@sd-jwt/decode": "0.9.2-next.7+76d1b7b",
|
|
45
|
+
"@sd-jwt/present": "0.9.2-next.7+76d1b7b",
|
|
46
|
+
"@sd-jwt/types": "0.9.2-next.7+76d1b7b",
|
|
47
|
+
"@sd-jwt/utils": "0.9.2-next.7+76d1b7b"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"esm"
|
|
63
63
|
]
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "76d1b7bba7e6d779264efe8f1d4f2be891c42a00"
|
|
66
66
|
}
|
package/src/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
type SDJWTConfig,
|
|
18
18
|
type JwtPayload,
|
|
19
19
|
type Signer,
|
|
20
|
+
IANA_HASH_ALGORITHMS,
|
|
20
21
|
type HashAlgorithm,
|
|
21
22
|
} from '@sd-jwt/types';
|
|
22
23
|
import { getSDAlgAndPayload } from '@sd-jwt/decode';
|
|
@@ -32,26 +33,6 @@ export * from './generalJSON';
|
|
|
32
33
|
|
|
33
34
|
export type SdJwtPayload = Record<string, unknown>;
|
|
34
35
|
|
|
35
|
-
const IANA_HASH_ALGORITHMS: HashAlgorithm[] = [
|
|
36
|
-
'sha-256',
|
|
37
|
-
'sha-256-128',
|
|
38
|
-
'sha-256-120',
|
|
39
|
-
'sha-256-96',
|
|
40
|
-
'sha-256-64',
|
|
41
|
-
'sha-256-32',
|
|
42
|
-
'sha-384',
|
|
43
|
-
'sha-512',
|
|
44
|
-
'sha3-224',
|
|
45
|
-
'sha3-256',
|
|
46
|
-
'sha3-384',
|
|
47
|
-
'sha3-512',
|
|
48
|
-
'blake2s-256',
|
|
49
|
-
'blake2b-256',
|
|
50
|
-
'blake2b-512',
|
|
51
|
-
'k12-256',
|
|
52
|
-
'k12-512',
|
|
53
|
-
];
|
|
54
|
-
|
|
55
36
|
export class SDJwtInstance<ExtendedPayload extends SdJwtPayload> {
|
|
56
37
|
//header type
|
|
57
38
|
protected type?: string;
|