@dxos/keyring 0.8.3 → 0.8.4-main.f9ba587

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": "@dxos/keyring",
3
- "version": "0.8.3",
3
+ "version": "0.8.4-main.f9ba587",
4
4
  "description": "Halo Keyring.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -24,16 +24,16 @@
24
24
  "src"
25
25
  ],
26
26
  "dependencies": {
27
- "@dxos/async": "0.8.3",
28
- "@dxos/codec-protobuf": "0.8.3",
29
- "@dxos/debug": "0.8.3",
30
- "@dxos/crypto": "0.8.3",
31
- "@dxos/keys": "0.8.3",
32
- "@dxos/invariant": "0.8.3",
33
- "@dxos/node-std": "0.8.3",
34
- "@dxos/random-access-storage": "0.8.3",
35
- "@dxos/util": "0.8.3",
36
- "@dxos/protocols": "0.8.3"
27
+ "@dxos/async": "0.8.4-main.f9ba587",
28
+ "@dxos/codec-protobuf": "0.8.4-main.f9ba587",
29
+ "@dxos/crypto": "0.8.4-main.f9ba587",
30
+ "@dxos/debug": "0.8.4-main.f9ba587",
31
+ "@dxos/invariant": "0.8.4-main.f9ba587",
32
+ "@dxos/keys": "0.8.4-main.f9ba587",
33
+ "@dxos/node-std": "0.8.4-main.f9ba587",
34
+ "@dxos/protocols": "0.8.4-main.f9ba587",
35
+ "@dxos/random-access-storage": "0.8.4-main.f9ba587",
36
+ "@dxos/util": "0.8.4-main.f9ba587"
37
37
  },
38
38
  "devDependencies": {},
