Docs: update docs for README

Summary:
- Docs: update docs for README

Stats:
- 1 file changed, 16 insertions(+)
This commit is contained in:
Matt Bruce 2026-01-14 13:21:26 -06:00
parent 0fed77a68e
commit 024af6865d

View File

@ -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 keys 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 {