@sd-jwt/types 0.9.2-next.2 → 0.9.2-next.6
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.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +21 -0
- package/dist/index.mjs +20 -0
- package/package.json +2 -2
- package/src/type.ts +21 -18
package/dist/index.d.mts
CHANGED
|
@@ -6,7 +6,8 @@ declare const KB_JWT_TYP = "kb+jwt";
|
|
|
6
6
|
type SDJWTCompact = string;
|
|
7
7
|
type Base64urlString = string;
|
|
8
8
|
type DisclosureData<T> = [string, string, T] | [string, T];
|
|
9
|
-
|
|
9
|
+
declare const IANA_HASH_ALGORITHMS: readonly ["sha-256", "sha-256-128", "sha-256-120", "sha-256-96", "sha-256-64", "sha-256-32", "sha-384", "sha-512", "sha3-224", "sha3-256", "sha3-384", "sha3-512", "blake2s-256", "blake2b-256", "blake2b-512", "k12-256", "k12-512"];
|
|
10
|
+
type HashAlgorithm = (typeof IANA_HASH_ALGORITHMS)[number];
|
|
10
11
|
type SDJWTConfig = {
|
|
11
12
|
omitTyp?: boolean;
|
|
12
13
|
hasher?: Hasher;
|
|
@@ -183,4 +184,4 @@ type PFrame<Payload> = Payload extends Array<infer U> ? U extends object ? Recor
|
|
|
183
184
|
};
|
|
184
185
|
type PresentationFrame<T extends Extensible> = PFrame<T>;
|
|
185
186
|
|
|
186
|
-
export { type Base64urlString, type DECOY, type DisclosureData, type DisclosureFrame, type Extensible, type HashAlgorithm, type Hasher, type HasherAndAlg, type HasherAndAlgSync, type HasherSync, type JwtPayload, type KBOptions, KB_JWT_TYP, type KbVerifier, type OrPromise, type PresentationFrame, type SD, type SDJWTCompact, type SDJWTConfig, SD_DECOY, SD_DIGEST, SD_LIST_KEY, SD_SEPARATOR, type SaltGenerator, type SaltGeneratorSync, type Signer, type SignerSync, type Verifier, type VerifierSync, type kbHeader, type kbPayload };
|
|
187
|
+
export { type Base64urlString, type DECOY, type DisclosureData, type DisclosureFrame, type Extensible, type HashAlgorithm, type Hasher, type HasherAndAlg, type HasherAndAlgSync, type HasherSync, IANA_HASH_ALGORITHMS, type JwtPayload, type KBOptions, KB_JWT_TYP, type KbVerifier, type OrPromise, type PresentationFrame, type SD, type SDJWTCompact, type SDJWTConfig, SD_DECOY, SD_DIGEST, SD_LIST_KEY, SD_SEPARATOR, type SaltGenerator, type SaltGeneratorSync, type Signer, type SignerSync, type Verifier, type VerifierSync, type kbHeader, type kbPayload };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ declare const KB_JWT_TYP = "kb+jwt";
|
|
|
6
6
|
type SDJWTCompact = string;
|
|
7
7
|
type Base64urlString = string;
|
|
8
8
|
type DisclosureData<T> = [string, string, T] | [string, T];
|
|
9
|
-
|
|
9
|
+
declare const IANA_HASH_ALGORITHMS: readonly ["sha-256", "sha-256-128", "sha-256-120", "sha-256-96", "sha-256-64", "sha-256-32", "sha-384", "sha-512", "sha3-224", "sha3-256", "sha3-384", "sha3-512", "blake2s-256", "blake2b-256", "blake2b-512", "k12-256", "k12-512"];
|
|
10
|
+
type HashAlgorithm = (typeof IANA_HASH_ALGORITHMS)[number];
|
|
10
11
|
type SDJWTConfig = {
|
|
11
12
|
omitTyp?: boolean;
|
|
12
13
|
hasher?: Hasher;
|
|
@@ -183,4 +184,4 @@ type PFrame<Payload> = Payload extends Array<infer U> ? U extends object ? Recor
|
|
|
183
184
|
};
|
|
184
185
|
type PresentationFrame<T extends Extensible> = PFrame<T>;
|
|
185
186
|
|
|
186
|
-
export { type Base64urlString, type DECOY, type DisclosureData, type DisclosureFrame, type Extensible, type HashAlgorithm, type Hasher, type HasherAndAlg, type HasherAndAlgSync, type HasherSync, type JwtPayload, type KBOptions, KB_JWT_TYP, type KbVerifier, type OrPromise, type PresentationFrame, type SD, type SDJWTCompact, type SDJWTConfig, SD_DECOY, SD_DIGEST, SD_LIST_KEY, SD_SEPARATOR, type SaltGenerator, type SaltGeneratorSync, type Signer, type SignerSync, type Verifier, type VerifierSync, type kbHeader, type kbPayload };
|
|
187
|
+
export { type Base64urlString, type DECOY, type DisclosureData, type DisclosureFrame, type Extensible, type HashAlgorithm, type Hasher, type HasherAndAlg, type HasherAndAlgSync, type HasherSync, IANA_HASH_ALGORITHMS, type JwtPayload, type KBOptions, KB_JWT_TYP, type KbVerifier, type OrPromise, type PresentationFrame, type SD, type SDJWTCompact, type SDJWTConfig, SD_DECOY, SD_DIGEST, SD_LIST_KEY, SD_SEPARATOR, type SaltGenerator, type SaltGeneratorSync, type Signer, type SignerSync, type Verifier, type VerifierSync, type kbHeader, type kbPayload };
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
|
+
IANA_HASH_ALGORITHMS: () => IANA_HASH_ALGORITHMS,
|
|
23
24
|
KB_JWT_TYP: () => KB_JWT_TYP,
|
|
24
25
|
SD_DECOY: () => SD_DECOY,
|
|
25
26
|
SD_DIGEST: () => SD_DIGEST,
|
|
@@ -34,8 +35,28 @@ var SD_LIST_KEY = "...";
|
|
|
34
35
|
var SD_DIGEST = "_sd";
|
|
35
36
|
var SD_DECOY = "_sd_decoy";
|
|
36
37
|
var KB_JWT_TYP = "kb+jwt";
|
|
38
|
+
var IANA_HASH_ALGORITHMS = [
|
|
39
|
+
"sha-256",
|
|
40
|
+
"sha-256-128",
|
|
41
|
+
"sha-256-120",
|
|
42
|
+
"sha-256-96",
|
|
43
|
+
"sha-256-64",
|
|
44
|
+
"sha-256-32",
|
|
45
|
+
"sha-384",
|
|
46
|
+
"sha-512",
|
|
47
|
+
"sha3-224",
|
|
48
|
+
"sha3-256",
|
|
49
|
+
"sha3-384",
|
|
50
|
+
"sha3-512",
|
|
51
|
+
"blake2s-256",
|
|
52
|
+
"blake2b-256",
|
|
53
|
+
"blake2b-512",
|
|
54
|
+
"k12-256",
|
|
55
|
+
"k12-512"
|
|
56
|
+
];
|
|
37
57
|
// Annotate the CommonJS export names for ESM import in node:
|
|
38
58
|
0 && (module.exports = {
|
|
59
|
+
IANA_HASH_ALGORITHMS,
|
|
39
60
|
KB_JWT_TYP,
|
|
40
61
|
SD_DECOY,
|
|
41
62
|
SD_DIGEST,
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,27 @@ var SD_LIST_KEY = "...";
|
|
|
4
4
|
var SD_DIGEST = "_sd";
|
|
5
5
|
var SD_DECOY = "_sd_decoy";
|
|
6
6
|
var KB_JWT_TYP = "kb+jwt";
|
|
7
|
+
var IANA_HASH_ALGORITHMS = [
|
|
8
|
+
"sha-256",
|
|
9
|
+
"sha-256-128",
|
|
10
|
+
"sha-256-120",
|
|
11
|
+
"sha-256-96",
|
|
12
|
+
"sha-256-64",
|
|
13
|
+
"sha-256-32",
|
|
14
|
+
"sha-384",
|
|
15
|
+
"sha-512",
|
|
16
|
+
"sha3-224",
|
|
17
|
+
"sha3-256",
|
|
18
|
+
"sha3-384",
|
|
19
|
+
"sha3-512",
|
|
20
|
+
"blake2s-256",
|
|
21
|
+
"blake2b-256",
|
|
22
|
+
"blake2b-512",
|
|
23
|
+
"k12-256",
|
|
24
|
+
"k12-512"
|
|
25
|
+
];
|
|
7
26
|
export {
|
|
27
|
+
IANA_HASH_ALGORITHMS,
|
|
8
28
|
KB_JWT_TYP,
|
|
9
29
|
SD_DECOY,
|
|
10
30
|
SD_DIGEST,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sd-jwt/types",
|
|
3
|
-
"version": "0.9.2-next.
|
|
3
|
+
"version": "0.9.2-next.6+5e64551",
|
|
4
4
|
"description": "sd-jwt draft 7 implementation in typescript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"esm"
|
|
54
54
|
]
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "5e6455158648525d09320dd562422d9f9f33ffaa"
|
|
57
57
|
}
|
package/src/type.ts
CHANGED
|
@@ -10,24 +10,27 @@ export type Base64urlString = string;
|
|
|
10
10
|
export type DisclosureData<T> = [string, string, T] | [string, T];
|
|
11
11
|
|
|
12
12
|
// based on https://www.iana.org/assignments/named-information/named-information.xhtml
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
13
|
+
export const IANA_HASH_ALGORITHMS = [
|
|
14
|
+
'sha-256',
|
|
15
|
+
'sha-256-128',
|
|
16
|
+
'sha-256-120',
|
|
17
|
+
'sha-256-96',
|
|
18
|
+
'sha-256-64',
|
|
19
|
+
'sha-256-32',
|
|
20
|
+
'sha-384',
|
|
21
|
+
'sha-512',
|
|
22
|
+
'sha3-224',
|
|
23
|
+
'sha3-256',
|
|
24
|
+
'sha3-384',
|
|
25
|
+
'sha3-512',
|
|
26
|
+
'blake2s-256',
|
|
27
|
+
'blake2b-256',
|
|
28
|
+
'blake2b-512',
|
|
29
|
+
'k12-256',
|
|
30
|
+
'k12-512',
|
|
31
|
+
] as const;
|
|
32
|
+
|
|
33
|
+
export type HashAlgorithm = (typeof IANA_HASH_ALGORITHMS)[number];
|
|
31
34
|
|
|
32
35
|
export type SDJWTConfig = {
|
|
33
36
|
omitTyp?: boolean;
|