rekey method

Future<void> rekey({
  1. StoreKeyMethod? keyMethod,
  2. required String passKey,
})

Updates the master encryption key of the store.

Throws an AskarStoreException if rekeying fails.

Implementation

Future<void> rekey({StoreKeyMethod? keyMethod, required String passKey}) async {
  try {
    (await askarStoreRekey(handle, passKey, keyMethod: keyMethod)).throwOnError();
  } catch (e) {
    throw AskarStoreException('Failed to rekey: $e');
  }
}