EncryptedBlobStore

@Singleton
class EncryptedBlobStore @Inject constructor(context: Context) : KeyBlobStore

Encrypted on-disk storage for armored PGP key ring blobs.

Uses AndroidX EncryptedFile with AES-256-GCM and a hardware-backed MasterKey. Secret and public key material are stored as separate files under the app's private keyrings directory. Deletion overwrites the leading ciphertext bytes before unlinking as a defense-in-depth measure alongside full-disk encryption.

Constructors

Link copied to clipboard
@Inject
constructor(context: Context)

Functions

Link copied to clipboard
open override fun delete(path: String)

Securely removes the encrypted file at path.

Link copied to clipboard
open override fun read(path: String): ByteArray

Reads and decrypts key ring bytes from path.

Link copied to clipboard
open override fun write(keyId: Long, data: ByteArray): String

Writes secret key ring bytes for keyId, replacing any existing file at the target path.

Link copied to clipboard
open override fun writePublic(keyId: Long, data: ByteArray): String

Writes public key ring bytes for keyId, stored separately from the secret blob.