EncryptedPreferencesSerializer

class EncryptedPreferencesSerializer(cipher: Cipher, options: EncryptedStoreOptions = EncryptedStoreOptions()) : OkioSerializer<Preferences>

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

Fails closed with CorruptionException on unencrypted payloads unless EncryptedStoreOptions.allowPlaintextRead is explicitly enabled for migration.

Constructors

Link copied to clipboard
constructor(cipher: Cipher, options: EncryptedStoreOptions = EncryptedStoreOptions())
constructor(cipher: Cipher, associatedData: ByteArray, legacyAssociatedData: ByteArray? = null, allowPlaintextRead: Boolean = false)

Properties

Link copied to clipboard
open override val defaultValue: Preferences

Functions

Link copied to clipboard
open suspend override fun readFrom(source: BufferedSource): Preferences
Link copied to clipboard
open suspend override fun writeTo(t: Preferences, sink: BufferedSink)