runUnlockedSync<T> abstract method

T runUnlockedSync<T>(
  1. SecureCallbackFn<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 must complete synchronously, as right after it has finished, 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

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