@sd-jwt/decode 0.3.2-next.94 → 0.3.2-next.96

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sd-jwt/decode",
3
- "version": "0.3.2-next.94+32af6cf",
3
+ "version": "0.3.2-next.96+bfb8f73",
4
4
  "description": "sd-jwt draft 7 implementation in typescript",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -37,11 +37,11 @@
37
37
  },
38
38
  "license": "Apache-2.0",
39
39
  "devDependencies": {
40
- "@sd-jwt/crypto-nodejs": "0.3.2-next.94+32af6cf"
40
+ "@sd-jwt/crypto-nodejs": "0.3.2-next.96+bfb8f73"
41
41
  },
42
42
  "dependencies": {
43
- "@sd-jwt/types": "0.3.2-next.94+32af6cf",
44
- "@sd-jwt/utils": "0.3.2-next.94+32af6cf"
43
+ "@sd-jwt/types": "0.3.2-next.96+bfb8f73",
44
+ "@sd-jwt/utils": "0.3.2-next.96+bfb8f73"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
@@ -59,5 +59,5 @@
59
59
  "esm"
60
60
  ]
61
61
  },
62
- "gitHead": "32af6cfa150fceb440fc9225bcaf2791a6aeee90"
62
+ "gitHead": "bfb8f73d22bf3c5f400f83a97a94677d8875a63f"
63
63
  }
@@ -5,6 +5,7 @@ import {
5
5
  decodeSdJwtSync,
6
6
  getClaims,
7
7
  getClaimsSync,
8
+ getSDAlgAndPayload,
8
9
  splitSdJwt,
9
10
  } from '../index';
10
11
  import { digest } from '@sd-jwt/crypto-nodejs';
@@ -36,6 +37,14 @@ describe('decode tests', () => {
36
37
  expect(kbJwt).toBeUndefined();
37
38
  });
38
39
 
40
+ test('split sdjwt without disclosures', () => {
41
+ const sdjwt = 'h.p.s';
42
+ const { jwt, disclosures, kbJwt } = splitSdJwt(sdjwt);
43
+ expect(jwt).toBe('h.p.s');
44
+ expect(disclosures).toStrictEqual([]);
45
+ expect(kbJwt).toBeUndefined();
46
+ });
47
+
39
48
  test('split sdjwt with kbjwt', () => {
40
49
  const sdjwt = 'h.p.s~d1~d2~kbh.kbp.kbs';
41
50
  const { jwt, disclosures, kbJwt } = splitSdJwt(sdjwt);
@@ -147,4 +156,9 @@ describe('decode tests', () => {
147
156
  },
148
157
  });
149
158
  });
159
+
160
+ test('Test default sd hash algorithm', () => {
161
+ const { _sd_alg, payload } = getSDAlgAndPayload({});
162
+ expect(_sd_alg).toBe('sha-256');
163
+ });
150
164
  });