Package-level declarations

Types

Link copied to clipboard

Seals and opens the sensitive client storage records with one storage key (docs/storage-encryption.md). Storage adapters store the sealed bytes as they are; they never handle keys, formats or associated data themselves.

Link copied to clipboard

Reads the header of a sealed storage record without decrypting it, for storage key rotation (docs/storage-key-rotation.md). Only the format module knows the record layout; storage adapters use this instead.

Link copied to clipboard

A StorageKeyProvider over keys the application already holds, for example keys it loaded from its own secret store, and for tests. loadOrCreateKey returns current and never creates a key; createKey only returns a key that was passed in. removeKey forgets the key in this instance; deleting its copy is up to the application. The keys only live in memory; this class is not secure key storage.

Link copied to clipboard

Encrypted client storage cannot be read or written. Storage fails closed: an unreadable record is never reported as missing, replaced, or read as plaintext. Messages never contain key bytes, plaintext or ciphertext.

Link copied to clipboard

A 256-bit key for record-level client storage encryption, with its id.

Link copied to clipboard
value class StorageKeyId(val value: Int)

Identifies a storage encryption key. Not secret: every encrypted record carries the ID of the key that sealed it, so a future key can coexist with this one during a re-encryption (docs/storage-encryption.md).

Link copied to clipboard

Supplies storage encryption keys. Key storage is the provider's job, never the database's: a key kept next to the records it protects protects nothing. Platform providers (Android Keystore, Apple Keychain, an application secret store) implement this interface.

Functions

Link copied to clipboard

The AES-256-GCM ClientRecordCipher that seals with current and opens records of current and of every retained key, chosen by the key ID in each record. Retained keys are for storage key rotation only.