| 372 | # ifndef MMKV_DISABLE_CRYPT |
| 373 | |
| 374 | MMKV_EXPORT bool reKey(void *handle, char *oKey, uint64_t length, bool aes256) { |
| 375 | MMKV *kv = static_cast<MMKV *>(handle); |
| 376 | if (kv) { |
| 377 | if (oKey && length > 0) { |
| 378 | string key(oKey, length); |
| 379 | return kv->reKey(key, aes256); |
| 380 | } else { |
| 381 | return kv->reKey(string(), aes256); |
| 382 | } |
| 383 | } |
| 384 | return false; |
| 385 | } |
| 386 | |
| 387 | MMKV_EXPORT void *cryptKey(void *handle, uint64_t *lengthPtr) { |
| 388 | MMKV *kv = static_cast<MMKV *>(handle); |