pubkeyEncrypt static method

Map<String, String> pubkeyEncrypt(
  1. String privateString,
  2. String publicString,
  3. String message
)

Encrypt data using target public key

Implementation

static Map<String, String> pubkeyEncrypt(
  String privateString,
  String publicString,
  String message,
) {
  convert.Utf8Encoder encoder = const convert.Utf8Encoder();
  final enced = pubkeyEncryptRaw(privateString, publicString,
      Uint8List.fromList(encoder.convert(message)));
  return {'enc': convert.base64.encode(enced['enc']), 'iv': enced['iv']};
}