## Certificate Rotation Runbook

PocketBoard pins the intermediate CA and root CA for pocketboard-api.onrender.com.

### When to run this runbook
  - Certificate authority announces upcoming rotation
  - New intermediate CA detected during periodic monitoring
  - After any provider migration (e.g., changing hosting provider)

### Steps
  1. Extract new SPKI hash (Figure 14.6 command, run against new cert)
  2. Add new hash to NSPinnedCAIdentities (app.config.ts)
  3. Add new hash to network-security-config.xml
  4. Keep OLD hash in place as backup (remove only after new build is live)
  5. Build and test on staging: npx eas build --profile staging
  6. Verify proxy is blocked on staging build
  7. Submit production build: npx eas build --profile production
  8. Submit to App Store and Play Console BEFORE old cert expires
  9. After new build reaches >90% of users, remove old hash

### Monitoring
  Run monthly: openssl s_client -connect pocketboard-api.onrender.com:443
  Check that intermediate CA SPKI hash matches the pinned value.
  Set a calendar reminder 60 days before any known expiry.
