psa_get_and_lock_key_slot_in_memory() function
Get the description in memory of a key given its identifier and lock it. The descriptions of volatile keys and loaded persistent keys are stored in key slots. This function returns a pointer to the key slot containing the description of a key given its identifier. The function searches the key slots containing the description of the key with \p key identifier. The function does only read accesses to the key slots. The function does not load any persistent key thus does not access any storage. For volatile key identifiers, only one key slot is queried as a volatile key with identifier key_id can only be stored in slot of index ( key_id - #PSA_KEY_ID_VOLATILE_MIN ). On success, the function locks the key slot. It is the responsibility of the caller to unlock the key slot when it does not access it anymore. If multi-threading is enabled, the caller must hold the global key slot mutex.
Arguments
key
Key identifier to query.
p_slot
On success, `*p_slot` contains a pointer to the key slot containing the description of the key identified by \p key.
Return value
#PSA_SUCCESS The pointer to the key slot containing the description of the key identified by \p key was returned. #PSA_ERROR_INVALID_HANDLE \p key is not a valid key identifier. #PSA_ERROR_DOES_NOT_EXIST There is no key with key identifier \p key in the key slots.