如何在flutter中生成或创建私钥/公钥?

问题描述

我需要在我的 Flutter 应用程序中生成一个密钥对,有一个名为 RSA 的库,它确实解析一对公钥/私钥,并且能够使用它们加密和解密字符串,但它没有能力生成一个新的 KeyPair(最好从给定的字符串中生成)。

我如何首先生成密钥?我错过了什么吗?

//Future to hold our KeyPair
Future<crypto.asymmetricKeyPair> futureKeyPair;

//to store the KeyPair once we get data from our future
crypto.asymmetricKeyPair keyPair;

Future<crypto.asymmetricKeyPair<crypto.PublicKey,crypto.PrivateKey>> getKeyPair()
{
  var helper = RsaKeyHelper();
  return helper.computeRSAKeyPair(helper.getSecureRandom());
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)