decryptStringWithPublicKey method
Implementation
@override
Future<String?> decryptStringWithPublicKey(
String plainText, String signature, String publicKey) async {
try {
publicKey = publicKey
.replaceAll("-----BEGIN PUBLIC KEY-----", "")
.replaceAll("-----END PUBLIC KEY-----", "");
final String result = await methodChannel.invokeMethod(
'decryptWithPublicKey',
{"plainText": plainText, "publicKey": publicKey});
return result;
} on PlatformException catch (e) {
throw "Failed decoded string: '${e.message}'.";
}
}