mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-09 04:19:36 +00:00
42155c913d
Conflicts: cw_bitcoin/lib/bitcoin_wallet.dart cw_bitcoin/lib/bitcoin_wallet_service.dart cw_bitcoin/lib/electrum_wallet.dart cw_bitcoin/lib/litecoin_wallet.dart cw_bitcoin/lib/litecoin_wallet_service.dart cw_bitcoin_cash/lib/src/bitcoin_cash_wallet.dart cw_bitcoin_cash/lib/src/bitcoin_cash_wallet_service.dart cw_ethereum/lib/ethereum_wallet_service.dart cw_evm/lib/evm_chain_wallet.dart cw_evm/lib/evm_chain_wallet_service.dart cw_nano/lib/nano_wallet_service.dart cw_solana/lib/solana_wallet_service.dart lib/di.dart lib/entities/get_encryption_key.dart lib/main.dart lib/router.dart lib/view_model/wallet_new_vm.dart pubspec_base.yaml tool/configure.dart
20 lines
681 B
Dart
20 lines
681 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 writeSecureStorage(secureStorage, key: storageKey, value: keyStringified);
|
|
} else {
|
|
key = stringifiedKey.split(',').map((i) => int.parse(i)).toList();
|
|
}
|
|
|
|
return key;
|
|
}
|