tynd updater keygen
tynd updater keygen # generic pair: tynd-updater.{key,pub}tynd updater keygen --out release/updater.key # generic pair: release/updater.{key,pub}tynd updater keygen --app-id # app-scoped key for bundle.identifiertynd updater keygen --app-id com.example.myapp --no-config-editGenerates an Ed25519 keypair for signing auto-updater artifacts. Runs entirely in native Rust with operating-system randomness and ed25519-dalek — no OpenSSL or external signing tool is needed.
The command has two modes:
- Generic pair (no
--app-id): writes the private key (defaulttynd-updater.key, the default oftynd updater sign --key) and the public key next to it with a.pubextension, and leaves the config alone. - App-scoped key (
--app-id [ID]): writes one private key, by default~/.tynd/keys/<app-id>.key, prints its public key, and adds it to the project config. Without a value, the id is the config’sbundle.identifier.
| Flag | Default | Effect |
|---|---|---|
--app-id [ID] |
off | Generate the app-scoped key of this app id; bundle.identifier when no value is given |
-o, --out <path> |
tynd-updater.key / ~/.tynd/keys/<app-id>.key |
Private-key path in both modes; the generic pair writes its public key to the same path with a .pub extension |
--no-config-edit |
false | App-scoped only: do not add the public key to config |
--cwd <dir> |
. |
Project root, used by the app-scoped mode |
-f, --force |
false | Replace existing key files; the old private key is backed up first |
There is no confirmation/--yes flag.
Output
Section titled “Output”tynd-updater.key/<app-id>.key(or the--outpath) — binary Ed25519 PKCS#8 private key, written with mode0600on Unix. When it lands inside a git work tree and no.gitignoreline covers it, keygen prints a warning;tynd initadds*.keyto.gitignore.<name>.pub(generic pair only) — raw 32-byte public key (base64). The app-scoped mode prints the public key instead of writing a.pubfile.
With --app-id and without --no-config-edit, the command adds updater.publicKeys to the project config. It writes no endpoints: when the config names none, the command prints a reminder to set updater.endpoints to the URL of your update manifest, as the config does not validate without it. An existing publicKeys list is preserved; on rotation (--force over an existing key) the new public key is appended to it. The edit supports every documented format: .ts, .mts, .cts, .js, .mjs, .cjs, .json, .jsonc, .toml, .yaml, and .yml. Dynamic script objects fail closed and require a manual edit.
What can go wrong
Section titled “What can go wrong”--app-id has no value and config has no bundle.identifier: pass the id explicitly or setbundle.identifier.--no-config-editwithout--app-idis rejected.- Existing key files are not overwritten without
--force.
Workflow (generic pair)
Section titled “Workflow (generic pair)”Generate once
Section titled “Generate once”tynd updater keygen --out release/updater.keyCommit only the pub
Section titled “Commit only the pub”echo "*.key" >> .gitignoregit add release/updater.pubPut the pubkey in the config
Section titled “Put the pubkey in the config”Copy the content of release/updater.pub into updater.publicKeys. The host verifies signatures only with the keys of the backend-configured updater block; a key passed from the renderer is ignored.
export default { updater: { endpoints: ["https://releases.example.com/manifest.json"], publicKeys: ["cFpG...RVDv/RQ="], },};tynd updater keygen --app-id does this edit for you.
For each release, sign the artifact
Section titled “For each release, sign the artifact”tynd updater sign release/win32-x64/MyApp-1.2.3-setup.exe \ --key release/updater.key \ --out release/win32-x64/MyApp-1.2.3-setup.exe.sigPublish signature + manifest
Section titled “Publish signature + manifest”Upload the .sig alongside each artifact. Reference in the update manifest’s signature field.
Rotating the key
Section titled “Rotating the key”Ed25519 keys don’t expire, but if compromised:
- Generate a new keypair. With
tynd updater keygen --app-id --force, the old private key is renamed to<app-id>.bak-<unix-seconds>.keynext to it and the new public key is appended toupdater.publicKeys, keeping the old one so already-installed apps still verify updates. The generic pair backs up its private key the same way, but you editpublicKeysyourself. - Ship an update signed with the old key whose
updater.publicKeyslists both keys. - After that update rolls out, sign future updates only with the new key.
Users who never install that update keep trusting only the old key — there’s no remote revocation.
Related
Section titled “Related”tynd updater sign— sign files with the generated key.tynd updater publish- updater API — runtime verification.
- Auto-Updates guide.