File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -138,9 +138,8 @@ class DataItem implements TransactionBase {
138
138
/// Signs the [DataItem] using the specified wallet and sets the `id` and `signature` appropriately.
139
139
@override
140
140
Future <Uint8List > sign (Wallet wallet) async {
141
- final rawSignature = await wallet.sign (this );
142
-
143
- _signature = encodeBytesToBase64 (rawSignature);
141
+ _signature = await wallet.sign (this );
142
+ final rawSignature = decodeBase64ToBytes (_signature);
144
143
145
144
final idHash = await sha256.hash (rawSignature);
146
145
_id = encodeBytesToBase64 (idHash.bytes);
Original file line number Diff line number Diff line change @@ -277,9 +277,8 @@ class Transaction implements TransactionBase {
277
277
278
278
@override
279
279
Future <void > sign (Wallet wallet) async {
280
- final rawSignature = await wallet.sign (this );
281
-
282
- _signature = encodeBytesToBase64 (rawSignature);
280
+ _signature = await wallet.sign (this );
281
+ final rawSignature = decodeBase64ToBytes (_signature);
283
282
284
283
final idHash = await sha256.hash (rawSignature);
285
284
_id = encodeBytesToBase64 (idHash.bytes);
Original file line number Diff line number Diff line change @@ -55,8 +55,14 @@ class Wallet {
55
55
await _keyPair! .extractPublicKey ().then ((res) => res.n));
56
56
Future <String > getAddress () async => ownerToAddress (await getOwner ());
57
57
58
- Future <Uint8List > sign (TransactionBase transaction) async => rsaPssSign (
59
- message: await transaction.getSignatureData (), keyPair: _keyPair! );
58
+ Future <String > sign (TransactionBase transaction) async {
59
+ return encodeBytesToBase64 (
60
+ await rsaPssSign (
61
+ message: await transaction.getSignatureData (),
62
+ keyPair: _keyPair! ,
63
+ ),
64
+ );
65
+ }
60
66
61
67
Future <Uint8List > signMessage (Uint8List message) async =>
62
68
rsaPssSign (message: message, keyPair: _keyPair! );
You can’t perform that action at this time.
0 commit comments