rsaEncrypt function

String rsaEncrypt(
  1. String publicKeyPem,
  2. Uint8List random16Key
)

Implementation

String rsaEncrypt(String publicKeyPem, Uint8List random16Key) {
  // RSA加密密钥A
  final parser = RSAKeyParser();
  final encrypter = Encrypter(RSAExt(publicKey: parser.parse(publicKeyPem) as RSAPublicKey?));
  return Uri.encodeQueryComponent(encrypter.encryptBytes(List.from(random16Key.reversed)).base16);
}