encryptBytesWithRsa static method

Uint8List encryptBytesWithRsa(
  1. Uint8List data,
  2. RSAPublicKey key
)

Encrypts the given data with RSA using the specified key.

Implementation

static Uint8List encryptBytesWithRsa(Uint8List data, RSAPublicKey key) {
  final rsaChiper = PKCS1Encoding(RSAEngine());
  rsaChiper.init(true, PublicKeyParameter<RSAPublicKey>(key));

  return rsaChiper.process(data);
}