SDK API > BS2_SetDataEncryptKey

BS2_SetDataEncryptKey

[+ 2.7.1] Change the PIN code encryption key value for the user.
If your device's PIN encryption key is the same as the one you want to set, the setting will be ignored.
Also, if the PIN encryption key on the device is different from the key you want to set, it is set to that key and all user information on the device is erased.

Point
If you change the PIN encryption key, all users on your device will be erased for use with the user-defined key that you changed.
The user must be added back to the device via a function such as BS2_EnrolUser.
The function BS2_MakePinCode encrypts the user PIN code with the default key value.
If the PIN encryption key has been changed to a user-defined value, it should be reassigned to the user by calling BS2_MakePinCodeWithKey.

Declaration

#include "BS_API.h"
 
int BS2_SetDataEncryptKey(void* context, uint32_t deviceId, const BS2EncryptKey* keyInfo);

Parameters

Return value

Returns BS_SDK_SUCCESS if performed successfully, or a corresponding error code if an error occurs.

Watch Together

BS2_MakePinCodeWithKey
BS2_RemoveDataEncryptKey