Package-level declarations

Types

Link copied to clipboard
class EncryptedPreferencesSerializer(cipher: Cipher, options: EncryptedStoreOptions = EncryptedStoreOptions()) : OkioSerializer<Preferences>

AEAD-encrypted OkioSerializer for AndroidX Preferences using the SVBLENC1 v1 envelope.

Link copied to clipboard
class EncryptedProtoSerializer<T : Any>(inner: ProtoOkioSerializer<T>, cipher: Cipher, options: EncryptedStoreOptions = EncryptedStoreOptions()) : OkioSerializer<T>

AEAD-encrypted OkioSerializer wrapping ProtoOkioSerializer with the SVBLENC1 v1 envelope.

Link copied to clipboard

Options for encrypted DataStore serializers (EncryptedProtoSerializer and EncryptedPreferencesSerializer).

Link copied to clipboard

Default on-disk locations for StoreLocator.Platform / file-backed factories from commonMain.

Link copied to clipboard
class ProtoOkioSerializer<T : Any>(kSerializer: KSerializer<T>, val defaultValue: T) : OkioSerializer<T>

Unencrypted OkioSerializer backed by kotlinx-serialization-protobuf ProtoBuf.

Link copied to clipboard
sealed interface StoreLocator

Where a KryptoStore androidx.datastore.core.DataStore persists.

Properties

Link copied to clipboard

Application filesDir root set by kryptostore-android KryptostoreAndroid.initialize. Public so the android-delegates artifact can install without sharing internal across modules.

Link copied to clipboard
val kryptostoreFileSystem: FileSystem?

Platform Okio FileSystem for quarantine / file-backed stores; null on web.

Functions

Link copied to clipboard

Applies this locator's logical store name (for StoreLocator.Platform and StoreLocator.Named) to options via EncryptedStoreOptions.applyDefaultStoreName so AAD derivation is identical across file and web targets when EncryptedStoreOptions.storeName is left at its default.

Link copied to clipboard
fun deriveStoreAssociatedData(storeName: String, schemaVersion: Int): ByteArray

Derives canonical UTF-8 AEAD associated data ("$storeName|v$schemaVersion").

Link copied to clipboard
fun <T> failClosedCorruptionHandler(producePath: () -> Path, fileSystem: () -> FileSystem? = { kryptostoreFileSystem }): ReplaceFileCorruptionHandler<T>

Fail-closed corruption handler: quarantine the unreadable file as *.corrupt and rethrow. Defaults are never written automatically — recovery requires an explicit user action.

Link copied to clipboard

Installs the Android application files directory used by KryptostorePaths.file.

Link copied to clipboard
fun requireKryptostoreFileSystem(fileSystem: FileSystem? = kryptostoreFileSystem): FileSystem

Resolves the platform FileSystem or fails closed with the shared web-routing message. Accepts an override so JVM tests can exercise the null branch without JS Kover merge.

Link copied to clipboard
fun <R> StoreLocator.resolve(onFile: (producePath: () -> Path) -> R, onNamed: (name: String) -> R): R

Resolves this locator to a file path or web name for the current target.

fun <R> StoreLocator.resolve(usesFileStorage: Boolean, onFile: (producePath: () -> Path) -> R, onNamed: (name: String) -> R): R

Same as resolve with an explicit usesFileStorage override (tests / tooling).