39
39
  "publishConfig": {
@@ -1,215 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var node_exports = {};
20
- __export(node_exports, {
21
- Keyring: () => Keyring,
22
- generateJWKKeyPair: () => generateJWKKeyPair,
23
- parseJWKKeyPair: () => parseJWKKeyPair
24
- });
25
- module.exports = __toCommonJS(node_exports);
26
- var import_async = require("@dxos/async");
27
- var import_crypto = require("@dxos/crypto");
28
- var import_debug = require("@dxos/debug");
29
- var import_invariant = require("@dxos/invariant");
30
- var import_keys = require("@dxos/keys");
31
- var import_proto = require("@dxos/protocols/proto");
32
- var import_random_access_storage = require("@dxos/random-access-storage");
33
- var import_util = require("@dxos/util");
34
- var import_crypto2 = require("@dxos/crypto");
35
- function _ts_decorate(decorators, target, key, desc) {
36
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
37
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
38
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
39
- return c > 3 && r && Object.defineProperty(target, key, r), r;
40
- }
41
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/halo/keyring/src/keyring.ts";
42
- var KeyRecord = import_proto.schema.getCodecForType("dxos.halo.keyring.KeyRecord");
43
- var Keyring = class {
44
- constructor(_storage = (0, import_random_access_storage.createStorage)({
45
- type: import_random_access_storage.StorageType.RAM
46
- }).createDirectory("keyring")) {
47
- this._storage = _storage;
48
- this._keyCache = new import_util.ComplexMap(import_keys.PublicKey.hash);
49
- this.keysUpdate = new import_async.Event();
50
- (0, import_invariant.invariant)(import_crypto.subtleCrypto, "SubtleCrypto not available in this environment.", {
51
- F: __dxlog_file,
52
- L: 30,
53
- S: this,
54
- A: [
55
- "subtleCrypto",
56
- "'SubtleCrypto not available in this environment.'"
57
- ]
58
- });
59
- }
60
- async sign(key, message) {
61
- const keyPair = await this._getKey(key);
62
- return new Uint8Array(await import_crypto.subtleCrypto.sign({
63
- name: "ECDSA",
64
- hash: "SHA-256"
65
- }, keyPair.privateKey, message));
66
- }
67
- async createKey() {
68
- const keyPair = await import_crypto.subtleCrypto.generateKey({
69
- name: "ECDSA",
70
- namedCurve: "P-256"
71
- }, true, [
72
- "sign",
73
- "verify"
74
- ]);
75
- await this._setKey(keyPair);
76
- return keyPairToPublicKey(keyPair);
77
- }
78
- async _getKey(key) {
79
- if (!this._keyCache.has(key)) {
80
- const file = this._storage.getOrCreateFile(key.toHex());
81
- const { size } = await file.stat();
82
- if (size === 0) {
83
- throw new Error(`Key not found: ${key.toHex()}`);
84
- }
85
- const recordBytes = await file.read(0, size);
86
- await file.close();
87
- const record = KeyRecord.decode(recordBytes);
88
- const publicKey = import_keys.PublicKey.from(record.publicKey);
89
- (0, import_invariant.invariant)(key.equals(publicKey), "Corrupted keyring: Key mismatch", {
90
- F: __dxlog_file,
91
- L: 77,
92
- S: this,
93
- A: [
94
- "key.equals(publicKey)",
95
- "'Corrupted keyring: Key mismatch'"
96
- ]
97
- });
98
- (0, import_invariant.invariant)(record.privateKey, "Corrupted keyring: Missing private key", {
99
- F: __dxlog_file,
100
- L: 78,
101
- S: this,
102
- A: [
103
- "record.privateKey",
104
- "'Corrupted keyring: Missing private key'"
105
- ]
106
- });
107
- const keyPair = {
108
- publicKey: await import_crypto.subtleCrypto.importKey("raw", record.publicKey, {
109
- name: "ECDSA",
110
- namedCurve: "P-256"
111
- }, true, [
112
- "verify"
113
- ]),
114
- privateKey: await import_crypto.subtleCrypto.importKey("pkcs8", record.privateKey, {
115
- name: "ECDSA",
116
- namedCurve: "P-256"
117
- }, true, [
118
- "sign"
119
- ])
120
- };
121
- this._keyCache.set(publicKey, keyPair);
122
- }
123
- return this._keyCache.get(key);
124
- }
125
- async _setKey(keyPair) {
126
- const publicKey = await keyPairToPublicKey(keyPair);
127
- this._keyCache.set(publicKey, keyPair);
128
- const record = {
129
- publicKey: publicKey.asUint8Array(),
130
- privateKey: new Uint8Array(await import_crypto.subtleCrypto.exportKey("pkcs8", keyPair.privateKey))
131
- };
132
- const file = this._storage.getOrCreateFile(publicKey.toHex());
133
- await file.write(0, (0, import_util.arrayToBuffer)(KeyRecord.encode(record)));
134
- await file.close();
135
- await file.flush?.();
136
- this.keysUpdate.emit();
137
- }
138
- // TODO(burdon): ???
139
- deleteKey(key) {
140
- return (0, import_debug.todo)("We need a method to delete a file.");
141
- }
142
- async list() {
143
- const keys = [];
144
- for (const path of await this._storage.list()) {
145
- const fileName = path.split("/").pop();
146
- (0, import_invariant.invariant)(fileName, "Invalid file name", {
147
- F: __dxlog_file,
148
- L: 134,
149
- S: this,
150
- A: [
151
- "fileName",
152
- "'Invalid file name'"
153
- ]
154
- });
155
- keys.push({
156
- publicKey: import_keys.PublicKey.fromHex(fileName).asUint8Array()
157
- });
158
- }
159
- return keys;
160
- }
161
- async importKeyPair(keyPair) {
162
- await this._setKey(keyPair);
163
- return keyPairToPublicKey(keyPair);
164
- }
165
- };
166
- _ts_decorate([
167
- import_async.synchronized
168
- ], Keyring.prototype, "_getKey", null);
169
- _ts_decorate([
170
- import_async.synchronized
171
- ], Keyring.prototype, "_setKey", null);
172
- var keyPairToPublicKey = async (keyPair) => {
173
- return import_keys.PublicKey.from(new Uint8Array(await import_crypto.subtleCrypto.exportKey("raw", keyPair.publicKey)));
174
- };
175
- var generateJWKKeyPair = async () => {
176
- const keyPair = await import_crypto2.subtleCrypto.generateKey({
177
- name: "ECDSA",
178
- namedCurve: "P-256"
179
- }, true, [
180
- "sign",
181
- "verify"
182
- ]);
183
- const privateKeyExported = await import_crypto2.subtleCrypto.exportKey("jwk", keyPair.privateKey);
184
- const publicKeyExported = await import_crypto2.subtleCrypto.exportKey("jwk", keyPair.publicKey);
185
- const publicKeyBuffer = new Uint8Array(await import_crypto2.subtleCrypto.exportKey("raw", keyPair.publicKey));
186
- const publicKeyHex = Array.from(publicKeyBuffer).map((byte) => byte.toString(16).padStart(2, "0")).join("");
187
- return {
188
- privateKey: privateKeyExported,
189
- publicKey: publicKeyExported,
190
- publicKeyHex
191
- };
192
- };
193
- var parseJWKKeyPair = async (privateKey, publicKey) => {
194
- return {
195
- privateKey: await import_crypto2.subtleCrypto.importKey("jwk", privateKey, {
196
- name: "ECDSA",
197
- namedCurve: "P-256"
198
- }, true, [
199
- "sign"
200
- ]),
201
- publicKey: await import_crypto2.subtleCrypto.importKey("jwk", publicKey, {
202
- name: "ECDSA",
203
- namedCurve: "P-256"
204
- }, true, [
205
- "verify"
206
- ])
207
- };
208
- };
209
- // Annotate the CommonJS export names for ESM import in node:
210
- 0 && (module.exports = {
211
- Keyring,
212
- generateJWKKeyPair,
213
- parseJWKKeyPair
214
- });
215
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/keyring.ts", "../../../src/testing.ts"],
4
- "sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { Event, synchronized } from '@dxos/async';\nimport { type ProtoCodec } from '@dxos/codec-protobuf';\nimport { subtleCrypto, type Signer } from '@dxos/crypto';\nimport { todo } from '@dxos/debug';\nimport { invariant } from '@dxos/invariant';\nimport { PublicKey } from '@dxos/keys';\nimport { schema } from '@dxos/protocols/proto';\nimport { type KeyRecord } from '@dxos/protocols/proto/dxos/halo/keyring';\nimport { createStorage, type Directory, StorageType } from '@dxos/random-access-storage';\nimport { ComplexMap, arrayToBuffer } from '@dxos/util';\n\nconst KeyRecord: ProtoCodec<KeyRecord> = schema.getCodecForType('dxos.halo.keyring.KeyRecord');\n\n/**\n * Manages keys.\n */\nexport class Keyring implements Signer {\n private readonly _keyCache = new ComplexMap<PublicKey, CryptoKeyPair>(PublicKey.hash);\n readonly keysUpdate = new Event();\n\n constructor(\n private readonly _storage: Directory = createStorage({\n type: StorageType.RAM,\n }).createDirectory('keyring'),\n ) {\n invariant(subtleCrypto, 'SubtleCrypto not available in this environment.');\n }\n\n async sign(key: PublicKey, message: Uint8Array): Promise<Uint8Array> {\n const keyPair = await this._getKey(key);\n\n return new Uint8Array(\n await subtleCrypto.sign(\n {\n name: 'ECDSA',\n hash: 'SHA-256',\n },\n keyPair.privateKey,\n message,\n ),\n );\n }\n\n async createKey(): Promise<PublicKey> {\n const keyPair = await subtleCrypto.generateKey(\n {\n name: 'ECDSA',\n namedCurve: 'P-256',\n },\n true,\n ['sign', 'verify'],\n );\n\n await this._setKey(keyPair);\n\n return keyPairToPublicKey(keyPair);\n }\n\n @synchronized\n private async _getKey(key: PublicKey): Promise<CryptoKeyPair> {\n if (!this._keyCache.has(key)) {\n const file = this._storage.getOrCreateFile(key.toHex());\n const { size } = await file.stat();\n if (size === 0) {\n throw new Error(`Key not found: ${key.toHex()}`);\n }\n\n const recordBytes = await file.read(0, size);\n await file.close();\n\n const record = KeyRecord.decode(recordBytes);\n const publicKey = PublicKey.from(record.publicKey);\n invariant(key.equals(publicKey), 'Corrupted keyring: Key mismatch');\n invariant(record.privateKey, 'Corrupted keyring: Missing private key');\n const keyPair: CryptoKeyPair = {\n publicKey: await subtleCrypto.importKey(\n 'raw',\n record.publicKey,\n {\n name: 'ECDSA',\n namedCurve: 'P-256',\n },\n true,\n ['verify'],\n ),\n privateKey: await subtleCrypto.importKey(\n 'pkcs8',\n record.privateKey,\n {\n name: 'ECDSA',\n namedCurve: 'P-256',\n },\n true,\n ['sign'],\n ),\n };\n\n this._keyCache.set(publicKey, keyPair);\n }\n\n return this._keyCache.get(key)!; // TODO(burdon): Fail if null?\n }\n\n @synchronized\n private async _setKey(keyPair: CryptoKeyPair): Promise<void> {\n const publicKey = await keyPairToPublicKey(keyPair);\n this._keyCache.set(publicKey, keyPair);\n\n const record: KeyRecord = {\n publicKey: publicKey.asUint8Array(),\n privateKey: new Uint8Array(await subtleCrypto.exportKey('pkcs8', keyPair.privateKey)),\n };\n\n const file = this._storage.getOrCreateFile(publicKey.toHex());\n await file.write(0, arrayToBuffer(KeyRecord.encode(record)));\n await file.close();\n await file.flush?.();\n this.keysUpdate.emit();\n }\n\n // TODO(burdon): ???\n deleteKey(key: PublicKey): Promise<void> {\n return todo('We need a method to delete a file.');\n }\n\n async list(): Promise<KeyRecord[]> {\n const keys: KeyRecord[] = [];\n for (const path of await this._storage.list()) {\n const fileName = path.split('/').pop(); // get last portion of the path\n invariant(fileName, 'Invalid file name');\n keys.push({ publicKey: PublicKey.fromHex(fileName).asUint8Array() });\n }\n return keys;\n }\n\n async importKeyPair(keyPair: CryptoKeyPair): Promise<PublicKey> {\n await this._setKey(keyPair);\n return keyPairToPublicKey(keyPair);\n }\n}\n\nconst keyPairToPublicKey = async (keyPair: CryptoKeyPair): Promise<PublicKey> => {\n return PublicKey.from(new Uint8Array(await subtleCrypto.exportKey('raw', keyPair.publicKey)));\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { subtleCrypto } from '@dxos/crypto';\n\nexport type TestKeyPair = {\n privateKey: JsonWebKey;\n publicKey: JsonWebKey;\n publicKeyHex: string;\n};\n\n/**\n * Generate a key pair which for testing purposes.\n * @returns {Promise<TestKeyPair>}\n */\nexport const generateJWKKeyPair = async (): Promise<TestKeyPair> => {\n const keyPair = await subtleCrypto.generateKey(\n {\n name: 'ECDSA',\n namedCurve: 'P-256',\n },\n true,\n ['sign', 'verify'],\n );\n\n const privateKeyExported = await subtleCrypto.exportKey('jwk', keyPair.privateKey);\n const publicKeyExported = await subtleCrypto.exportKey('jwk', keyPair.publicKey);\n\n // Convert the public key to hex format\n const publicKeyBuffer = new Uint8Array(await subtleCrypto.exportKey('raw', keyPair.publicKey));\n const publicKeyHex = Array.from(publicKeyBuffer)\n .map((byte) => byte.toString(16).padStart(2, '0'))\n .join('');\n\n return {\n privateKey: privateKeyExported,\n publicKey: publicKeyExported,\n publicKeyHex,\n };\n};\n\n/**\n * Parse a key pair from JWK format.\n */\nexport const parseJWKKeyPair = async (privateKey: JsonWebKey, publicKey: JsonWebKey): Promise<CryptoKeyPair> => {\n return {\n privateKey: await subtleCrypto.importKey('jwk', privateKey, { name: 'ECDSA', namedCurve: 'P-256' }, true, ['sign']),\n publicKey: await subtleCrypto.importKey('jwk', publicKey, { name: 'ECDSA', namedCurve: 'P-256' }, true, ['verify']),\n };\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAoC;AAEpC,oBAA0C;AAC1C,mBAAqB;AACrB,uBAA0B;AAC1B,kBAA0B;AAC1B,mBAAuB;AAEvB,mCAA2D;AAC3D,kBAA0C;ACT1C,IAAAA,iBAA6B;;;;;;;;ADW7B,IAAMC,YAAmCC,oBAAOC,gBAAgB,6BAAA;AAKzD,IAAMC,UAAN,MAAMA;EAIX,YACmBC,eAAsBC,4CAAc;IACnDC,MAAMC,yCAAYC;EACpB,CAAA,EAAGC,gBAAgB,SAAA,GACnB;SAHiBL,WAAAA;SAJFM,YAAY,IAAIC,uBAAqCC,sBAAUC,IAAI;SAC3EC,aAAa,IAAIC,mBAAAA;AAOxBC,oCAAUC,4BAAc,mDAAA;;;;;;;;;EAC1B;EAEA,MAAMC,KAAKC,KAAgBC,SAA0C;AACnE,UAAMC,UAAU,MAAM,KAAKC,QAAQH,GAAAA;AAEnC,WAAO,IAAII,WACT,MAAMN,2BAAaC,KACjB;MACEM,MAAM;MACNX,MAAM;IACR,GACAQ,QAAQI,YACRL,OAAAA,CAAAA;EAGN;EAEA,MAAMM,YAAgC;AACpC,UAAML,UAAU,MAAMJ,2BAAaU,YACjC;MACEH,MAAM;MACNI,YAAY;IACd,GACA,MACA;MAAC;MAAQ;KAAS;AAGpB,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iC,UAAU,OAAO7B,QAAQsB,SAAS,CAAA;AAC5F,QAAM4B,eAAeC,MAAM5B,KAAK0B,eAAAA,EAC7BG,IAAI,CAACC,SAASA,KAAKC,SAAS,EAAA,EAAIC,SAAS,GAAG,GAAA,CAAA,EAC5CC,KAAK,EAAA;AAER,SAAO;IACLpD,YAAY2C;IACZzB,WAAW0B;IACXE;EACF;AACF;AAKO,IAAMO,kBAAkB,OAAOrD,YAAwBkB,cAAAA;AAC5D,SAAO;IACLlB,YAAY,MAAMR,eAAAA,aAAa6B,UAAU,OAAOrB,YAAY;MAAED,MAAM;MAASI,YAAY;IAAQ,GAAG,MAAM;MAAC;KAAO;IAClHe,WAAW,MAAM1B,eAAAA,aAAa6B,UAAU,OAAOH,WAAW;MAAEnB,MAAM;MAASI,YAAY;IAAQ,GAAG,MAAM;MAAC;KAAS;EACpH;AACF;",
6
- "names": ["import_crypto", "KeyRecord", "schema", "getCodecForType", "Keyring", "_storage", "createStorage", "type", "StorageType", "RAM", "createDirectory", "_keyCache", "ComplexMap", "PublicKey", "hash", "keysUpdate", "Event", "invariant", "subtleCrypto", "sign", "key", "message", "keyPair", "_getKey", "Uint8Array", "name", "privateKey", "createKey", "generateKey", "namedCurve", "_setKey", "keyPairToPublicKey", "has", "file", "getOrCreateFile", "toHex", "size", "stat", "Error", "recordBytes", "read", "close", "record", "decode", "publicKey", "from", "equals", "importKey", "set", "get", "asUint8Array", "exportKey", "write", "arrayToBuffer", "encode", "flush", "emit", "deleteKey", "todo", "list", "keys", "path", "fileName", "split", "pop", "push", "fromHex", "importKeyPair", "generateJWKKeyPair", "privateKeyExported", "publicKeyExported", "publicKeyBuffer", "publicKeyHex", "Array", "map", "byte", "toString", "padStart", "join", "parseJWKKeyPair"]
7
- }
@@ -1 +0,0 @@
1
- {"inputs":{"packages/core/halo/keyring/src/keyring.ts":{"bytes":16689,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/random-access-storage","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/keyring/src/testing.ts":{"bytes":5173,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/keyring/src/index.ts":{"bytes":552,"imports":[{"path":"packages/core/halo/keyring/src/keyring.ts","kind":"import-statement","original":"./keyring"},{"path":"packages/core/halo/keyring/src/testing.ts","kind":"import-statement","original":"./testing"}],"format":"esm"}},"outputs":{"packages/core/halo/keyring/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10526},"packages/core/halo/keyring/dist/lib/node/index.cjs":{"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/random-access-storage","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true}],"exports":["Keyring","generateJWKKeyPair","parseJWKKeyPair"],"entryPoint":"packages/core/halo/keyring/src/index.ts","inputs":{"packages/core/halo/keyring/src/keyring.ts":{"bytesInOutput":4920},"packages/core/halo/keyring/src/index.ts":{"bytesInOutput":0},"packages/core/halo/keyring/src/testing.ts":{"bytesInOutput":1103}},"bytes":6212}}}