| CPC H04W 12/0431 (2021.01) [H04W 12/041 (2021.01); H04W 12/72 (2021.01)] | 29 Claims |

|
1. A key obtaining method, comprising:
sending, by a communication apparatus, a first identifier and a relay service code to a relay terminal device, wherein the first identifier is an anonymous identifier of a remote terminal device; and
generating, by the communication apparatus, a root key for communication between the remote terminal device and the relay terminal device based on a first shared key, the relay service code, and at least one first freshness parameter, wherein the first shared key is a key shared between the remote terminal device and a remote authentication service function network element, wherein the remote authentication service function network element is an authentication service function network element that serves the remote terminal device;
wherein the generating the root key for communication between the remote terminal device and the relay terminal device comprises:
generating, by the communication apparatus, a second shared key based on the first shared key and the relay service code; and
generating, by the communication apparatus, the root key based on the second shared key and the at least one first freshness parameter, wherein the second shared key is a key shared between the remote terminal device and a proximity-based services key management function network element, wherein the proximity-based services key management function network element is a network element configured to manage security information of proximity-based services.
|