Docs README
Summary: - Docs: README Stats: - 1 file changed, 16 insertions(+)
This commit is contained in:
parent
71ef9da223
commit
32de45f7ad
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
|
- **FileDirectory** - documents, caches, custom URL
|
||||||
- **StorageError** - Comprehensive error types
|
- **StorageError** - Comprehensive error types
|
||||||
- **StorageKeyDescriptor** - Audit snapshot of a key’s storage metadata
|
- **StorageKeyDescriptor** - Audit snapshot of a key’s storage metadata
|
||||||
|
- **EncryptionConfiguration** - Global encryption settings (Keychain identifiers, key length)
|
||||||
- **AnyStorageKey** - Type-erased storage key for catalogs
|
- **AnyStorageKey** - Type-erased storage key for catalogs
|
||||||
- **AnyCodable** - Type-erased Codable for mixed-type payloads
|
- **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)
|
- Default security policy: `SecurityPolicy.recommended` (ChaCha20-Poly1305 + HKDF)
|
||||||
- External key material providers can be registered via `StorageRouter`
|
- 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
|
```swift
|
||||||
struct RemoteKeyProvider: KeyMaterialProviding {
|
struct RemoteKeyProvider: KeyMaterialProviding {
|
||||||
func keyMaterial(for keyName: String) async throws -> Data {
|
func keyMaterial(for keyName: String) async throws -> Data {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user