decryptBytesWithRsa static method

Uint8List decryptBytesWithRsa(
  1. Uint8List data,
  2. RSAPrivateKey key
)

Decrypts the given data using the specified private key.

Implementation

static Uint8List decryptBytesWithRsa(Uint8List data, RSAPrivateKey key) {
  final rsaChiper = PKCS1Encoding(RSAEngine());
  rsaChiper.init(false, PrivateKeyParameter<RSAPrivateKey>(key));

  return rsaChiper.process(data);
}