decodePrivateKey function

Future<String> decodePrivateKey(
  1. Map<String, dynamic> keyStore,
  2. String psw
)

Implementation

Future<String> decodePrivateKey(
  Map<String, dynamic> keyStore,
  String psw,
) async {
  try {
    final response = ReceivePort();

    await Isolate.spawn(
      _decodePrivateKey,
      [response.sendPort, keyStore, psw],
    );

    final sendPort = await response.first as SendPort;
    final receivePort = ReceivePort();

    sendPort.send([keyStore, psw, receivePort.sendPort]);
    return (await response.first) as String;
  } catch (e) {
    rethrow;
  }
}