mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-26 21:50:27 +00:00
7b20ff0223
Conflicts: cw_monero/ios/Classes/monero_api.cpp ios/Podfile.lock lib/router.dart lib/src/screens/restore/wallet_restore_from_seed_form.dart lib/src/screens/restore/wallet_restore_page.dart lib/store/settings_store.dart lib/view_model/wallet_new_vm.dart scripts/android/app_env.sh tool/configure.dart
21 lines
716 B
Dart
21 lines
716 B
Dart
import 'package:cake_wallet/core/secure_storage.dart';
|
|
import 'package:cw_core/cake_hive.dart';
|
|
|
|
Future<List<int>> getEncryptionKey(
|
|
{required String forKey, required SecureStorage secureStorage}) async {
|
|
final stringifiedKey =
|
|
await secureStorage.read(key: 'transactionDescriptionsBoxKey');
|
|
List<int> key;
|
|
|
|
if (stringifiedKey == null) {
|
|
key = CakeHive.generateSecureKey();
|
|
final keyStringified = key.join(',');
|
|
String storageKey = 'transactionDescriptionsBoxKey';
|
|
await secureStorage.delete(key: storageKey);
|
|
await secureStorage.write(key: storageKey, value: keyStringified);
|
|
} else {
|
|
key = stringifiedKey.split(',').map((i) => int.parse(i)).toList();
|
|
}
|
|
|
|
return key;
|
|
}
|