encryptBytesWithRsa static method
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);
}