BlockStoreBackupStorage

Google Block Store implementation of BackupStorage.

Block Store provides encrypted device-to-device credential transfer via Google Play Services. Data is E2E encrypted on API 29+ when the user has a screen lock configured.

Privacy: our blob is ALREADY encrypted with AES-256-GCM (PRF-derived key) before being stored. Block Store's E2E encryption is an additional layer. Even if Block Store's encryption is compromised, the inner layer protects the seed.

Limits: 4KB per entry, up to 16 entries. Our blob is 525 bytes — well within.

Constructors

Link copied to clipboard
constructor(context: Context)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun delete()

Delete the stored backup.

Link copied to clipboard
open suspend override fun isAvailable(): Boolean

Whether the storage backend is available on this device.

Link copied to clipboard
open suspend override fun retrieve(): ByteArray?

Retrieve the stored encrypted blob, or null if no backup exists.

Link copied to clipboard
open suspend override fun store(encryptedBlob: ByteArray)

Store an encrypted blob. Overwrites any existing backup.