Skip to content

feat(android): add Keystore-backed device pairing credential storage - #308

Merged
turinglambdaai merged 6 commits into
mainfrom
feature/android-keystore-pairing-store
Oct 23, 2026
Merged

turinglambdaai merged 6 commits into
mainfrom
feature/android-keystore-pairing-store

Conversation

@turinglambdaai

Copy link
Copy Markdown
Owner

Scope

  • New AndroidKeystorePairingStore in the SDK-backed Android adapter implements the RVD1 credential persistence gate, plus load/remove/list without exposing credential data in the list.
  • Create a per-application AndroidKeyStore AES-256-GCM key and encrypt the credential + server SPKI pin as a fixed-size versioned envelope bound by GCM AAD to application ID and device UUID.
  • Existing credentials cannot silently be overwritten, unknown records do not create a key, encrypted SharedPreferences writes/removal use synchronous commit(), and corrupted or backup-restored ciphertext fails closed.
  • Portable JVM crypto-envelope tests cover tampering, wrong app/device/key, malformed versions/lengths and defensive secret copies. The Android SDK build checks the platform adapter.

Security/release boundaries

Product must exclude the private preference file from backup, handle device-side explicit pairing consent, provide UI and revocation; this PR does not claim hardware-backed key availability on every model, mobile release readiness, or real-device pairing evidence.

Validation

Full CI is required prior to merge; this PR is a draft until tests complete. Independent of #306 and #307. Base 1248a90cdf347edfb44731ff7c8f69c94df96d59.

…nomy

A corrupted or removed AndroidKeyStore threw raw IOException or
GeneralSecurityException out of loadPairing/savePairingCredential while
the rest of the store reports IllegalStateException, so callers had to
know Keystore internals to fail closed. Key access now translates those
into the same unavailable-key error, and the class doc states the real
invariant: one key per application ID, per-device binding via AES-GCM
AAD. The plan's M3 handoff records the storage evidence it was missing.
@turinglambdaai
turinglambdaai marked this pull request as ready for review October 22, 2026 15:50
@turinglambdaai
turinglambdaai merged commit 8c6bc26 into main Oct 23, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant