establishForRSA static method

Future<RSASigner> establishForRSA()

Initializes the RSA signer object, which will allow the user to generate keys, rotate them and delete them.

Implementation

static Future<RSASigner> establishForRSA() async {
  var isDeviceSecure = await checkIfDeviceSecure();
  if (isDeviceSecure) {
    String uuid = const Uuid().v4().toString();
    await _channel.invokeMethod('establishForRSA', {'uuid': uuid});
    return RSASigner(uuid);
  } else {
    throw DeviceNotSecuredException(
        'Secure lock on this device is not set up. Consider setting a pin or pattern.');
  }
}