psa_is_key_slot_occupied() function
Test whether a key slot is occupied. A key slot is occupied iff the key type is nonzero. This works because no valid key can have 0 as its key type.
Arguments
slot
The key slot to test.
Return value
1 if the slot is occupied, 0 otherwise.