Key Management Unit (KMU) peripheral driver.
More...
|
|
#define | KEY_SLOT_WORDS_COUNT ((KMU_KEYSLOTBITS) / 32) |
| | Macro for calculating how many 32-bit words can be placed in one key slot.
|
| |
|
| int | nrfx_kmu_init (nrfx_kmu_event_handler_t *handler) |
| | Function for initializing KMU driver.
|
| |
|
void | nrfx_kmu_uninit (void) |
| | Function for uninitializing KMU driver.
|
| |
| int | nrfx_kmu_key_slot_provision (nrfx_kmu_key_slot_data_t const *p_key_slot_data, uint32_t slot_id) |
| | Function for provisioning data to given key slot in KMU.
|
| |
| int | nrfx_kmu_key_slots_push (uint32_t slot_id, uint32_t num_slots) |
| | Function for pushing num_slots consecutive key slots from KMU to address specified in keyslot_dest field in nrfx_kmu_key_slot_data_t at provisioning.
|
| |
| int | nrfx_kmu_key_slots_push_block (uint32_t slot_id, uint32_t num_slots) |
| | Function for blocking num_slots consecutive key slots from being pushed.
|
| |
| int | nrfx_kmu_key_slots_block (uint32_t slot_id, uint32_t num_slots) |
| | Function for blocking num_slots consecutive key slots from being pushed or revoked.
|
| |
| int | nrfx_kmu_key_slots_revoke (uint32_t slot_id, uint32_t num_slots) |
| | Function for revoking num_slots consecutive key slots.
|
| |
| int | nrfx_kmu_key_slot_metadata_read (uint32_t slot_id, nrfx_kmu_key_slot_metadata_t *p_metadata) |
| | Function for reading metadata from a key slot.
|
| |
| int | nrfx_kmu_key_slots_empty_check (uint32_t slot_id, uint32_t num_slots, bool *p_is_empty) |
| | Function for checking if given num_slots consecutive key slots can be written to.
|
| |
| int | nrfx_kmu_key_slots_revoked_check (uint32_t slot_id, uint32_t num_slots, bool *p_is_revoked) |
| | Function for checking if given num_slots consecutive key slots are revoked.
|
| |
| int | nrfx_kmu_next_available_key_slots_find (uint32_t num_slots) |
| | Function for finding first num_slots consecutive available key slots.
|
| |
Key Management Unit (KMU) peripheral driver.
◆ nrfx_kmu_event_handler_t
KMU driver event handler type.
- Parameters
-
◆ nrfx_kmu_rpolicy_t
KMU revoke policy type.
| Enumerator |
|---|
| NRFX_KMU_RPOLICY_LOCKED | Locked revoke policy.
|
| NRFX_KMU_RPOLICY_ROTATING | Rotating revoke policy.
|
| NRFX_KMU_RPOLICY_REVOKED | Revoked revoke policy.
|
◆ nrfx_kmu_init()
Function for initializing KMU driver.
- Parameters
-
| [in] | handler | Event handler. Used only if KMU interrupts are present on a device (can be checked with NRF_KMU_HAS_INTEN) |
- Return values
-
| 0 | Initialization successful. |
| -EALREADY | The driver is already initialized. |
◆ nrfx_kmu_key_slot_metadata_read()
Function for reading metadata from a key slot.
- Parameters
-
| [in] | slot_id | ID of a slot to use. |
| [out] | p_metadata | Pointer to a metadata structure to be filled. |
- Return values
-
| 0 | Metadata was read. |
| -EACCES | The key slot is revoked. |
| -EFAULT | The key slot is empty. |
| -EAGAIN | KMU is currently busy with the previous operation. |
| -ETIMEDOUT | Timeout occured when waiting for result event. |
◆ nrfx_kmu_key_slot_provision()
Function for provisioning data to given key slot in KMU.
- Note
- Requires enabled writing to non-volatile memory.
- Parameters
-
| [in] | p_key_slot_data | Pointer to the key slot data structure. |
| [in] | slot_id | ID of a slot to use. |
- Return values
-
| 0 | Provisioning was successful. |
| -EAGAIN | KMU is currently busy with the previous operation. |
| -EFAULT | An error occured when provisioning the key. |
| -ETIMEDOUT | Timeout occured when waiting for result event. |
◆ nrfx_kmu_key_slots_block()
| int nrfx_kmu_key_slots_block |
( |
uint32_t | slot_id, |
|
|
uint32_t | num_slots ) |
Function for blocking num_slots consecutive key slots from being pushed or revoked.
- Parameters
-
| [in] | slot_id | ID of a slot to use. |
| [in] | num_slots | Number of consecutive keys slots to block. |
- Return values
-
| 0 | Blocking was successful. |
| -EAGAIN | KMU is currently busy with the previous operation. Can also happen after blocking only a part of the given keys. |
| -EFAULT | An error occured when blocking the key slot. |
| -ETIMEDOUT | Timeout occured when waiting for result event. |
◆ nrfx_kmu_key_slots_empty_check()
| int nrfx_kmu_key_slots_empty_check |
( |
uint32_t | slot_id, |
|
|
uint32_t | num_slots, |
|
|
bool * | p_is_empty ) |
Function for checking if given num_slots consecutive key slots can be written to.
- Parameters
-
| [in] | slot_id | ID of a slot to check. |
| [in] | num_slots | Number of consecutive keys slots to check. |
| [out] | p_is_empty | Pointer to a variable determining if num_slots consecutive key slots are empty. If at least one of the num_slots key slots is occupied or revoked (non-rotating policy), p_is_empty is equal to false. |
- Return values
-
| 0 | Metadata was read. |
| -EAGAIN | KMU is currently busy with the previous operation. |
| -ETIMEDOUT | Timeout occured when waiting for result event. |
◆ nrfx_kmu_key_slots_push()
| int nrfx_kmu_key_slots_push |
( |
uint32_t | slot_id, |
|
|
uint32_t | num_slots ) |
Function for pushing num_slots consecutive key slots from KMU to address specified in keyslot_dest field in nrfx_kmu_key_slot_data_t at provisioning.
- Parameters
-
| [in] | slot_id | ID of a slot to use. |
| [in] | num_slots | Number of consecutive keys slots to push. |
- Return values
-
| 0 | Pushing was successful. |
| -EACCES | The key slot is revoked. |
| -EAGAIN | KMU is currently busy with the previous operation. Can also happen after pushing only a part of the given keys. |
| -EFAULT | An error occured when pushing the key slot (slot is bloked or empty). |
| -ETIMEDOUT | Timeout occured when waiting for result event. |
◆ nrfx_kmu_key_slots_push_block()
| int nrfx_kmu_key_slots_push_block |
( |
uint32_t | slot_id, |
|
|
uint32_t | num_slots ) |
Function for blocking num_slots consecutive key slots from being pushed.
- Parameters
-
| [in] | slot_id | ID of a slot to use. |
| [in] | num_slots | Number of consecutive keys slots to block from being pushed. |
- Return values
-
| 0 | Blocking was successful. |
| -EAGAIN | KMU is currently busy with the previous operation. Can also happen after blocking only a part of the given keys. |
| -EFAULT | An error occured when push blocking the key slot. |
| -ETIMEDOUT | Timeout occured when waiting for result event. |
◆ nrfx_kmu_key_slots_revoke()
| int nrfx_kmu_key_slots_revoke |
( |
uint32_t | slot_id, |
|
|
uint32_t | num_slots ) |
Function for revoking num_slots consecutive key slots.
- Parameters
-
| [in] | slot_id | ID of a slot to use. |
| [in] | num_slots | Number of consecutive keys slots to revoke. |
- Return values
-
| 0 | Revoking was successful. |
| -EAGAIN | KMU is currently busy with the previous operation. Can also happen after revoking only a part of the given keys. |
| -EFAULT | An error occured when revoking the key slot. |
| -ETIMEDOUT | Timeout occured when waiting for result event. |
◆ nrfx_kmu_key_slots_revoked_check()
| int nrfx_kmu_key_slots_revoked_check |
( |
uint32_t | slot_id, |
|
|
uint32_t | num_slots, |
|
|
bool * | p_is_revoked ) |
Function for checking if given num_slots consecutive key slots are revoked.
- Parameters
-
| [in] | slot_id | ID of a slot to check. |
| [in] | num_slots | Number of consecutive keys slots to check. |
| [out] | p_is_revoked | Pointer to a variable determining if num_slots consecutive key slots are revoked. If at least one of the num_slots key slots is empty or occupied, p_is_empty is equal to false. |
- Return values
-
| 0 | Metadata was read. |
| -EAGAIN | KMU is currently busy with the previous operation. |
| -ETIMEDOUT | Timeout occured when waiting for result event. |
◆ nrfx_kmu_next_available_key_slots_find()
| int nrfx_kmu_next_available_key_slots_find |
( |
uint32_t | num_slots | ) |
|
Function for finding first num_slots consecutive available key slots.
- Parameters
-
| [in] | num_slots | Number of consecutive key slots to find. |
- Return values
-
| non-negative | Slot ID of the first available key slot. |
| -ENOMEM | num_slots consecutive empty key slots were not found, too many occupied and/or revoked key slots. |