Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
cov/c3 ▾

Modern-Apps.git / library / e2ee-p2p / src / main / java / com / vayunmathur / e2ee / E2eeKeyStore.kt

E2eeKeyStore.kt14 lines · 628 BRaw
1package com.vayunmathur.e2ee
2
3/**
4 * Minimal persistence abstraction used by [PqcIdentity] to store the device keypair. Apps adapt
5 * their own secure storage (e.g. an encrypted DataStore) to this interface so the e2ee module stays
6 * decoupled from any particular storage implementation.
7 */
8interface E2eeKeyStore {
9 /** Returns the stored bytes for [name], or null if absent. */
10 suspend fun getBytes(name: String): ByteArray?
11
12 /** Persists [value] under [name]. When [onlyIfAbsent], an existing value is not overwritten. */
13 suspend fun setBytes(name: String, value: ByteArray, onlyIfAbsent: Boolean = false)
14}