Improve detection of configure PIN code.
This commit is contained in:
parent
2f45ca8835
commit
61374bca4e
13 changed files with 77 additions and 44 deletions
|
|
@ -13,3 +13,7 @@ plugins {
|
|||
android {
|
||||
namespace = "io.element.android.libraries.cryptography.api"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.coroutines.core)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue