Skip to content
Snippets Groups Projects
Commit a4425131 authored by Taras's avatar Taras
Browse files

get/store BSspeke private key in ssss

parent 9d601604
No related branches found
No related tags found
No related merge requests found
......@@ -149,4 +149,10 @@ interface SharedSecretStorageService {
privateKey: ByteArray,
keySigner: KeySigner
): SsssKeyCreationInfo
//Added for Circles
fun storeBsSpekePrivateKey(keyBytes: ByteArray, keyId: String)
//Added for Circles
fun getBsSpekePrivateKey(keyId: String): ByteArray?
}
......@@ -42,6 +42,7 @@ import org.matrix.android.sdk.api.session.securestorage.SsssKeySpec
import org.matrix.android.sdk.api.session.securestorage.SsssPassphrase
import org.matrix.android.sdk.api.util.fromBase64
import org.matrix.android.sdk.api.util.toBase64NoPadding
import org.matrix.android.sdk.internal.crypto.CirclesKeystoreProvider
import org.matrix.android.sdk.internal.crypto.SecretShareManager
import org.matrix.android.sdk.internal.crypto.keysbackup.generatePrivateKeyWithPassword
import org.matrix.android.sdk.internal.crypto.tools.HkdfSha256
......@@ -61,7 +62,8 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
private val accountDataService: SessionAccountDataService,
private val secretShareManager: SecretShareManager,
private val coroutineDispatchers: MatrixCoroutineDispatchers,
private val cryptoCoroutineScope: CoroutineScope
private val cryptoCoroutineScope: CoroutineScope,
private val circlesKeystoreProvider: CirclesKeystoreProvider
) : SharedSecretStorageService {
override suspend fun generateKey(
......@@ -426,4 +428,12 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
)
}
}
//Added for Circles
override fun storeBsSpekePrivateKey(keyBytes: ByteArray, keyId: String) {
circlesKeystoreProvider.storeBsSpekePrivateKey(keyBytes, keyId)
}
//Added for Circles
override fun getBsSpekePrivateKey(keyId: String): ByteArray? = circlesKeystoreProvider.getBsSpekePrivateKey(keyId)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment