Improve detection of configure PIN code.

This commit is contained in:
Benoit Marty 2026-05-05 18:24:25 +02:00 committed by Benoit Marty
parent 2f45ca8835
commit 61374bca4e
13 changed files with 77 additions and 44 deletions

View file

@ -13,3 +13,7 @@ plugins {
android {
namespace = "io.element.android.libraries.cryptography.api"
}
dependencies {
implementation(libs.coroutines.core)
}

View file

@ -8,6 +8,7 @@
package io.element.android.libraries.cryptography.api
import kotlinx.coroutines.flow.Flow
import javax.crypto.SecretKey
/**
@ -15,16 +16,18 @@ import javax.crypto.SecretKey
* Implementation should be able to store the generated key securely.
*/
interface SecretKeyRepository {
fun hasKey(alias: String): Flow<Boolean>
/**
* Get or create a secret key for a given alias.
* @param alias the alias to use
* @param requiresUserAuthentication true if the key should be protected by user authentication
*/
fun getOrCreateKey(alias: String, requiresUserAuthentication: Boolean): SecretKey
suspend fun getOrCreateKey(alias: String, requiresUserAuthentication: Boolean): SecretKey
/**
* Delete the secret key for a given alias.
* @param alias the alias to use
*/
fun deleteKey(alias: String)
suspend fun deleteKey(alias: String)
}