mirror of
https://github.com/AOSSIE-Org/OpenPeerChat-flutter.git
synced 2025-08-16 11:57:48 +08:00
22 lines
582 B
Dart
22 lines
582 B
Dart
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
|
|
|
class KeyStorage {
|
|
final _storage = const FlutterSecureStorage();
|
|
|
|
Future<void> savePrivateKey(String privateKey) async {
|
|
await _storage.write(key: 'privateKey', value: privateKey);
|
|
}
|
|
|
|
Future<String?> getPrivateKey() async {
|
|
return await _storage.read(key: 'privateKey');
|
|
}
|
|
|
|
Future<void> savePublicKey(String publicKey) async {
|
|
await _storage.write(key: 'publicKey', value: publicKey);
|
|
}
|
|
|
|
Future<String?> getPublicKey() async {
|
|
return await _storage.read(key: 'publicKey');
|
|
}
|
|
}
|