@kokuin/browser 0.2.1 → 0.2.3

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/lib/identity.js CHANGED
@@ -1,4 +1,4 @@
1
- import { CODECS, decryptToken, getDID } from '@kokuin/token';
1
+ import { CODECS, getDID } from '@kokuin/token';
2
2
  import { x25519 } from '@noble/curves/ed25519.js';
3
3
  import { p256 } from '@noble/curves/nist.js';
4
4
  import { b64uFromJSON, fromUTF, toB64U } from '@sozai/codec';
@@ -58,18 +58,10 @@ import { getES256PublicKey } from './utils.js';
58
58
  }, agreement, 256);
59
59
  return new Uint8Array(shared);
60
60
  }
61
- async function decrypt(jwe) {
62
- return decryptToken({
63
- id,
64
- decrypt,
65
- agreeKey
66
- }, jwe);
67
- }
68
61
  return {
69
62
  id,
70
63
  publicKey,
71
64
  signToken,
72
- decrypt,
73
65
  agreeKey
74
66
  };
75
67
  }
package/lib/utils.js CHANGED
@@ -65,7 +65,7 @@ export function isLegacyES256Record(record) {
65
65
  }
66
66
  function ecPointCompress(x, y) {
67
67
  const out = new Uint8Array(x.length + 1);
68
- out[0] = 2 + (y[y.length - 1] & 1);
68
+ out[0] = 2 + ((y[y.length - 1] ?? 0) & 1);
69
69
  out.set(x, 1);
70
70
  return out;
71
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kokuin/browser",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Key store for browser",
5
5
  "keywords": [
6
6
  "cryptography",
@@ -25,15 +25,16 @@
25
25
  "lib/*"
26
26
  ],
27
27
  "dependencies": {
28
- "@noble/curves": "^2.3.0",
29
- "@sozai/async": "^0.2.1",
30
- "@sozai/codec": "^0.4.0",
31
- "@sozai/log": "^0.3.1",
32
- "@sozai/otel": "^0.3.2",
33
28
  "@kokuin/otel": "^0.3.0",
34
- "@kokuin/token": "^0.4.0"
29
+ "@kokuin/token": "^0.6.0",
30
+ "@noble/curves": "^2.4.0",
31
+ "@sozai/async": "^0.4.1",
32
+ "@sozai/codec": "^0.4.3",
33
+ "@sozai/log": "^0.4.0",
34
+ "@sozai/otel": "^0.3.4"
35
35
  },
36
36
  "devDependencies": {
37
+ "@kokuin/jwe": "^0.1.1",
37
38
  "@kokuin/keystore-conformance": "^0.0.0"
38
39
  },
39
40
  "publishConfig": {
@@ -41,9 +42,9 @@
41
42
  },
42
43
  "scripts": {
43
44
  "build": "pnpm run build:clean && pnpm run build:js && pnpm run build:types",
44
- "build:clean": "del lib",
45
- "build:js": "swc src -d ./lib --config-file ../../node_modules/@kigu/dev/swc.json --strip-leading-paths",
46
- "build:types": "tsc --emitDeclarationOnly --skipLibCheck",
45
+ "build:clean": "del-cli lib",
46
+ "build:js": "del-cli 'lib/**/*.js' && swc src -d ./lib --config-file ../../node_modules/@kigu/dev/swc.json --strip-leading-paths",
47
+ "build:types": "del-cli 'lib/**/*.d.ts' 'lib/**/*.d.ts.map' && tsc --emitDeclarationOnly --skipLibCheck",
47
48
  "test": "pnpm run test:types && pnpm run test:unit",
48
49
  "test:types": "tsc --noEmit --skipLibCheck -p tsconfig.test.json",
49
50
  "test:unit": "vitest run"