IP Library Granted Patent US 12706759
Granted Patent B2
US 12706759 · App. 18/788,737 · Granted Aug 11, 2026

Key management and service processing

Inventors: Xianyi Zheng (Hangzhou, CN); Dengwei Xu (Hangzhou, CN); Zhi Xin (Hangzhou, CN); Xiaofei Wan (Hangzhou, CN)
Assignee: Alipay (Hangzhou) Information Technology Co., Ltd.
H04L9/3268
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12706759
App. No.
18/788,737
Granted
Aug 11, 2026
Kind
B2
Abstract

The present disclosure provides methods, apparatuses and systems for key management and service processing. In one aspect, a method includes receiving, by a authentication server from a trusted execution environment (TEE) of a terminal device, device authentication information through a secure channel between the TEE and the authentication server. The device authentication information is configured to prove an identity of the terminal device. The method includes performing, by the authentication server based on the device authentication information, device authentication on the terminal device. The method further includes in response to determining that the terminal device passes the device authentication, sending, by the authentication server, a service encryption key and a device identity certificate to the TEE through the secure channel. The service encryption key is configured to encrypt a service session key for encrypting service data, and the device identity certificate indicates authenticity of the terminal device.

Claims (78)

1 . A computer-implemented method, comprising:

receiving, by an authentication server from a trusted execution environment (TEE) of a terminal device, device authentication information through a secure channel between the TEE and the authentication server, wherein the device authentication information is configured to authenticate an identity of the terminal device;

performing, by the authentication server based on the device authentication information, device authentication on the terminal device; and

in response to determining that the terminal device passes the device authentication, sending, by the authentication server, a service encryption key and a device identity certificate to the TEE through the secure channel, wherein the service encryption key is configured to encrypt a service session key for encrypting service data, and the device identity certificate indicates authenticity of the terminal device, wherein the service session key is randomly generated by the TEE each time a service party requests to perform service processing, and wherein the TEE encrypts the service session key by using the service encryption key.

2 . The computer-implemented method according to claim 1 , wherein sending the device authentication information comprises:

encrypting, by the TEE based on a channel key, a device certificate of the terminal device to obtain the device authentication information, wherein the device certificate is pre-stored in the TEE, and the channel key is determined by the TEE and the authentication server through negotiation.

3 . The computer-implemented method according to claim 2 , wherein performing the device authentication on the terminal device comprises:

decrypting, using the channel key, the device authentication information to obtain the device certificate; and

performing the device authentication on the terminal device based on the device certificate.

4 . The computer-implemented method according to claim 2 , wherein encrypting the device certificate of the terminal device comprises:

signing a challenge code received from the authentication server to obtain first signature information; and

encrypting, using the channel key, the device certificate and the first signature information to obtain the device authentication information.

5 . The computer-implemented method according to claim 4 , wherein performing the device authentication on the terminal device comprises:

decrypting, using the channel key, the device authentication information to obtain the device certificate and the first signature information;

verifying the first signature information;

in response to determining that the first signature information is successfully verified, comparing the challenge code comprised in the first signature information with a locally stored challenge code; and

in response to determining that the challenge code is consistent with the locally stored challenge code, performing the device authentication on the terminal device based on the device certificate.

6 . The computer-implemented method according to claim 2 , wherein determining the channel key comprises:

sending, by the authentication server to the TEE, first authentication information that represents an identity of the authentication server;

performing, by the TEE based on the first authentication information, identity authentication on the authentication server;

sending, by the TEE to the authentication server, second authentication information that represents an identity of the TEE;

performing, by the authentication server based on the second authentication information, identity authentication on the TEE; and

determining, by the TEE and the authentication server in a handshake manner, the channel key.

7 . The computer-implemented method according to claim 1 , wherein sending the service encryption key and the device identity certificate to the TEE comprises:

encrypting, using a channel key, the service encryption key and the device identity certificate to obtain an encrypted service encryption key and an encrypted device identity certificate, wherein the channel key is determined by the authentication server and the TEE through negotiation; and

sending the encrypted service encryption key and the encrypted device identity certificate to the TEE.

8 . The computer-implemented method according to claim 1 , wherein the service encryption key corresponds to a target service, and wherein the service encryption key is configured to encrypt the service session key of the target service.

9 . The computer-implemented method according to claim 8 , wherein the service session key is randomly generated by the TEE for the target service.

10 . The computer-implemented method according to claim 1 , further comprising:

receiving, by the TEE from a service party, a request to perform a target service and service data corresponding to the target service;

encrypting, by the TEE using the service session key, the device identity certificate of the terminal device and the service data to obtain service ciphertext information;

encrypting, by the TEE using the service encryption key, the service session key to obtain a service session key ciphertext;

sending, by the TEE to the service party, the service ciphertext information and the service session key ciphertext;

sending, by the service party to a server, the service ciphertext information and the service session key ciphertext;

