@sd-jwt/types 0.2.0 → 0.2.1

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/build/hasher.d.ts CHANGED
@@ -1,2 +1,11 @@
1
+ import { HasherAlgorithm } from './hasherAlgorithm';
1
2
  export type Hasher = (data: string, algorithm: string) => Uint8Array;
2
3
  export type AsyncHasher = (data: string, algorithm: string) => Promise<Uint8Array>;
4
+ /**
5
+ * hasher: A simple hash function that takes the base64url encoded variant of the disclosure and returns the digest as a byte array
6
+ * algorithm: IANA defined string for the hashing algorithm used
7
+ */
8
+ export type HasherAndAlgorithm<HasherImplementation extends Hasher | AsyncHasher = Hasher | AsyncHasher> = {
9
+ hasher: HasherImplementation;
10
+ algorithm: HasherAlgorithm | string;
11
+ };
@@ -0,0 +1,70 @@
1
+ export declare enum HasherAlgorithm {
2
+ /**
3
+ * Sha-256: 256 bits. [RFC6920] (current)
4
+ */
5
+ Sha256 = "sha-256",
6
+ /**
7
+ * Sha-256-128: 128 bits. [RFC6920] (current)
8
+ */
9
+ Sha256_128 = "sha-256-128",
10
+ /**
11
+ * Sha-256-120: 120 bits. [RFC6920] (current)
12
+ */
13
+ Sha256_120 = "sha-256-120",
14
+ /**
15
+ * Sha-256-96: 96 bits. [RFC6920] (current)
16
+ */
17
+ Sha256_96 = "sha-256-96",
18
+ /**
19
+ * Sha-256-64: 64 bits. [RFC6920] (current)
20
+ */
21
+ Sha256_64 = "sha-256-64",
22
+ /**
23
+ * Sha-256-32: 32 bits. [RFC6920] (current)
24
+ */
25
+ Sha256_32 = "sha-256-32",
26
+ /**
27
+ * Sha-384: 384 bits. [FIPS 180-4] (current)
28
+ */
29
+ Sha384 = "sha-384",
30
+ /**
31
+ * Sha-512: 512 bits. [FIPS 180-4] (current)
32
+ */
33
+ Sha512 = "sha-512",
34
+ /**
35
+ * Sha3-224: 224 bits. [FIPS 202] (current)
36
+ */
37
+ Sha3_224 = "sha3-224",
38
+ /**
39
+ * Sha3-256: 256 bits. [FIPS 202] (current)
40
+ */
41
+ Sha3_256 = "sha3-256",
42
+ /**
43
+ * Sha3-384: 384 bits. [FIPS 202] (current)
44
+ */
45
+ Sha3_384 = "sha3-384",
46
+ /**
47
+ * Sha3-512: 512 bits. [FIPS 202] (current)
48
+ */
49
+ Sha3_512 = "sha3-512",
50
+ /**
51
+ * Blake2s-256: 256 bits. [RFC7693] (current)
52
+ */
53
+ Blake2s_256 = "blake2s-256",
54
+ /**
55
+ * Blake2b-256: 256 bits. [RFC7693] (current)
56
+ */
57
+ Blake2b_256 = "blake2b-256",
58
+ /**
59
+ * Blake2b-512: 512 bits. [RFC7693] (current)
60
+ */
61
+ Blake2b_512 = "blake2b-512",
62
+ /**
63
+ * K12-256: 256 bits. [draft-irtf-cfrg-kangarootwelve-06] (current)
64
+ */
65
+ K12_256 = "k12-256",
66
+ /**
67
+ * K12-512: 512 bits. [draft-irtf-cfrg-kangarootwelve-06] (current)
68
+ */
69
+ K12_512 = "k12-512"
70
+ }
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HasherAlgorithm = void 0;
4
+ var HasherAlgorithm;
5
+ (function (HasherAlgorithm) {
6
+ /**
7
+ * Sha-256: 256 bits. [RFC6920] (current)
8
+ */
9
+ HasherAlgorithm["Sha256"] = "sha-256";
10
+ /**
11
+ * Sha-256-128: 128 bits. [RFC6920] (current)
12
+ */
13
+ HasherAlgorithm["Sha256_128"] = "sha-256-128";
14
+ /**
15
+ * Sha-256-120: 120 bits. [RFC6920] (current)
16
+ */
17
+ HasherAlgorithm["Sha256_120"] = "sha-256-120";
18
+ /**
19
+ * Sha-256-96: 96 bits. [RFC6920] (current)
20
+ */
21
+ HasherAlgorithm["Sha256_96"] = "sha-256-96";
22
+ /**
23
+ * Sha-256-64: 64 bits. [RFC6920] (current)
24
+ */
25
+ HasherAlgorithm["Sha256_64"] = "sha-256-64";
26
+ /**
27
+ * Sha-256-32: 32 bits. [RFC6920] (current)
28
+ */
29
+ HasherAlgorithm["Sha256_32"] = "sha-256-32";
30
+ /**
31
+ * Sha-384: 384 bits. [FIPS 180-4] (current)
32
+ */
33
+ HasherAlgorithm["Sha384"] = "sha-384";
34
+ /**
35
+ * Sha-512: 512 bits. [FIPS 180-4] (current)
36
+ */
37
+ HasherAlgorithm["Sha512"] = "sha-512";
38
+ /**
39
+ * Sha3-224: 224 bits. [FIPS 202] (current)
40
+ */
41
+ HasherAlgorithm["Sha3_224"] = "sha3-224";
42
+ /**
43
+ * Sha3-256: 256 bits. [FIPS 202] (current)
44
+ */
45
+ HasherAlgorithm["Sha3_256"] = "sha3-256";
46
+ /**
47
+ * Sha3-384: 384 bits. [FIPS 202] (current)
48
+ */
49
+ HasherAlgorithm["Sha3_384"] = "sha3-384";
50
+ /**
51
+ * Sha3-512: 512 bits. [FIPS 202] (current)
52
+ */
53
+ HasherAlgorithm["Sha3_512"] = "sha3-512";
54
+ /**
55
+ * Blake2s-256: 256 bits. [RFC7693] (current)
56
+ */
57
+ HasherAlgorithm["Blake2s_256"] = "blake2s-256";
58
+ /**
59
+ * Blake2b-256: 256 bits. [RFC7693] (current)
60
+ */
61
+ HasherAlgorithm["Blake2b_256"] = "blake2b-256";
62
+ /**
63
+ * Blake2b-512: 512 bits. [RFC7693] (current)
64
+ */
65
+ HasherAlgorithm["Blake2b_512"] = "blake2b-512";
66
+ /**
67
+ * K12-256: 256 bits. [draft-irtf-cfrg-kangarootwelve-06] (current)
68
+ */
69
+ HasherAlgorithm["K12_256"] = "k12-256";
70
+ /**
71
+ * K12-512: 512 bits. [draft-irtf-cfrg-kangarootwelve-06] (current)
72
+ */
73
+ HasherAlgorithm["K12_512"] = "k12-512";
74
+ })(HasherAlgorithm || (exports.HasherAlgorithm = HasherAlgorithm = {}));
75
+ //# sourceMappingURL=hasherAlgorithm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasherAlgorithm.js","sourceRoot":"","sources":["../src/hasherAlgorithm.ts"],"names":[],"mappings":";;;AAAA,IAAY,eAqEX;AArED,WAAY,eAAe;IACvB;;OAEG;IACH,qCAAkB,CAAA;IAClB;;OAEG;IACH,6CAA0B,CAAA;IAC1B;;OAEG;IACH,6CAA0B,CAAA;IAC1B;;OAEG;IACH,2CAAwB,CAAA;IACxB;;OAEG;IACH,2CAAwB,CAAA;IACxB;;OAEG;IACH,2CAAwB,CAAA;IACxB;;OAEG;IACH,qCAAkB,CAAA;IAClB;;OAEG;IACH,qCAAkB,CAAA;IAClB;;OAEG;IACH,wCAAqB,CAAA;IACrB;;OAEG;IACH,wCAAqB,CAAA;IACrB;;OAEG;IACH,wCAAqB,CAAA;IACrB;;OAEG;IACH,wCAAqB,CAAA;IACrB;;OAEG;IACH,8CAA2B,CAAA;IAC3B;;OAEG;IACH,8CAA2B,CAAA;IAC3B;;OAEG;IACH,8CAA2B,CAAA;IAC3B;;OAEG;IACH,sCAAmB,CAAA;IACnB;;OAEG;IACH,sCAAmB,CAAA;AACvB,CAAC,EArEW,eAAe,+BAAf,eAAe,QAqE1B"}
package/build/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './disclosure';
2
2
  export * from './hasher';
3
3
  export * from './frame';
4
+ export * from './hasherAlgorithm';
package/build/index.js CHANGED
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./disclosure"), exports);
18
18
  __exportStar(require("./hasher"), exports);
19
19
  __exportStar(require("./frame"), exports);
20
+ __exportStar(require("./hasherAlgorithm"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,2CAAwB;AACxB,0CAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,2CAAwB;AACxB,0CAAuB;AACvB,oDAAiC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sd-jwt/types",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Common types of sd-jwt Draft 06 and sd-jwt-vc Draft 01",
5
5
  "license": "(MIT OR Apache-2.0)",
6
6
  "author": "Berend Sliedrecht <sliedrecht@berend.io>",
@@ -40,5 +40,5 @@
40
40
  "ts-node": "*",
41
41
  "typescript": "*"
42
42
  },
43
- "gitHead": "8fb68d5a23b2bf157949346a6603dc40b1594195"
43
+ "gitHead": "a1fb5fad0b938081e033233bae5569ae3b9fe8cb"
44
44
  }