cake_wallet/lib/entities/secret_store_key.dart

38 lines
738 B
Dart
Raw Normal View History

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({
SecretStoreKey key,
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
}