@smartledger/keys 1.0.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/LICENSE +23 -0
- package/README.md +492 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +60 -0
- package/dist/browser.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/lumen-keys.js +5203 -0
- package/dist/lumen-keys.js.map +7 -0
- package/dist/lumen-keys.min.js +11 -0
- package/dist/lumen-keys.min.js.map +7 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/sdk.js +190 -0
- package/dist/sdk.js.map +1 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,WAAW,EACX,sBAAsB,EAEtB,aAAa,EAEd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,MAAM,EACN,SAAS,EACT,gBAAgB,EAEjB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,WAAW,EAAE,WAAW,CAAC;IAEzB,wCAAwC;IACxC,aAAa,EAAE,sBAAsB,CAAC;CACvC;AAED;;;;GAIG;AACH,qBAAa,aAAc,YAAW,MAAM;IAC1C,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,aAAa,CAAyB;IAC9C,OAAO,CAAC,UAAU,CAA6B;gBAEnC,MAAM,EAAE,YAAY;IAKhC;;OAEG;IACG,SAAS,CACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,EACtB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,SAAS,CAAC;IA4BrB;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAatD;;OAEG;IACG,WAAW,CACf,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,UAAU,CAAC;IAsBtB;;OAEG;IACG,eAAe,CACnB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,UAAU,GACpB,OAAO,CAAC,OAAO,CAAC;IAoBnB;;OAEG;IACG,gBAAgB,CACpB,OAAO,EAAE,MAAM,EACf,UAAU,GAAE,OAAc,GACzB,OAAO,CAAC,SAAS,EAAE,CAAC;IAwBvB;;OAEG;IACG,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAkB5E;;OAEG;IACG,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IA8B5D;;OAEG;IACG,cAAc,CAClB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,EACtB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,SAAS,CAAC;IAgBrB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAOxB;;OAEG;IACH,OAAO,CAAC,cAAc;CAMvB"}
|
package/dist/sdk.js
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Default implementation of KeySDK.
|
|
4
|
+
*
|
|
5
|
+
* Integrates KeyRegistry and SignatureSuiteRegistry to provide
|
|
6
|
+
* a clean, high-level API for key operations.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DefaultKeySDK = void 0;
|
|
10
|
+
const crypto_1 = require("@smartledger/crypto");
|
|
11
|
+
/**
|
|
12
|
+
* Default KeySDK implementation.
|
|
13
|
+
*
|
|
14
|
+
* Provides a simple, safe API for key operations while hiding complexity.
|
|
15
|
+
*/
|
|
16
|
+
class DefaultKeySDK {
|
|
17
|
+
constructor(config) {
|
|
18
|
+
this.keyCounter = new Map(); // agentId -> counter
|
|
19
|
+
this.keyRegistry = config.keyRegistry;
|
|
20
|
+
this.suiteRegistry = config.suiteRegistry;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create a new key for an agent.
|
|
24
|
+
*/
|
|
25
|
+
async createKey(agentId, profile, options = {}) {
|
|
26
|
+
// Generate key for primary suite
|
|
27
|
+
const suite = this.suiteRegistry.getSuite(profile.primarySignatureSuite);
|
|
28
|
+
const keypair = await suite.generateKeypair();
|
|
29
|
+
// Generate unique keyId
|
|
30
|
+
const counter = this.getNextCounter(agentId);
|
|
31
|
+
const suiteName = profile.primarySignatureSuite.split('-')[0]; // 'ml-dsa' or 'bsv'
|
|
32
|
+
const keyId = `${agentId}:pk-${suiteName}-${counter}`;
|
|
33
|
+
// Register key
|
|
34
|
+
const meta = await this.keyRegistry.registerKey(keyId, keypair, profile.primarySignatureSuite, {
|
|
35
|
+
expiresAt: options.expiresAt,
|
|
36
|
+
usage: options.usage || ['signing'],
|
|
37
|
+
cryptoProfileVersion: options.cryptoProfileVersion || '1.0.0',
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
meta,
|
|
41
|
+
publicKey: keypair.publicKey,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get an existing key.
|
|
46
|
+
*/
|
|
47
|
+
async getKey(keyId) {
|
|
48
|
+
const result = await this.keyRegistry.getPublicKey(keyId);
|
|
49
|
+
if (!result) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
meta: result.meta,
|
|
54
|
+
publicKey: result.publicKey,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Sign with a key (private key never exposed).
|
|
59
|
+
*/
|
|
60
|
+
async signWithKey(keyId, message) {
|
|
61
|
+
// Get full keypair (private access)
|
|
62
|
+
const result = await this.keyRegistry.getKey(keyId);
|
|
63
|
+
if (!result) {
|
|
64
|
+
throw new Error(`Key not found: ${keyId}`);
|
|
65
|
+
}
|
|
66
|
+
if (result.meta.status !== 'active') {
|
|
67
|
+
throw new Error(`Key is not active: ${keyId} (status: ${result.meta.status})`);
|
|
68
|
+
}
|
|
69
|
+
// Get suite and sign
|
|
70
|
+
const suite = this.suiteRegistry.getSuite(result.meta.suiteId);
|
|
71
|
+
// Hash the message (consistent with signAgentResponse)
|
|
72
|
+
const hashAlg = this.getHashAlgorithm(result.meta.suiteId);
|
|
73
|
+
const messageHash = await (0, crypto_1.hashBytes)(message, hashAlg);
|
|
74
|
+
return await suite.sign(result.keypair.privateKey, messageHash);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Verify a signature.
|
|
78
|
+
*/
|
|
79
|
+
async verifySignature(keyId, message, signature) {
|
|
80
|
+
const result = await this.keyRegistry.getPublicKey(keyId);
|
|
81
|
+
if (!result) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
const suite = this.suiteRegistry.getSuite(result.meta.suiteId);
|
|
85
|
+
// Hash the message
|
|
86
|
+
const hashAlg = this.getHashAlgorithm(result.meta.suiteId);
|
|
87
|
+
const messageHash = await (0, crypto_1.hashBytes)(message, hashAlg);
|
|
88
|
+
try {
|
|
89
|
+
return await suite.verify(result.publicKey, messageHash, signature);
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* List keys for an agent.
|
|
97
|
+
*/
|
|
98
|
+
async listKeysForAgent(agentId, activeOnly = true) {
|
|
99
|
+
const keys = activeOnly
|
|
100
|
+
? await this.keyRegistry.listActiveKeys()
|
|
101
|
+
: await this.keyRegistry.listKeys();
|
|
102
|
+
// Filter by agentId prefix
|
|
103
|
+
const agentKeys = keys.filter(meta => meta.keyId.startsWith(`${agentId}:`));
|
|
104
|
+
// Convert to KeyRecords
|
|
105
|
+
const records = [];
|
|
106
|
+
for (const meta of agentKeys) {
|
|
107
|
+
const result = await this.keyRegistry.getPublicKey(meta.keyId);
|
|
108
|
+
if (result) {
|
|
109
|
+
records.push({
|
|
110
|
+
meta: result.meta,
|
|
111
|
+
publicKey: result.publicKey,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return records;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Get active crypto profile for an agent.
|
|
119
|
+
*/
|
|
120
|
+
async getActiveCryptoProfile(agentId) {
|
|
121
|
+
const keys = await this.listKeysForAgent(agentId, true);
|
|
122
|
+
if (keys.length === 0) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
// Group by suite
|
|
126
|
+
const suites = new Set(keys.map(k => k.meta.suiteId));
|
|
127
|
+
const suiteArray = Array.from(suites);
|
|
128
|
+
// Assume first is primary, second is secondary
|
|
129
|
+
return {
|
|
130
|
+
primarySignatureSuite: suiteArray[0],
|
|
131
|
+
secondarySignatureSuite: suiteArray[1],
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Rotate all keys for an agent.
|
|
136
|
+
*/
|
|
137
|
+
async rotateAgentKeys(agentId) {
|
|
138
|
+
const activeKeys = await this.listKeysForAgent(agentId, true);
|
|
139
|
+
const newKeys = [];
|
|
140
|
+
for (const keyRecord of activeKeys) {
|
|
141
|
+
// Generate new keypair
|
|
142
|
+
const suite = this.suiteRegistry.getSuite(keyRecord.meta.suiteId);
|
|
143
|
+
const newKeypair = await suite.generateKeypair();
|
|
144
|
+
// Generate new keyId (increment counter)
|
|
145
|
+
const counter = this.getNextCounter(agentId);
|
|
146
|
+
const suiteName = keyRecord.meta.suiteId.split('-')[0];
|
|
147
|
+
const newKeyId = `${agentId}:pk-${suiteName}-${counter}`;
|
|
148
|
+
// Rotate
|
|
149
|
+
const newMeta = await this.keyRegistry.rotateKey(keyRecord.meta.keyId, newKeyId, newKeypair);
|
|
150
|
+
newKeys.push({
|
|
151
|
+
meta: newMeta,
|
|
152
|
+
publicKey: newKeypair.publicKey,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return newKeys;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Get or create key (idempotent).
|
|
159
|
+
*/
|
|
160
|
+
async getOrCreateKey(agentId, profile, options = {}) {
|
|
161
|
+
// Check if key exists
|
|
162
|
+
const existingKeys = await this.listKeysForAgent(agentId, true);
|
|
163
|
+
const primaryKey = existingKeys.find(k => k.meta.suiteId === profile.primarySignatureSuite);
|
|
164
|
+
if (primaryKey) {
|
|
165
|
+
return primaryKey;
|
|
166
|
+
}
|
|
167
|
+
// Create new key
|
|
168
|
+
return await this.createKey(agentId, profile, options);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Helper: Get hash algorithm for a suite.
|
|
172
|
+
*/
|
|
173
|
+
getHashAlgorithm(suiteId) {
|
|
174
|
+
if (suiteId.startsWith('ml-dsa')) {
|
|
175
|
+
return 'sha3-256';
|
|
176
|
+
}
|
|
177
|
+
return 'sha256';
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Helper: Get next counter for an agent.
|
|
181
|
+
*/
|
|
182
|
+
getNextCounter(agentId) {
|
|
183
|
+
const current = this.keyCounter.get(agentId) || 0;
|
|
184
|
+
const next = current + 1;
|
|
185
|
+
this.keyCounter.set(agentId, next);
|
|
186
|
+
return next;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
exports.DefaultKeySDK = DefaultKeySDK;
|
|
190
|
+
//# sourceMappingURL=sdk.js.map
|
package/dist/sdk.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,gDAM6B;AAmB7B;;;;GA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OAMG;IACH,gBAAgB,CACd,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,OAAO,GACnB,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAExB;;;;;;;OAOG;IACH,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAEvE;;;;;;;OAOG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAEvD;;;;;;;;;OASG;IACH,cAAc,CACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,EACtB,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,SAAS,CAAC,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,aAAa,CAAC;CAC9B"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @smartledger/keys - Key Management SDK
|
|
4
|
+
*
|
|
5
|
+
* Single source of truth for cryptographic key operations.
|
|
6
|
+
* Provides a clean API that hides complexity and ensures consistency.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@smartledger/keys",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Key management SDK for Lumen cryptographic operations",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"browser": "dist/lumen-keys.min.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"build:browser": "node build-browser.mjs",
|
|
16
|
+
"build:all": "npm run build && npm run build:browser",
|
|
17
|
+
"test": "vitest run",
|
|
18
|
+
"test:watch": "vitest",
|
|
19
|
+
"clean": "rm -rf dist",
|
|
20
|
+
"prepublishOnly": "npm run build:all && npm test"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/codenlighten/lumenkeys.git",
|
|
25
|
+
"directory": "packages/keys"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/codenlighten/lumenkeys#readme",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/codenlighten/lumenkeys/issues"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"cryptography",
|
|
33
|
+
"key-management",
|
|
34
|
+
"post-quantum",
|
|
35
|
+
"signatures"
|
|
36
|
+
],
|
|
37
|
+
"author": {
|
|
38
|
+
"name": "Gregory Ward (Codenlighten)",
|
|
39
|
+
"email": "tech@smartledger.technology",
|
|
40
|
+
"url": "https://codenlighten.org"
|
|
41
|
+
},
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@smartledger/crypto": "^1.0.1"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@noble/hashes": "^2.0.1",
|
|
48
|
+
"@smartledger/crypto": "^1.0.1",
|
|
49
|
+
"@types/node": "^20.0.0",
|
|
50
|
+
"esbuild": "^0.27.0",
|
|
51
|
+
"typescript": "^5.0.0",
|
|
52
|
+
"vitest": "^1.0.4"
|
|
53
|
+
},
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@smartledger/crypto": "^1.0.1"
|
|
59
|
+
}
|
|
60
|
+
}
|