getNextPubKey method

Future<String> getNextPubKey()

Returns second/backup public key for Ed25519 signer.

Implementation

Future<String> getNextPubKey() async {
  var isCorrectUuid =
      await _channel.invokeMethod('checkUuid', {'uuid': uuid});
  if (isCorrectUuid) {
    var key =
        await _channel.invokeMethod("readData", {'key': "${uuid}_1_pub"});
    var codec = const Base64Codec();
    var encodeKey = codec.decode(key);
    var urlCodec = const Base64Codec.urlSafe();
    var urlSafeKey = urlCodec.encode(encodeKey);
    return urlSafeKey;
  } else {
    throw IncorrectUuidException(
        'There are no keys associated with this UUID saved on the device');
  }
}