From 024af6865d09d13e124e3c0bfd146bdd465f49e3 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 14 Jan 2026 13:21:26 -0600 Subject: [PATCH] Docs: update docs for README Summary: - Docs: update docs for README Stats: - 1 file changed, 16 insertions(+) --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 82a4bed..b84eda7 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ These helpers are internal implementation details used by `StorageRouter`. They - **FileDirectory** - documents, caches, custom URL - **StorageError** - Comprehensive error types - **StorageKeyDescriptor** - Audit snapshot of a key’s storage metadata +- **EncryptionConfiguration** - Global encryption settings (Keychain identifiers, key length) - **AnyStorageKey** - Type-erased storage key for catalogs - **AnyCodable** - Type-erased Codable for mixed-type payloads @@ -136,6 +137,21 @@ For app-level configuration (App Group identifiers, keychain service identifiers - Default security policy: `SecurityPolicy.recommended` (ChaCha20-Poly1305 + HKDF) - External key material providers can be registered via `StorageRouter` +#### Global Encryption Configuration + +You can customize the identifiers used for the master key in the Keychain: + +```swift +let config = EncryptionConfiguration( + masterKeyService: "com.myapp.LocalData", + masterKeyAccount: "MasterKey" +) +await StorageRouter.shared.updateEncryptionConfiguration(config) +``` + +> [!WARNING] +> Changing the `masterKeyService` or `masterKeyAccount` in an existing app will cause the app to look for the master key in a new location. Previously encrypted data will be lost. + ```swift struct RemoteKeyProvider: KeyMaterialProviding { func keyMaterial(for keyName: String) async throws -> Data {