The UDM determines whether the first location privacy setting data matches the first digital signature, that is, de-signs the first digital signature by using the public key of the UE and the freshness parameter. If first location privacy setting data obtained through de-signing is the same as the first location privacy setting data, the first location privacy setting data matches the first digital signature. If authentication succeeds, it indicates that the first location privacy setting data reported by the UE to the UDM is not maliciously modified by a visited network or the GMLC. If the first location privacy setting data does not match the first digital signature, it indicates that the first location privacy setting data reported by the UE to the UDM is maliciously modified by a visited network or the GMLC.
When the first location privacy setting data matches the first digital signature, the UDM stores and updates the first location privacy setting data of the UE, that is, stores the first location privacy setting data as latest first location privacy setting data of the UE.
When the first location privacy setting data matches the first digital signature, the UDM performs data signing on the first location privacy setting data, to obtain the second digital signature. Further, the UDM may perform digital signing on the first location privacy setting data based on the private key of the UDM and the input parameter, to obtain the second digital signature. Similarly, the input parameter includes a freshness parameter, and the freshness parameter may include a counter value and an FC value. A counter value used by the UDM to perform digital signing is the counter value reported by the UE to the UDM.