runUnlockedAsync<T> abstract method

FutureOr<T> runUnlockedAsync<T>(
  1. SecureCallbackFn<FutureOr<T>> callback, {
  2. bool writable = false,
})

Runs the given callback with the unlocked key data.

This method first unlocks the memory, allowing read-only (or read-write, if writable is set to true) access to the memory. It then calls the given callback with a Uint8List view of the data. This means, if you modify the byte array, the data of the underlying key gets modified as well. The callback can run asynchronously, as the method waits for the returned future to complete. After it did, the key will be locked again, preventing further access to it.

The return value of the method is the same as the one returned from the callback.

Implementation

FutureOr<T> runUnlockedAsync<T>(
  SecureCallbackFn<FutureOr<T>> callback, {
  bool writable = false,
});