rsaDecrypt static method
Decrypt the given cipherMessage
using the given RSA privateKey
.
Implementation
static String rsaDecrypt(String cipherMessage, RSAPrivateKey privateKey) {
var cipher = RSAEngine()
..init(false, PrivateKeyParameter<RSAPrivateKey>(privateKey));
var decrypted = cipher.process(Uint8List.fromList(cipherMessage.codeUnits));
return String.fromCharCodes(decrypted);
}