Skip to content

Commit 583bc3c

Browse files
committed
Implement key versioning for secure storage; add KeyVersionRegistry and update related components
1 parent f34b123 commit 583bc3c

11 files changed

Lines changed: 458 additions & 166 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
### Notes
1717

18-
* Native rotation currently ships a stub implementation that returns `version: 1` and `reEncryptedCount: 0`. The full Secure Enclave envelope / versioned Keystore alias hardening will ship in a follow-up RC — the JS surface is stable so apps can wire up UI ahead of time.
18+
* **iOS rotation** updates the Keychain metadata via `SecItemUpdate`, preserving the original access-control attributes while bumping `keyVersion`.
19+
* **Android rotation** mints a fresh per-entry Keystore alias (`SensitiveInfo_<hash>_v<version>`) during lazy or eager re-encryption and deletes the stale alias after a successful rewrite.
20+
* Version state lives in a non-secret registry (`SharedPreferences` on Android, `UserDefaults` on iOS). Delete the app's data to reset.
1921

2022
## [6.0.0-rc.12](https://github.com/mcodex/react-native-sensitive-info/compare/v6.0.0-rc.11...v6.0.0-rc.12) (2025-12-16)
2123

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ function RotationButton() {
309309
| Master key | Android Keystore (`AES/GCM`, StrongBox when available) | Secure Enclave-gated (P-256) + AES-GCM |
310310
| Authentication | BiometricPrompt (Class 3 preferred), device credential fallback | LAContext / Face ID / Touch ID / Optic ID |
311311
| At-rest integrity | AES-GCM authentication tag | AES-GCM authentication tag |
312-
| Key rotation | Versioned Keystore aliases, lazy re-encryption | Versioned KEKs, lazy re-wrap |
312+
| Key rotation | Versioned Keystore aliases, lazy re-encryption | Versioned Keychain metadata, lazy re-wrap (preserves original access control) |
313313
| Error classification | Typed `SensitiveInfoError` subclasses via `/errors` subpath | Same |
314314

315315
Typed errors can be imported from the `/errors` subpath for tree-shakeable error handling:

0 commit comments

Comments
 (0)