This commit is contained in:
Thomas Atkins 2021-04-11 07:56:23 -05:00
parent 7a50af0cf6
commit b8e057c341
3 changed files with 9 additions and 6 deletions

View File

@ -207,12 +207,16 @@ class _HomePageState extends State<HomePage> {
combinedHash: transaction.hash, combinedHash: transaction.hash,
encodedGPSLocation: "{'none':true}", encodedGPSLocation: "{'none':true}",
partnerPublicKey: transaction.pubKey, partnerPublicKey: transaction.pubKey,
validationSignature: await OpenPGP.encrypt( validationSignature: await OpenPGP.sign(
transaction.hash, KeyFileManager.keyPair.privateKey), transaction.hash,
transaction.pubKey,
KeyFileManager.keyPair.publicKey,
'',
),
); );
var response = await postEncounter(encounter); var response = await postEncounter(encounter);
print(response); print(response);
showSnackbar(response.body); // showSnackbar(response.body);
} }
}, },
onPayloadTransferUpdate: (endid, payloadTransferUpdate) { onPayloadTransferUpdate: (endid, payloadTransferUpdate) {

View File

@ -34,7 +34,7 @@ class _KeygenState extends State<KeygenPage> {
} }
Future<void> initKeyPair() async { Future<void> initKeyPair() async {
var options = KeyOptions()..rsaBits = 2048; var options = KeyOptions()..rsaBits = 512;
var keyPair = var keyPair =
await OpenPGP.generate(options: Options()..keyOptions = options); await OpenPGP.generate(options: Options()..keyOptions = options);
await KeyFileManager.writeKeyPair(keyPair); await KeyFileManager.writeKeyPair(keyPair);

View File

@ -14,8 +14,7 @@ class Transaction {
var lesser = idLess ? id : otherUserId; var lesser = idLess ? id : otherUserId;
var greater = idLess ? otherUserId : id; var greater = idLess ? otherUserId : id;
return Transaction( return Transaction(
hash: DBCrypt() hash: DBCrypt().hashpw("$lesser-$greater", DBCrypt().gensalt()),
.hashpw("$lesser-$greater", KeyFileManager.keyPair.privateKey),
pubKey: KeyFileManager.keyPair.publicKey, pubKey: KeyFileManager.keyPair.publicKey,
); );
} }