decrypt function

String decrypt(
  1. String ciphertext,
  2. RSAPrivateKey privateKey
)

Decrypting String

Implementation

String decrypt(String ciphertext, RSAPrivateKey privateKey) {
  var cipher = new RSAEngine()
    ..init(false, new PrivateKeyParameter<RSAPrivateKey>(privateKey));
  var decrypted = cipher.process(new Uint8List.fromList(ciphertext.codeUnits));

  return new String.fromCharCodes(decrypted);
}