CLASS

StorageBuilder.Keychain

Contents

public final class Keychain

Builds the SDK's built-in keychain-backed Storage.

The default, StorageBuilder.Keychain().build(), reproduces the behaviour of previous SDK versions (an app-private keychain). Supplying an accessGroup shares the stored credentials with same-team targets that declare the same Keychain Sharing access group (for example an app and its extension).

Named Keychain (not KeychainStorage) to avoid colliding with the KeychainStorage: Storage implementation, which is internal and reachable only through this builder.

Methods

init()

public init()

Creates a builder with the defaults: app-private keychain, afterFirstUnlockThisDeviceOnly.

accessGroup(_:)

public func accessGroup(_ accessGroup: String?) -> Keychain

The Keychain Sharing access group to store items in, or nil (the default) for the app-private keychain.

accessibility(_:)

public func accessibility(_ accessibility: KeychainAccessibility) -> Keychain

The data-protection level applied to new items. Defaults to .afterFirstUnlockThisDeviceOnly.

build()

public func build() -> Storage

Builds the configured keychain-backed Storage (with the legacy access-control-on-read migration).