mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 12:09:43 +00:00
e5be737236
* bio auth mac fix * remove comment and change duration from 2 to 0 * cherry pick previous changes * workaround for secure storage bug on mac * bump version to 3.19.5 (because breez will need this version anyways) * some code cleanup * some changess didn't get saved * just documenting the issue [skip ci] * undo accidental removal + minor code cleanup * merge conflicts * Minor UI change [skip ci] --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
20 lines
751 B
Dart
20 lines
751 B
Dart
import 'package:cake_wallet/core/secure_storage.dart';
|
|
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
|
import 'package:cw_core/cake_hive.dart';
|
|
|
|
Future<List<int>> getEncryptionKey(
|
|
{required String forKey, required FlutterSecureStorage 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 writeSecureStorage(secureStorage, key: storageKey, value: keyStringified);
|
|
} else {
|
|
key = stringifiedKey.split(',').map((i) => int.parse(i)).toList();
|
|
}
|
|
|
|
return key;
|
|
}
|