|
| 1 | +.. _ug_nrf54l_developing_basics_kmu: |
| 2 | + |
| 3 | +Introduction to KMU key provisioning |
| 4 | +#################################### |
| 5 | + |
| 6 | +.. contents:: |
| 7 | + :local: |
| 8 | + :depth: 2 |
| 9 | + |
| 10 | +The nRF54L devices are equipped with a Key Management Unit (KMU) that facilitates secure and confidential storage of keys. |
| 11 | +This feature is crucial not only for private keys but also for public keys, as the :ref:`KMU can directly transfer a key to the CRACEN RAM<ug_nrf54l_crypto_kmu_cracen_peripherals>`. |
| 12 | +Even when keys must pass through addressable RAM, the KMU significantly reduces the risk of key exposure. |
| 13 | +Therefore, you should use KMU for managing secrets whenever possible. |
| 14 | + |
| 15 | +Key Types |
| 16 | +********* |
| 17 | + |
| 18 | +Different types of keys, such as revocable and locked keys, serve distinct purposes and have unique policies associated with their use and management. |
| 19 | +In the PSA abstraction, key types are mapped by the ``psa_set_key_lifetime`` function. |
| 20 | +Refer to :ref:`PSA Key programming model<ug_nrf54l_crypto_kmu_key_programming_model>` for details. |
| 21 | + |
| 22 | +Revocable keys |
| 23 | +============== |
| 24 | + |
| 25 | +Revocable keys can be set as invalid for further use, which prevents the keys from being reused or new keys from being provisioned onto the same slots. |
| 26 | +For these keys, the revocation policy (RPOLICY) must be marked as ``revoked``. |
| 27 | +For some technical solutions, a few keys of the same key type (for example, generation 0, 1, 2) might be provisioned. |
| 28 | +At any given time, only one generation should be active. |
| 29 | +If a key generation is compromised, it should be revoked to prevent its use. |
| 30 | +The specifics of the revocation scheme depend on the technical solution, but it is recommended to designate one generation as non-revocable (``locked``) to prevent a Denial of Service (DoS) attack on the key's availability for the solution. |
| 31 | + |
| 32 | +Locked keys |
| 33 | +=========== |
| 34 | + |
| 35 | +Once provisioned, locked keys are permanently available for use and cannot be deleted without erasing the device. |
| 36 | +For these keys, the revocation policy (RPOLICY) must be marked as ``locked``. |
| 37 | + |
| 38 | +Provisioning keys for the bootloader |
| 39 | +************************************ |
| 40 | + |
| 41 | +The bootloader can use multiple key generations for image verification (up to three for nRF54L SoCs). |
| 42 | +To safeguard against unauthorized provisioning by attackers, you must :ref:`provision all key generations onto the device<ug_nrf54l_developing_provision_kmu>`. |
| 43 | + |
| 44 | +By default, MCUboot uses a single key. |
| 45 | +You can configure the number of key generations that MCUboot uses for application verification with the ``CONFIG_BOOT_SIGNATURE_KMU_SLOTS`` MCUboot's Kconfig option. |
| 46 | + |
| 47 | +Limitations on key types and trade-offs |
| 48 | +*************************************** |
| 49 | + |
| 50 | +Access to the KMU is restricted to secure code. |
| 51 | +When an SoC runs applications code as secure, the application has some control over the KMU. |
| 52 | +A provisioned key cannot be overwritten, but its content might be blocked from use at runtime (push block mechanism) by unexpected routines. |
| 53 | +However, applications can revoke a revocable key on the nRF54L15, nRF54L10, and nRF54L05 devices. |
| 54 | +The revoked key might not necessarily belong to an application; it could, for example, belong to a bootloader. |
| 55 | + |
| 56 | +Revocable KMU keys are exposed to revocation by applications running in secure mode. |
| 57 | +If you cannot trust the application running in the secure mode, you should provision locked keys. |
| 58 | +You can consider the following options: |
| 59 | + |
| 60 | +* Supporting key generations with revocable keys - The advantage of this method is that the application or bootloader can revoke a key generation if the private key is compromised or lost. |
| 61 | + The disadvantage is that a malicious application could also revoke the key. |
| 62 | +* Supporting one locked key - The advantage of this method is that the key cannot be deleted by the application. |
| 63 | + The disadvantage is that the method does not support multiple generations of keys. |
| 64 | + |
| 65 | +Always consider the specific security needs of your application and choose the most appropriate key management approach to safeguard your digital assets. |
0 commit comments