Files
OrbitTv/docs/SIGNING-KEY-BACKUP.md
T
pauljdandClaude Opus 5.5 947c1eb040
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 5m17s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 4m12s
Docs: signing-key backup procedure, upstairs 0.108.104 upgrade plan, next security fixes for review
No secrets in these files: public certificate facts only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 09:35:36 +00:00

3.9 KiB

Orbit TV: signing key backup and recovery

Written 8 November 2026 (audit finding U1 / S2). This file has no secrets in it: no key material and no passwords. It is safe to keep in git.

Why it matters

Android installs an update only if it's signed with the same key as the installed copy. Every Orbit build on the downstairs and upstairs TVs is signed with one key.

If that key is lost, no future build can install over them. The only way forward would be to uninstall Orbit, which wipes everything on the TV, because allowBackup is off. A new key can't be swapped in later without the old one, because key rotation needs both.

What must be backed up

Item Where it is now Secret? How to back it up
The keystore file orbit-tv/.tooling/android/debug.keystore (2,618 bytes, PKCS12, created 31 Oct 2026) Yes: holds the private key Encrypted copies only (below)
Keystore password and key password The standard Android debug-keystore defaults (both the same) Treat as secret alongside the file Password manager entry "Orbit TV signing key"
Key alias androiddebugkey No This file and the password manager entry
Encryption passphrase for the backups Chosen by Paul when the backups are made Yes Password manager only, never on the same USB stick

Public facts, for checking a recovered key (not secret)

  • Certificate DN: C=US, O=Android, CN=Android Debug
  • RSA 2048-bit, SHA256withRSA, valid 31 Oct 2026 to 23 Oct 2056
  • Certificate SHA-256: 042f963772f0b6f8b983742287f9487d7e2cfc8491676966c60297d3390558e1
  • The installed 0.108.104 APK verifies with APK Signature Scheme v2 and this same certificate.

Making the two encrypted offline backups (Paul does this, or approves it step by step)

Tools already on this PC: gpg (for AES-256 symmetric encryption) and cryptsetup.

  1. Choose a strong passphrase (5 random words or more) and save it in the password manager, together with:
    • the alias
    • the keystore password note
    • the certificate SHA-256 above
  2. Make one encrypted file. gpg asks for the passphrase itself, so it never appears on the command line:
    gpg --symmetric --cipher-algo AES256 --output ~/orbit-signing-key.p12.gpg /home/pauljd/Documents/OrbitTV/orbit-tv/.tooling/android/debug.keystore
    
  3. Backup 1: copy orbit-signing-key.p12.gpg to USB stick A. Store the stick away from the PC.
  4. Backup 2: copy the same .gpg file to a second offline place: USB stick B, or the password manager's file attachment if it encrypts end to end. Keep it somewhere other than stick A.
  5. Delete the working copy in your home folder:
    shred -u ~/orbit-signing-key.p12.gpg
    
    The original keystore stays where it is.

Checking recovery safely (do this once for each backup)

This decrypts into memory only (/dev/shm), compares, then wipes. It never writes the key to disk.

gpg --decrypt --output /dev/shm/orbit-check.p12 /media/<stick>/orbit-signing-key.p12.gpg
keytool -list -v -keystore /dev/shm/orbit-check.p12 -alias androiddebugkey | grep 'SHA256:'
shred -u /dev/shm/orbit-check.p12

Pass means the printed SHA256 matches 04:2F:96:37:72:F0:B6:F8:B9:83:74:22:87:F9:48:7D:7E:2C:FC:84:91:67:69:66:C6:02:97:D3:39:05:58:E1. keytool asks for the keystore password.

Restoring after a loss

  1. Decrypt one backup to orbit-tv/.tooling/android/debug.keystore.
  2. Run the check above against it.
  3. Build as usual. apksigner verify --print-certs on the new APK must show the SHA-256 above before installing on a TV.

Small hardening, optional and reversible

  • The keystore file is currently readable by the group (-rw-rw-r--). Make it owner-only:
    chmod 600 /home/pauljd/Documents/OrbitTV/orbit-tv/.tooling/android/debug.keystore
    
  • Later (audit S2): create a dedicated release key and rotate to it with apksigner rotate. Back it up the same way first. Both TVs need Android 9 or later; downstairs is Android 14.