【发布时间】:2019-06-16 16:38:08
【问题描述】:
如何在签名或验证中使用simple_rsa?
simple_rsa
【问题讨论】:
如何在签名或验证中使用simple_rsa?
simple_rsa
【问题讨论】:
首先安装简单的 RSA
将此添加到您的包的 pubspec.yaml 文件中:
dependencies:
simple_rsa: ^0.0.5
导入 现在在你的 Dart 代码中,你可以使用:
import 'package:simple_rsa/simple_rsa.dart';
试试这个签名:
final publicKey = '...';
final privateKey = '...';
String plainText = 'something';
final Signture = await signString(plainText, PrivateKey);
试试这个来验证:
final Verified = await verifiedString(plainText, Signture , publicKey);
【讨论】: