2021-01-13 16:43:34 +00:00
|
|
|
enum SecretStoreKey { moneroWalletPassword, pinCodePassword, backupPassword }
|
2020-01-04 19:31:52 +00:00
|
|
|
|
|
|
|
const moneroWalletPassword = "MONERO_WALLET_PASSWORD";
|
|
|
|
const pinCodePassword = "PIN_CODE_PASSWORD";
|
2021-01-13 16:43:34 +00:00
|
|
|
const backupPassword = "BACKUP_CODE_PASSWORD";
|
2020-01-04 19:31:52 +00:00
|
|
|
|
2021-01-13 16:43:34 +00:00
|
|
|
String generateStoreKeyFor({
|
2022-10-12 17:09:57 +00:00
|
|
|
required SecretStoreKey key,
|
2021-01-13 16:43:34 +00:00
|
|
|
String walletName = "",
|
|
|
|
}) {
|
2020-01-04 19:31:52 +00:00
|
|
|
var _key = "";
|
|
|
|
|
|
|
|
switch (key) {
|
|
|
|
case SecretStoreKey.moneroWalletPassword:
|
|
|
|
{
|
|
|
|
_key = moneroWalletPassword + "_" + walletName.toUpperCase();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SecretStoreKey.pinCodePassword:
|
|
|
|
{
|
|
|
|
_key = pinCodePassword;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2021-01-13 16:43:34 +00:00
|
|
|
case SecretStoreKey.backupPassword:
|
|
|
|
{
|
|
|
|
_key = backupPassword;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2020-01-04 19:31:52 +00:00
|
|
|
default:
|
|
|
|
{}
|
|
|
|
}
|
|
|
|
|
|
|
|
return _key;
|
2021-01-13 16:43:34 +00:00
|
|
|
}
|