# Keyring `logicsrc keyring` keeps SSH keys and other public/private key pairs (GPG, age, any generic pair) **end-to-end encrypted**. It works entirely on one machine with no account. Turn on sync and the account at app.logicsrc.com holds a copy, but only as ciphertext. You can then restore a key onto a new machine with one command. The keyring exists because private keys kept in plaintext, in a repo or a backup, are one leak away from a compromise. The keyring makes the safe path the easy one. Keys are sealed on your machine and synced as ciphertext. Restoring puts them back under their default file names with the right permissions. ## Quick start ```sh curl -fsSL https://logicsrc.com/install.sh | sh # or: logicsrc update # Import your key (and its .pub). You pick a keyring passphrase the first time # and get a one-time recovery key: store it offline. logicsrc keyring add ~/.ssh/id_ed25519 # Optional: sync the ciphertext to your account. logicsrc login logicsrc keyring sync # On a new machine: logicsrc login logicsrc keyring sync logicsrc keyring restore id_ed25519 # ~/.ssh/id_ed25519 (600) + id_ed25519.pub (644) ssh-keygen -lf ~/.ssh/id_ed25519 # compare with: logicsrc keyring show id_ed25519 ``` ## Commands | Command | What it does | | --- | --- | | `keyring init [--cloud]` | Create the keyring. Asks for a passphrase and prints a one-time recovery key. `add` and `gen` call this for you. | | `keyring add [--name n] [--pub f] [--type t] [--sync]` | Import a private key file and its `.pub`. If there is no `.pub`, the public half is derived with `ssh-keygen -y`, or read from an age identity's comment. | | `keyring gen [--type ed25519\|rsa\|ecdsa]` | Generate a pair straight into the keyring. Nothing is written to `~/.ssh` until you `restore`. | | `keyring list` | Name, type, fingerprint, comment. Needs no passphrase. | | `keyring show ` | Public key and fingerprint. `--print-private` also prints the private key (it asks for the passphrase). | | `keyring restore [--to dir] [--force]` | Decrypt and write the key under its **default file name**. | | `keyring export --pub [names…]` | `authorized_keys` lines (public keys only). | | `keyring rm [--sync]` | Remove a key. The removal reaches your other machines on their next sync. | | `keyring sync [--use-remote\|--use-local\|--off]` | Turn on cloud sync and exchange ciphertext with your account. | | `keyring status` | Where the keyring lives, how many keys it holds, and whether sync is on. | For non-interactive use, set `LOGICSRC_KEYRING_PASSPHRASE` or pipe the passphrase on stdin. `--recovery-key ` unlocks with the recovery key instead. (`logicsrc keys` is a different command: it manages API keys.) ### Restore rules - The private key is written `0600` and the public key `0644`. A directory created by `restore` is `0700`. - If an identical file is already there, nothing is written. - If a **different** key is already at that path, restore refuses and writes nothing. With `--force`, it copies the existing file to `.bak-