27 lines
812 B
Dart
27 lines
812 B
Dart
import 'package:boardgames_app/models/store.dart';
|
|
import 'package:boardgames_app/utils/crypto.dart';
|
|
import 'package:pointycastle/export.dart';
|
|
|
|
class GameUser with WithState {
|
|
late final List<int> _privateKey;
|
|
late final List<int> _publicKey;
|
|
|
|
GameUser() {
|
|
state.storage.getItem("privateKey");
|
|
}
|
|
|
|
generateKeys() {
|
|
// TODO: User will be identifiable by key pair and for others to identify that message came from user each message must be signed
|
|
// User must hold a list of trusted users (persistent contacts? temporary game session users? or both?)
|
|
final pair = generateRSAkeyPair(getSecureRandom());
|
|
print(pair.publicKey.toString());
|
|
print(pair.privateKey.toString());
|
|
}
|
|
|
|
@override
|
|
Future<void> init() {
|
|
// TODO: implement init
|
|
throw UnimplementedError();
|
|
}
|
|
}
|