psa_start_key_creation() function
Prepare a key slot to receive key material. This function allocates a key slot and sets its metadata. If this function fails, call psa_fail_key_creation(). This function is intended to be used as follows: -# Call psa_start_key_creation() to allocate a key slot, prepare it with the specified attributes, and in case of a volatile key assign it a volatile key identifier. -# Populate the slot with the key material. -# Call psa_finish_key_creation() to finalize the creation of the slot. In case of failure at any step, stop the sequence and call psa_fail_key_creation(). On success, the key slot's state is PSA_SLOT_FILLING. It is the responsibility of the caller to change the slot's state to PSA_SLOT_EMPTY/FULL once key creation has finished.
Arguments
method
An identification of the calling function.
attributes
Key attributes for the new key.
p_slot
On success, a pointer to the prepared slot.
p_drv
On any return, the driver for the key, if any. NULL for a transparent key.
Return value
#PSA_SUCCESS The key slot is ready to receive key material. If this function fails, the key slot is an invalid state. You must call psa_fail_key_creation() to wipe and free the slot.