Section: 6.2.2.2 Keys in the UE
Content: For every key in a network entity, there is a corresponding key in the UE. Figure 6.2.2-2 shows the corresponding relations and derivations as performed in the UE. Figure 6.2.2-2: Key distribution and key derivation scheme for 5G for the UE Keys in the USIM The USIM shall store the same long-term key K that is stored in the ARPF. During an authentication and key agreement procedure, the USIM shall generate key material from K that it forwards to the ME. If provisioned by the home operator, the USIM shall store the Home Network Public Key used for concealing the SUPI. Keys in the ME The ME shall generate the KAUSF from the CK, IK received from the USIM. The generation of this key material is specific to the authentication method and is specified in clause 6.1.3. When 5G AKA is used, the generation of RES* from RES shall be performed by the ME. The UE shall store the latest KAUSF or replace the old KAUSF with the latest KAUSF, after successful completion of the latest primary authentication . If the USIM supports 5G parameters storage, KAUSF shall be stored in the USIM. Otherwise, KAUSF shall be stored in the non-volatile memory of the ME. In case 5G AKA is used as an authentication method, upon receiving the valid NAS Security Mode Command message from the AMF (to take the corresponding partial context derived from the newly generated KAUSF into use), the UE shall consider the performed primary authentication as successful and the UE shall store the newly generated KAUSF as the latest KAUSF or replace the old KAUSF with the latest KAUSF. In case of any key generating EAP method in the present document (EAP-AKA', EAP-TLS in Annex B, EAP methods in Annex I) is used as the authentication method for the primary (re)authentication, upon receiving the EAP-Success message, the primary authentication shall be considered as successful and the UE shall store the newly generated KAUSF as the latest KAUSF or replace the old KAUSF with the latest KAUSF. The ME shall perform the generation of KSEAF from the KAUSF. If the USIM supports 5G parameters storage, KSEAF shall be stored in the USIM. Otherwise, KSEAF shall be stored in the non-volatile memory of the ME. The ME shall perform the generation of KAMF. If the USIM supports 5G parameters storage, KAMF shall be stored in the USIM. Otherwise, KAMF shall be stored in the non-volatile memory of the ME. The ME shall perform the generation of all other subsequent keys that are derived from the KAMF. Any 5G security context, KAUSF and KSEAF that are stored at the ME shall be deleted from the ME if: a) the USIM is removed from the ME when the ME is in power on state; b) the ME is powered up and the ME discovers that the USIM is different from the one which was used to create the 5G security context; c) the ME is powered up and the ME discovers that there is no USIM is present at the ME. NOTE 1: The key derivation and distribution scheme for standalone non-public networks, when an authentication method other than 5G AKA or EAP-AKA' is used, is given in Annex I.2.3.