stirngWithRSA static method

String stirngWithRSA(
  1. String str,
  2. String priKey
)

Implementation

static String stirngWithRSA(String str, String priKey) {
  // 解析rsa公钥
  final publicKey = encrypt.RSAKeyParser().parse(priKey);
  // 创建rsa加密器
  final encrypter =
      encrypt.Encrypter(encrypt.RSA(publicKey: publicKey as RSAPublicKey));
  return encrypter.encrypt(str).base64;
}