diff --git a/wrappers/javascript/aries-askar-react-native/cpp/ariesAskar.cpp b/wrappers/javascript/aries-askar-react-native/cpp/ariesAskar.cpp index 9e0230b3..12e172a9 100644 --- a/wrappers/javascript/aries-askar-react-native/cpp/ariesAskar.cpp +++ b/wrappers/javascript/aries-askar-react-native/cpp/ariesAskar.cpp @@ -179,16 +179,17 @@ jsi::Value storeGetProfileName(jsi::Runtime &rt, jsi::Object options) { jsi::Value storeRekey(jsi::Runtime &rt, jsi::Object options) { auto storeHandle = jsiToValue(rt, options, "storeHandle"); - auto keyMethod = jsiToValue(rt, options, "keyMethod"); + auto keyMethod = jsiToValue(rt, options, "keyMethod", true); auto passKey = jsiToValue(rt, options, "passKey"); jsi::Function cb = options.getPropertyAsFunction(rt, "cb"); State *state = new State(&cb); state->rt = &rt; - ErrorCode code = askar_store_get_profile_name( - storeHandle, callbackWithResponse, CallbackId(state)); - + ErrorCode code = askar_store_rekey(storeHandle, + keyMethod.length() ? keyMethod.c_str() : nullptr, + passKey.c_str(), callback, CallbackId(state)); + return createReturnValue(rt, code, nullptr); }