【问题标题】:How to Signature with RSA in Flutter?如何在 Flutter 中使用 RSA 进行签名?
【发布时间】:2019-06-16 16:38:08
【问题描述】:

如何在签名或验证中使用simple_rsa?

simple_rsa 

【问题讨论】:

    标签: android flutter dart


    【解决方案1】:

    首先安装简单的 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);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-21
      • 1970-01-01
      • 2016-08-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多