@sd-jwt/types 0.9.2-next.0 → 0.9.2-next.2

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 CHANGED
@@ -6,10 +6,11 @@ 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
+ type HashAlgorithm = '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';
9
10
  type SDJWTConfig = {
10
11
  omitTyp?: boolean;
11
12
  hasher?: Hasher;
12
- hashAlg?: string;
13
+ hashAlg?: HashAlgorithm;
13
14
  saltGenerator?: SaltGenerator;
14
15
  signer?: Signer;
15
16
  signAlg?: string;
@@ -182,4 +183,4 @@ type PFrame<Payload> = Payload extends Array<infer U> ? U extends object ? Recor
182
183
  };
183
184
  type PresentationFrame<T extends Extensible> = PFrame<T>;
184
185
 
185
- export { type Base64urlString, type DECOY, type DisclosureData, type DisclosureFrame, type Extensible, 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -6,10 +6,11 @@ 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
+ type HashAlgorithm = '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';
9
10
  type SDJWTConfig = {
10
11
  omitTyp?: boolean;
11
12
  hasher?: Hasher;
12
- hashAlg?: string;
13
+ hashAlg?: HashAlgorithm;
13
14
  saltGenerator?: SaltGenerator;
14
15
  signer?: Signer;
15
16
  signAlg?: string;
@@ -182,4 +183,4 @@ type PFrame<Payload> = Payload extends Array<infer U> ? U extends object ? Recor
182
183
  };
183
184
  type PresentationFrame<T extends Extensible> = PFrame<T>;
184
185
 
185
- export { type Base64urlString, type DECOY, type DisclosureData, type DisclosureFrame, type Extensible, 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 };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sd-jwt/types",
3
- "version": "0.9.2-next.0+ae5b9d9",
3
+ "version": "0.9.2-next.2+3c85e8e",
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": "ae5b9d98de1ae6e214770f225ea11ab3ebce2872"
56
+ "gitHead": "3c85e8e283fa53e871a14c321b3a04fc4380b875"
57
57
  }
package/src/type.ts CHANGED
@@ -9,10 +9,30 @@ export type Base64urlString = string;
9
9
 
10
10
  export type DisclosureData<T> = [string, string, T] | [string, T];
11
11
 
12
+ // based on https://www.iana.org/assignments/named-information/named-information.xhtml
13
+ export type HashAlgorithm =
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
+
12
32
  export type SDJWTConfig = {
13
33
  omitTyp?: boolean;
14
34
  hasher?: Hasher;
15
- hashAlg?: string;
35
+ hashAlg?: HashAlgorithm;
16
36
  saltGenerator?: SaltGenerator;
17
37
  signer?: Signer;
18
38
  signAlg?: string;