decrypting, by the server using the service encryption key, the service session key ciphertext to obtain the service session key;

decrypting, by the server using the service session key, the service ciphertext information to obtain the device identity certificate and the service data;

performing, by the server, device identity authentication on the terminal device based on the device identity certificate; and

in response to determining that the terminal device passes device identity authentication, processing the target service based on the service data.

11 . The computer-implemented method according to claim 10 , wherein encrypting, by the TEE, the device identity certificate of the terminal device and the service data to obtain service ciphertext information comprises:

generating a service identity private key based on a user identifier of a target user and a device identity private key pre-stored in the TEE, wherein the request comprises the user identifier; and

signing, using the service identity private key, the device identity certificate and the service data to generate second signature information; and

encrypting, using the service session key, the second signature information to obtain the service ciphertext information.

12 . The computer-implemented method according to claim 11 , wherein decrypting, by a service server using the service session key, the service ciphertext information to obtain the device identity certificate and the service data comprises:

decrypting, using the service session key, the service ciphertext information to obtain the second signature information;

generating, based on the user identifier and a device identity public key of the TEE, a service identity public key; and

verifying, based on the service identity public key, the second signature information to obtain the device identity certificate and the service data.

13 . A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:

receiving, by an authentication server from a trusted execution environment (TEE) of a terminal device, device authentication information through a secure channel between the TEE and the authentication server, wherein the device authentication information is configured to authenticate an identity of the terminal device;

performing, by the authentication server based on the device authentication information, device authentication on the terminal device; and

in response to determining that the terminal device passes the device authentication, sending, by the authentication server, a service encryption key and a device identity certificate to the TEE through the secure channel, wherein the service encryption key is configured to encrypt a service session key for encrypting service data, and the device identity certificate indicates authenticity of the terminal device, wherein the service session key is randomly generated by the TEE each time a service party requests to perform service processing, and wherein the TEE encrypts the service session key by using the service encryption key.

14 . The non-transitory, computer-readable medium according to claim 13 , wherein sending the device authentication information comprises:

encrypting, by the TEE based on a channel key, a device certificate of the terminal device to obtain the device authentication information, wherein the device certificate is pre-stored in the TEE, and the channel key is determined by the TEE and the authentication server through negotiation.

15 . The non-transitory, computer-readable medium according to claim 14 , wherein performing the device authentication on the terminal device comprises:

decrypting, using the channel key, the device authentication information to obtain the device certificate; and

performing the device authentication on the terminal device based on the device certificate.

16 . The non-transitory, computer-readable medium according to claim 14 , wherein encrypting the device certificate of the terminal device comprises:

signing a challenge code received from the authentication server to obtain first signature information; and

encrypting, using the channel key, the device certificate and the first signature information to obtain the device authentication information.

17 . The non-transitory, computer-readable medium according to claim 16 , wherein performing the device authentication on the terminal device comprises:

decrypting, using the channel key, the device authentication information to obtain the device certificate and the first signature information;

verifying the first signature information;

in response to determining that the first signature information is successfully verified, comparing the challenge code comprised in the first signature information with a locally stored challenge code; and

in response to determining that the challenge code is consistent with the locally stored challenge code, performing the device authentication on the terminal device based on the device certificate.

18 . The non-transitory, computer-readable medium according to claim 14 , wherein determining the channel key comprises:

sending, by the authentication server to the TEE, first authentication information that represents an identity of the authentication server;

performing, by the TEE based on the first authentication information, identity authentication on the authentication server;

sending, by the TEE to the authentication server, second authentication information that represents an identity of the TEE;

performing, by the authentication server based on the second authentication information, identity authentication on the TEE; and

determining, by the TEE and the authentication server in a handshake manner, the channel key.

19 . The non-transitory, computer-readable medium according to claim 13 , wherein sending the service encryption key and the device identity certificate to the TEE comprises:

encrypting, using a channel key, the service encryption key and the device identity certificate to obtain an encrypted service encryption key and an encrypted device identity certificate, wherein the channel key is determined by the authentication server and the TEE through negotiation; and

sending the encrypted service encryption key and the encrypted device identity certificate to the TEE.

20 . A computer-implemented system, comprising:

one or more computers; and

one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations comprising:

receiving, by an authentication server from a trusted execution environment (TEE) of a terminal device, device authentication information through a secure channel between the TEE and the authentication server, wherein the device authentication information is configured to authenticate an identity of the terminal device;

performing, by the authentication server based on the device authentication information, device authentication on the terminal device; and

in response to determining that the terminal device passes the device authentication, sending, by the authentication server, a service encryption key and a device identity certificate to the TEE through the secure channel, wherein the service encryption key is configured to encrypt a service session key for encrypting service data, and the device identity certificate indicates authenticity of the terminal device, wherein the service session key is randomly generated by the TEE each time a service party requests to perform service processing, and wherein the TEE encrypts the service session key by using the service encryption key.