encrypt method

  1. @override
Future<Uint8List> encrypt(
  1. Uint8List data
)
override

Encrypt data using the public key.

Implementation

@override
Future<Uint8List> encrypt(Uint8List data) async {
  try {
    final result = await _methodChannel.invokeMethod<Uint8List>(
      'encrypt',
      {'data': data},
    );
    if (result == null) {
      throw BiometricCryptoException('Encryption returned null');
    }
    return result;
  } on PlatformException catch (e) {
    throw _convertPlatformException(e);
  }
}