Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
743df280bc
commit
8833fd82eb
16
README.md
16
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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user