| 385 | } |
| 386 | |
| 387 | MMKV_EXPORT void *cryptKey(void *handle, uint64_t *lengthPtr) { |
| 388 | MMKV *kv = static_cast<MMKV *>(handle); |
| 389 | if (kv && lengthPtr) { |
| 390 | auto cryptKey = kv->cryptKey(); |
| 391 | if (cryptKey.length() > 0) { |
| 392 | auto ptr = malloc(cryptKey.length()); |
| 393 | if (ptr) { |
| 394 | memcpy(ptr, cryptKey.data(), cryptKey.length()); |
| 395 | *lengthPtr = cryptKey.length(); |
| 396 | return ptr; |
| 397 | } |
| 398 | } |
| 399 | } |
| 400 | return nullptr; |
| 401 | } |
| 402 | |
| 403 | MMKV_EXPORT void checkReSetCryptKey(void *handle, char *oKey, uint64_t length, bool aes256) { |
| 404 | MMKV *kv = static_cast<MMKV *>(handle); |