@bitspark/archon-cli 0.6.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/dist/src/cmd/key.d.ts +1 -0
- package/dist/src/cmd/key.js +138 -0
- package/dist/src/cmd/key.js.map +1 -0
- package/dist/src/cmd/key_store.d.ts +84 -0
- package/dist/src/cmd/key_store.js +482 -0
- package/dist/src/cmd/key_store.js.map +1 -0
- package/dist/src/cmd/keygen.d.ts +1 -0
- package/dist/src/cmd/keygen.js +114 -0
- package/dist/src/cmd/keygen.js.map +1 -0
- package/dist/src/cmd/login.d.ts +148 -0
- package/dist/src/cmd/login.js +777 -0
- package/dist/src/cmd/login.js.map +1 -0
- package/dist/src/cmd/sign.d.ts +1 -0
- package/dist/src/cmd/sign.js +51 -0
- package/dist/src/cmd/sign.js.map +1 -0
- package/dist/src/cmd/verify.d.ts +1 -0
- package/dist/src/cmd/verify.js +68 -0
- package/dist/src/cmd/verify.js.map +1 -0
- package/dist/src/cmd/version.d.ts +2 -0
- package/dist/src/cmd/version.js +16 -0
- package/dist/src/cmd/version.js.map +1 -0
- package/dist/src/io.d.ts +19 -0
- package/dist/src/io.js +65 -0
- package/dist/src/io.js.map +1 -0
- package/dist/src/keystore.d.ts +55 -0
- package/dist/src/keystore.js +204 -0
- package/dist/src/keystore.js.map +1 -0
- package/dist/src/main.d.ts +2 -0
- package/dist/src/main.js +51 -0
- package/dist/src/main.js.map +1 -0
- package/dist/src/pubrender.d.ts +5 -0
- package/dist/src/pubrender.js +30 -0
- package/dist/src/pubrender.js.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function run(args: string[]): void;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// archon key — convert between raw key bytes and the canonical key text, or between raw
|
|
2
|
+
// key/seed bytes and the standard PEM containers (PKCS#8 v1 / SPKI):
|
|
3
|
+
//
|
|
4
|
+
// archon key encode <pubkey-hex> -> prints encodeKey(bytes) to stdout
|
|
5
|
+
// archon key decode <ed25519:...> -> prints the decoded bytes as hex to stdout
|
|
6
|
+
// archon key pkcs8 encode <seed-hex> -> prints the PKCS#8 v1 PEM to stdout
|
|
7
|
+
// archon key pkcs8 decode -> reads a PEM on stdin, prints the seed hex
|
|
8
|
+
// archon key spki encode <pubkey-hex> -> prints the SPKI PEM to stdout
|
|
9
|
+
// archon key spki decode -> reads a PEM on stdin, prints the pubkey hex
|
|
10
|
+
// archon key pub [...] -> the public key of a private key
|
|
11
|
+
//
|
|
12
|
+
// Every hex input goes through the floor's typed decoders (hexbytes), so a 31-byte
|
|
13
|
+
// "public key" is refused here exactly as the library refuses it. PEM decode is total: a
|
|
14
|
+
// malformed block throws a clean error (caught by main → exit non-zero), never garbage.
|
|
15
|
+
import { decodeKey, encodeKey, getPublicKey, pkcs8PemToSeed, pubkeyFromHex, pubkeyToSpkiPem, seedFromHex, seedToPkcs8Pem, spkiPemToPubkey, toHex, } from "@bitspark/archon";
|
|
16
|
+
import { readText, takeInFlag, wantsHelp } from "../io.js";
|
|
17
|
+
import { parsePubFormat, renderPub } from "../pubrender.js";
|
|
18
|
+
import * as store from "./key_store.js";
|
|
19
|
+
const USAGE = "usage: archon key <encode <pubkey-hex>|decode <ed25519:...>|" +
|
|
20
|
+
"pkcs8 <encode <seed-hex>|decode>|spki <encode <pubkey-hex>|decode>|" +
|
|
21
|
+
"pub [--in <file>|--seed <hex>] [--format spki|text|hex]|" +
|
|
22
|
+
"add <name> [--seed <hex>|--seed-file <file>|--pkcs8 <file>]|list [--json]|" +
|
|
23
|
+
"rm <name> [--force]|default [<name>]|export <name> --reveal --out <file>>\n " +
|
|
24
|
+
"pkcs8/spki decode read a PEM block on stdin (or --in <file>); " +
|
|
25
|
+
"pub derives the public key from a private key, default --format text.\n " +
|
|
26
|
+
"add/list/rm/default/export are the password-protected seed store (ADR 0007 §A); " +
|
|
27
|
+
"keys live in $ARCHON_HOME/keys, default ~/.archon.";
|
|
28
|
+
export function run(args) {
|
|
29
|
+
if (wantsHelp(args)) {
|
|
30
|
+
process.stdout.write(`${USAGE}\n`);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const [op, ...rest] = args;
|
|
34
|
+
switch (op) {
|
|
35
|
+
// The store (ADR 0007 §A). Siblings of the codec cases below: `key encode`
|
|
36
|
+
// converts bytes it is handed, `key add` keeps a seed. Same noun, nothing else.
|
|
37
|
+
case "add":
|
|
38
|
+
store.runAdd(rest);
|
|
39
|
+
return;
|
|
40
|
+
case "list":
|
|
41
|
+
store.runList(rest);
|
|
42
|
+
return;
|
|
43
|
+
case "rm":
|
|
44
|
+
store.runRm(rest);
|
|
45
|
+
return;
|
|
46
|
+
case "default":
|
|
47
|
+
store.runDefault(rest);
|
|
48
|
+
return;
|
|
49
|
+
case "export":
|
|
50
|
+
store.runExport(rest);
|
|
51
|
+
return;
|
|
52
|
+
case "encode":
|
|
53
|
+
if (rest.length !== 1)
|
|
54
|
+
throw new Error(USAGE);
|
|
55
|
+
process.stdout.write(`${encodeKey(pubkeyFromHex(rest[0]))}\n`);
|
|
56
|
+
return;
|
|
57
|
+
case "decode":
|
|
58
|
+
if (rest.length !== 1)
|
|
59
|
+
throw new Error(USAGE);
|
|
60
|
+
process.stdout.write(`${toHex(decodeKey(rest[0]))}\n`);
|
|
61
|
+
return;
|
|
62
|
+
case "pkcs8":
|
|
63
|
+
pem(rest, "pkcs8");
|
|
64
|
+
return;
|
|
65
|
+
case "spki":
|
|
66
|
+
pem(rest, "spki");
|
|
67
|
+
return;
|
|
68
|
+
case "pub":
|
|
69
|
+
pub(rest);
|
|
70
|
+
return;
|
|
71
|
+
default:
|
|
72
|
+
throw new Error(USAGE);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// `pkcs8|spki <encode <hex>|decode>`: a 32-byte seed or public key <-> its PEM container.
|
|
76
|
+
function pem(args, container) {
|
|
77
|
+
const [op, ...rest] = args;
|
|
78
|
+
if (op === "encode" && rest.length === 1) {
|
|
79
|
+
// keycodec emits the PEM with its own single trailing newline; write verbatim.
|
|
80
|
+
process.stdout.write(container === "pkcs8" ? seedToPkcs8Pem(seedFromHex(rest[0])) : pubkeyToSpkiPem(pubkeyFromHex(rest[0])));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (op === "decode") {
|
|
84
|
+
const [extra, inFile] = takeInFlag(rest);
|
|
85
|
+
if (extra.length !== 0)
|
|
86
|
+
throw new Error(USAGE);
|
|
87
|
+
const input = readText(inFile);
|
|
88
|
+
process.stdout.write(`${toHex(container === "pkcs8" ? pkcs8PemToSeed(input) : spkiPemToPubkey(input))}\n`);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
throw new Error(USAGE);
|
|
92
|
+
}
|
|
93
|
+
// `pub [--in <file>|--seed <hex>] [--format spki|text|hex]`: derive the public key from a
|
|
94
|
+
// private key. --format is validated at parse time, so a bad format errors before any
|
|
95
|
+
// input is read.
|
|
96
|
+
function pub(args) {
|
|
97
|
+
let inFile;
|
|
98
|
+
let seedHex;
|
|
99
|
+
let fmt = "text";
|
|
100
|
+
for (let i = 0; i < args.length; i += 2) {
|
|
101
|
+
const flag = args[i];
|
|
102
|
+
if (i + 1 >= args.length)
|
|
103
|
+
throw new Error(`flag ${JSON.stringify(flag)} needs a value\n${USAGE}`);
|
|
104
|
+
const value = args[i + 1];
|
|
105
|
+
switch (flag) {
|
|
106
|
+
case "--in":
|
|
107
|
+
if (value === "")
|
|
108
|
+
throw new Error(`flag ${JSON.stringify(flag)} needs a value\n${USAGE}`);
|
|
109
|
+
inFile = value;
|
|
110
|
+
break;
|
|
111
|
+
case "--seed":
|
|
112
|
+
seedHex = value;
|
|
113
|
+
break;
|
|
114
|
+
case "--format":
|
|
115
|
+
fmt = parsePubFormat(value);
|
|
116
|
+
break;
|
|
117
|
+
default:
|
|
118
|
+
throw new Error(`unknown flag ${JSON.stringify(flag)}\n${USAGE}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (inFile !== undefined && seedHex !== undefined) {
|
|
122
|
+
throw new Error(`--in and --seed are mutually exclusive\n${USAGE}`);
|
|
123
|
+
}
|
|
124
|
+
let seed;
|
|
125
|
+
if (seedHex !== undefined) {
|
|
126
|
+
try {
|
|
127
|
+
seed = seedFromHex(seedHex);
|
|
128
|
+
}
|
|
129
|
+
catch (e) {
|
|
130
|
+
throw new Error(`--seed: ${e.message}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
seed = pkcs8PemToSeed(readText(inFile));
|
|
135
|
+
}
|
|
136
|
+
process.stdout.write(renderPub(getPublicKey(seed), fmt));
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key.js","sourceRoot":"","sources":["../../../src/cmd/key.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,qEAAqE;AACrE,EAAE;AACF,+EAA+E;AAC/E,uFAAuF;AACvF,gFAAgF;AAChF,uFAAuF;AACvF,2EAA2E;AAC3E,yFAAyF;AACzF,6EAA6E;AAC7E,EAAE;AACF,mFAAmF;AACnF,yFAAyF;AACzF,wFAAwF;AACxF,OAAO,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,cAAc,EACd,aAAa,EACb,eAAe,EACf,WAAW,EACX,cAAc,EACd,eAAe,EACf,KAAK,GACN,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAkB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,MAAM,KAAK,GACT,8DAA8D;IAC9D,qEAAqE;IACrE,0DAA0D;IAC1D,4EAA4E;IAC5E,+EAA+E;IAC/E,gEAAgE;IAChE,2EAA2E;IAC3E,kFAAkF;IACl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ACD,IAAI,IAAgB,CAAC;IACrB,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,IAAI,CAAC;YACH,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,WAAY,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export declare const USAGE: string;
|
|
2
|
+
/**
|
|
3
|
+
* Scans for `--password-fd <n>` and removes it. The password never travels in argv, so
|
|
4
|
+
* this carries a descriptor number rather than the secret.
|
|
5
|
+
*/
|
|
6
|
+
export declare function takePasswordFd(args: string[]): {
|
|
7
|
+
rest: string[];
|
|
8
|
+
fd: number | undefined;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* What a hidden prompt needs from the terminal. Injectable so the prompt PATH can be
|
|
12
|
+
* exercised by a test with no TTY — which is how the bare `require("node:fs")` this
|
|
13
|
+
* function used to reach for, inside an ESM package, would have been caught: the first
|
|
14
|
+
* interactive password prompt threw ReferenceError before reading a byte, and nothing ran
|
|
15
|
+
* the path to notice (lane A's, found while wiring `login --key`).
|
|
16
|
+
*/
|
|
17
|
+
export interface HiddenPromptIo {
|
|
18
|
+
setRawMode(raw: boolean): void;
|
|
19
|
+
/** One byte, or -1 at end of input. */
|
|
20
|
+
readByte(): number;
|
|
21
|
+
write(text: string): void;
|
|
22
|
+
}
|
|
23
|
+
/** The real terminal. The fd read is injectable too, so the byte-reading closure — the one
|
|
24
|
+
* place this file touches fd 0 — can be exercised by a test without a TTY. */
|
|
25
|
+
export declare const terminalIo: (readOne?: (into: Buffer) => number) => HiddenPromptIo;
|
|
26
|
+
/** A prompt that does not echo. Node has no rpassword, so raw mode is done by hand. */
|
|
27
|
+
export declare function promptHidden(label: string, io?: HiddenPromptIo): string;
|
|
28
|
+
/**
|
|
29
|
+
* Sources the password: --password-fd, then ARCHON_KEY_PASSWORD, then an interactive
|
|
30
|
+
* prompt. `confirm` asks twice when a key is being created, where a typo would otherwise
|
|
31
|
+
* be discovered only at the next unlock.
|
|
32
|
+
*/
|
|
33
|
+
export declare function readPassword(fd: number | undefined, confirm: boolean): string;
|
|
34
|
+
/**
|
|
35
|
+
* The store's own "is there a key called that": a validated name, then a stat — opening
|
|
36
|
+
* nothing, asking for no password. Shared by `key default <name>` and by `login`'s
|
|
37
|
+
* pre-network check, so both refuse a missing key with one wording.
|
|
38
|
+
*/
|
|
39
|
+
export declare function requireNamedKey(name: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* The ONE reader of the default pointer ($ARCHON_HOME/default), shared by `key default`
|
|
42
|
+
* and by `login`'s fallback so the two can never disagree about what "the default" is.
|
|
43
|
+
* Absent, unreadable, or present-but-empty all read as undefined — there is no default —
|
|
44
|
+
* and the caller says what that means for it.
|
|
45
|
+
*/
|
|
46
|
+
export declare function readDefaultKeyName(): string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Opens the key called `name`: the path, the file, the password — sourced the store's one
|
|
49
|
+
* way (--password-fd, then ARCHON_KEY_PASSWORD, then a prompt) — and the seal. It is the
|
|
50
|
+
* ONE unlock path, shared by `key export` and `login --key`, so no two commands can ask
|
|
51
|
+
* for a password differently.
|
|
52
|
+
*/
|
|
53
|
+
export declare function unlockNamedKey(name: string, fd: number | undefined): Uint8Array;
|
|
54
|
+
/**
|
|
55
|
+
* The one place a key is written, shared by `key add` and `keygen --store` so the two
|
|
56
|
+
* cannot drift apart. Salt and nonce are drawn HERE, in the command: the format takes them
|
|
57
|
+
* as arguments and never sources randomness, which is what makes it pinnable.
|
|
58
|
+
*/
|
|
59
|
+
export declare function sealAndWrite(path: string, seed: Uint8Array, password: string): string;
|
|
60
|
+
/** `keygen --store <name>`: the same seal path as `key add`. */
|
|
61
|
+
export declare function storeGenerated(name: string, seed: Uint8Array, fd: number | undefined): void;
|
|
62
|
+
export declare function runAdd(args: string[]): void;
|
|
63
|
+
/**
|
|
64
|
+
* Prints what each header CLAIMS. The claim is only proven at unlock, which is why this
|
|
65
|
+
* never opens a key and never asks for a password.
|
|
66
|
+
*/
|
|
67
|
+
export declare function runList(args: string[]): void;
|
|
68
|
+
/**
|
|
69
|
+
* Removes a key and says exactly what it removed, from where, and what it does NOT speak
|
|
70
|
+
* for. An unparsable file is refused unless --force: deleting an unrecognised file inside
|
|
71
|
+
* the store silently is what this rule exists to prevent.
|
|
72
|
+
*/
|
|
73
|
+
export declare function runRm(args: string[]): void;
|
|
74
|
+
/**
|
|
75
|
+
* Sets or shows the default key. Selection is by NAME, never by principal text
|
|
76
|
+
* (ADR 0007 §A). The pointer lives beside keys/, not in it, so it can never collide with
|
|
77
|
+
* a key name.
|
|
78
|
+
*/
|
|
79
|
+
export declare function runDefault(args: string[]): void;
|
|
80
|
+
/**
|
|
81
|
+
* Writes the seed out. Refuses without --reveal, and refuses stdout unless `--out -` says
|
|
82
|
+
* so: a seed should never land in a pipe by accident.
|
|
83
|
+
*/
|
|
84
|
+
export declare function runExport(args: string[]): void;
|