WO2021004392A1 - 鉴权方法、设备及服务器 - Google Patents

鉴权方法、设备及服务器 Download PDF

Info

Publication number
WO2021004392A1
WO2021004392A1 PCT/CN2020/100107 CN2020100107W WO2021004392A1 WO 2021004392 A1 WO2021004392 A1 WO 2021004392A1 CN 2020100107 W CN2020100107 W CN 2020100107W WO 2021004392 A1 WO2021004392 A1 WO 2021004392A1
Authority
WO
WIPO (PCT)
Prior art keywords
certificate
target account
application server
terminal device
request message
Prior art date
Application number
PCT/CN2020/100107
Other languages
English (en)
French (fr)
Inventor
刘壮
吴敏
段文杰
范姝男
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021004392A1 publication Critical patent/WO2021004392A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0823Network architectures or network communication protocols for network security for authentication of entities using certificates

Definitions

  • the embodiments of the present application relate to communication technologies, and in particular, to an authentication method, device, and server.
  • an embedded universal integrated circuit card also known as an embedded subscriber identification module (eSIM) card
  • eUICC is a secure element that allows multiple mobile network operators (MNOs) to remotely manage subscribers, and can be inserted into the terminal device by plugging or welding to realize the communication function of the terminal device. That is, the eUICC can be embedded in the terminal device in the form of a single chip, or the eUICC can be embedded in the terminal device as a part of other single chips in the terminal device, or the eUICC can be in the form of a removable card (ie SIM card) inserted In the terminal equipment.
  • SIM embedded subscriber identification module
  • the embodiments of the present application provide an authentication method, device, and server, which are used to solve the problem of how the application server can quickly and securely authenticate the user when the user uses the phone number on the eUICC to log in or register an application on the terminal device technical problem.
  • an embodiment of the present application provides an authentication method, in which a terminal device receives an initial authentication request message input by a user, wherein the initial authentication request message is used to request verification that the terminal device is used to Permission to use. After receiving the initial authentication request message, the terminal device can use the terminal device to log in to the application's target account certificate to perform authentication interaction with the application server, and the target account certificate is stored in the application server.
  • the target account number is a phone number.
  • the application server can authenticate the account through the certificate of the account stored in the secure element of the terminal device to verify whether the identity of the user using the terminal device is legal. Because the secure element can prevent external malicious analysis attacks and protect the data security on it. Therefore, the account is authenticated by the account certificate stored in the secure element of the terminal device, which can ensure the accuracy, security, stability, and efficiency of authentication, and there is no existing identity verification mentioned above.
  • the limitations of the method can meet the needs of users in actual use
  • the terminal device after receiving the initial authentication request message input by the user, the terminal device can use the certificate of the target account stored in the secure element of the terminal device to interact with the application server for authentication to The application server verifies the use authority of the terminal device to the application.
  • the following two authentication methods are included:
  • the first authentication method the one-way authentication method is used for authentication between the application server and the terminal device.
  • the initial authentication request message includes: the first random number generated by the application server.
  • the terminal device uses the certificate of the terminal device to log in to the target account of the application to perform authentication interaction with the application server, including: the terminal device sends a first authentication request message to the application server.
  • the first authentication request message includes: the certificate of the target account, the parent certificate of the certificate of the target account, the first signature obtained by signing using the private key of the certificate of the target account, and the first The signature is related to the first random number.
  • the terminal device receives an authentication result from the application server in response to the first authentication request message.
  • the signature data of the certificate of the target account carries the identifier of the target account. It can also be said that the identification of the target account is carried in the statement information of the certificate of the target account.
  • the first authentication request message further includes: an identification of the target account, and the first signature is related to the first random number and the identification of the target account.
  • the identification of the target account is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the target account's certificate. In the data signed by the private key of the certificate. In this way, the application scenarios of the authentication method can be expanded, and the security of the carried identification of the target account can be ensured.
  • the second authentication method the application server and the terminal device can be authenticated in a two-way authentication method.
  • the terminal device using the terminal device to log in the certificate of the target account of the target application to perform authentication interaction with the application server includes:
  • the terminal device sends a second authentication request message to the application server, where the second authentication request message is used to request the application server to verify whether the certificate of the application server and the certificate of the target account are from the same root certificate.
  • the second authentication request message includes: information about the certificate of the target account, the identifier of the target account, and a second random number generated by the terminal device, and the information about the certificate of the target account is used to indicate The root certificate of the certificate of the target account.
  • the terminal device receives the third authentication request message sent by the application server when the certificate of the application server and the certificate of the target account are from the same root certificate.
  • the third authentication request message is used to request the terminal device to authenticate the application server.
  • the third authentication request message includes: the certificate of the application server, a second signature obtained by signing using the private key of the certificate of the application server, and the second signature is related to the second random number and the third random number. The number is related, and the third random number is generated by the application server.
  • the terminal device authenticates the application server according to the third authentication request message. For example, the terminal device uses the root certificate of the certificate of the target account to verify the certificate of the application server. Then, after the certificate verification of the application server is passed, the terminal device uses the certificate of the application server to decrypt the second signature to obtain the second random number and the third random number. If the second random number does not change, the terminal device confirms that the authentication of the application server is passed, and if the second random number changes, the terminal device confirms that the authentication of the application server fails.
  • the terminal device sends a fourth authentication request message to the application server.
  • the fourth authentication request message is used to request the application server to authenticate the target account.
  • the fourth authentication request message includes: the certificate of the target account, the parent certificate of the certificate of the target account, and the third signature obtained by signing with the private key of the certificate of the target account; the third signature is connected with The third random number is related.
  • the terminal device receives an authentication result from the application server in response to the fourth authentication request message.
  • the accuracy of the authentication result can be further ensured, and malicious applications can be avoided from logging in.
  • the signature data of the certificate of the target account carries the identifier of the target account. It can also be said that the identification of the target account is carried in the statement information of the certificate of the target account.
  • the fourth authentication request message further includes: the identification of the target account, and the third signature is related to the third random number and the identification of the target account.
  • the identification of the target account is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account.
  • the private key of the certificate signed data is used. In this way, the application scenarios of the authentication method can be expanded, and the security of the carried identification of the target account can be ensured.
  • the method further includes: the terminal device is in the user The interface displays at least one account.
  • the terminal device uses the account selected by the user on the user interface as the target account. In this way, the user can select one of the accounts corresponding to multiple account certificates installed in the secure element to complete identity verification.
  • the terminal device is preset with the certificate of the target account and the parent certificate of the certificate of the target account, or the method further includes: the terminal device receives the certificate from the security server The certificate of the target account, the private key of the certificate of the target account, and the parent certificate of the certificate of the target account, and the parent certificate is the certificate of the security server. In this way, the implementation of the certificate of the account on the terminal device can be expanded.
  • the embodiments of the present application provide an authentication method.
  • the application server performs authentication interaction with the terminal device based on the certificate of the target account of the terminal device logging in to the application, and verifies that the terminal device Application permissions.
  • the target account number is a phone number.
  • the authentication interaction can include the following two authentication methods:
  • one-way authentication is used for authentication between the application server and the terminal device.
  • the application server performs authentication interaction with the terminal device based on the certificate of the target account of the terminal device logging into the target application, including: the application server receives the first authentication request from the terminal device news.
  • the first authentication request message includes: the certificate of the target account, the parent certificate of the certificate of the target account, and the first signature obtained by signing using the private key of the certificate of the target account.
  • the first signature is related to a first random number, and the first random number is a random number generated by the application server.
  • the application server authenticates the terminal device according to the first authentication request message, obtains the authentication result, and sends the authentication result to the terminal device. For example, the application server verifies the certificate of the target account and the parent certificate of the certificate of the target account. Then, the application server uses the certificate of the target account to decrypt the first signature after the verification of the certificate of the target account and the parent certificate of the certificate of the target account is passed to obtain the first random number . If the first random number does not change, the application server confirms that the terminal device has passed the authentication. If the first random number changes, the application server confirms that the terminal device authentication fails.
  • the signature data of the certificate of the target account carries the identifier of the target account. It can also be said that the identification of the target account is carried in the statement information of the certificate of the target account.
  • the first authentication request message further includes: an identification of the target account, and the first signature is related to the first random number and the identification of the target account.
  • the identification of the target account is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the target account's certificate. In the data signed by the private key of the certificate.
  • the second authentication method the application server and the terminal device can be authenticated in a two-way authentication method.
  • the application server performs authentication interaction with the terminal device based on the certificate of the target account of the terminal device logging into the target application, including:
  • the application server receives the second authentication request message from the terminal device.
  • the second authentication request message is used to request to verify whether the certificate of the application server and the certificate of the target account are from the same root certificate.
  • the second authentication request message includes: information about the certificate of the target account, the identifier of the target account, and a second random number generated by the terminal device, and the information about the certificate of the target account is used to indicate The root certificate of the certificate of the target account.
  • the application server verifies whether the certificate of the application server and the certificate of the target account are from the same root certificate according to the second authentication request message. If the application server determines according to the second authentication request message that the certificate of the application server and the certificate of the target account are from the same root certificate, the application server sends a third authentication request message to the terminal device.
  • the third authentication request message is used to request the terminal device to authenticate the application server.
  • the third authentication request message includes: the certificate of the application server, a second signature obtained by signing using the private key of the certificate of the application server, and the second signature is related to the second random number and the third random number. The number is related, and the third random number is generated by the application server.
  • the application server receives the fourth authentication request message sent by the terminal device after the authentication of the application server is passed.
  • the fourth authentication request message is used to request the application server to authenticate the target account, and the fourth authentication request message includes: the certificate of the target account, the certificate of the target account A parent certificate and a third signature obtained by signing using the private key of the certificate of the target account, where the third signature is related to the third random number.
  • the application server authenticates the terminal device according to the fourth authentication request message, obtains an authentication result, and sends the authentication result to the terminal device.
  • the application server uses the root certificate of the certificate of the application server to verify the certificate of the target account and the parent certificate of the certificate of the target account.
  • the application server uses the certificate of the target account to decrypt the third signature to obtain the third random number after verification of the certificate of the target account and the parent certificate of the certificate of the target account are passed, and Obtain the identifier of the target account from the fourth authentication request message. If the third random number has not changed and the target account identifier carried in the fourth authentication request message is the same as the target account identifier carried in the second authentication request message, then The application server confirms that the terminal device has passed the authentication. If the third random number changes, and/or, the identifier of the target account carried in the fourth authentication request message is different from the identifier of the target account carried in the second authentication request message , The application server confirms that the authentication of the terminal device fails.
  • the signature data of the certificate of the target account carries the identifier of the target account. It can also be said that the identification of the target account is carried in the statement information of the certificate of the target account.
  • the fourth authentication request message further includes: the identification of the target account, and the third signature is related to the third random number and the identification of the target account.
  • the identification of the target account is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account.
  • the private key of the certificate signed data is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account.
  • the private key of the certificate signed data is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account
  • an embodiment of the present application provides an authentication method, in which a security server uses a certificate of the security server to generate a certificate of a target account and a private key of the certificate of the target account. Then, the security server sends the certificate of the target account, the private key of the certificate of the target account, and the certificate of the security server to the terminal device.
  • an embodiment of the present application provides a terminal device.
  • the terminal device includes a transceiver module and a processing module.
  • the transceiver module is configured to receive an initial authentication request message input by a user, where the initial authentication request message is used to request verification of the terminal device's right to use the application.
  • the processing module is configured to use the terminal device to log in the certificate of the target account of the application, and perform authentication interaction with the application server through the transceiver module, and the certificate of the target account is stored in the secure element of the terminal device in.
  • the target account number is a phone number.
  • the authentication interaction can include the following two authentication methods:
  • one-way authentication is used for authentication between the application server and the terminal device.
  • the initial authentication request message includes: the first random number generated by the application server.
  • the processing module is specifically configured to send a first authentication request message to the application server through the transceiver module, and receive an authentication result from the application server in response to the first authentication request message.
  • the first authentication request message includes: the certificate of the target account, the parent certificate of the certificate of the target account, and the first signature obtained by signing using the private key of the certificate of the target account; The signature is related to the first random number.
  • the signature data of the certificate of the target account carries the identifier of the target account. It can also be said that the identification of the target account is carried in the statement information of the certificate of the target account.
  • the first authentication request message further includes: an identification of the target account, and the first signature is related to the first random number and the identification of the target account.
  • the identification of the target account is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the target account's certificate. In the data signed by the private key of the certificate.
  • the second authentication method the application server and the terminal device can be authenticated in a two-way authentication method.
  • processing module is specifically used for:
  • the second authentication request message is used to request the application server to verify whether the certificate of the application server and the certificate of the target account are from the same root certificate.
  • the second authentication request message includes: the certificate information of the target account, the identifier of the target account, the second random number generated by the processing module, and the certificate information of the target account is used to indicate The root certificate of the certificate of the target account.
  • the third authentication request message sent by the application server when the certificate of the application server and the certificate of the target account are from the same root certificate is received through the transceiver module.
  • the third authentication request message is used to request the terminal device to authenticate the application server.
  • the third authentication request message includes: the certificate of the application server, a second signature obtained by signing using the private key of the certificate of the application server, and the second signature is related to the second random number and the third random number. The number is related, and the third random number is generated by the application server.
  • the root certificate of the certificate of the target account is used to verify the certificate of the application server.
  • the second signature is decrypted using the certificate of the application server to obtain the second random number and the third random number. If the second random number does not change, it is confirmed that the authentication of the application server is passed.
  • a fourth authentication request message is sent to the application server through the transceiver module.
  • the fourth authentication request message is used to request the application server to authenticate the target account.
  • the fourth authentication request message includes: the certificate of the target account, the parent certificate of the certificate of the target account, and the third signature obtained by signing with the private key of the certificate of the target account; the third signature is connected with The third random number is related.
  • the signature data of the certificate of the target account carries the identifier of the target account. It can also be said that the identification of the target account is carried in the statement information of the certificate of the target account.
  • the fourth authentication request message further includes: the identification of the target account, and the third signature is related to the third random number and the identification of the target account.
  • the identification of the target account is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account.
  • the private key of the certificate signed data is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account.
  • the private key of the certificate signed data is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account
  • the processing module is further configured to perform authentication interaction with the application server through the transceiver module according to the certificate of the target account of the terminal device logging into the application, in the user interface At least one account is displayed, and the account selected by the user on the user interface is used as the target account.
  • the transceiver module is further configured to receive the certificate of the target account from a security server and a parent certificate of the certificate of the target account, where the parent certificate is the certificate of the security server.
  • beneficial effects of the terminal equipment provided by the foregoing fourth aspect and each possible implementation manner of the fourth aspect may refer to the beneficial effects brought about by the foregoing first aspect and each possible implementation manner of the first aspect, which will not be added here. Repeat.
  • an embodiment of the present application provides a server, the server is an application server, and the application server includes a processing module.
  • the application server may further include a transceiver module.
  • the processing module is configured to perform authentication interaction with the terminal device based on the certificate of the target account of the terminal device logging in to the application, and verify the terminal device's right to use the application.
  • the target account number is a phone number.
  • the authentication interaction can include the following two authentication methods:
  • one-way authentication is used for authentication between the application server and the terminal device.
  • the processing module is specifically configured to receive a first authentication request message from the terminal device through a transceiver module; and authenticate the terminal device according to the first authentication request message, Obtain the authentication result, and send the authentication result to the terminal device through the transceiver module.
  • the first authentication request message includes: the certificate of the target account, the parent certificate of the certificate of the target account, and the first signature obtained by signing using the private key of the certificate of the target account; The signature is related to a first random number, and the first random number is a random number generated by the application server.
  • the processing module is specifically configured to verify the certificate of the target account and the parent certificate of the certificate of the target account, and verify that the certificate of the target account and the parent certificate of the certificate of the target account pass Then, decrypt the first signature using the certificate of the target account to obtain the first random number. If the first random number does not change, it is confirmed that the terminal device authentication is passed, and if the first random number changes, it is confirmed that the terminal device authentication fails.
  • the signature data of the certificate of the target account carries the identifier of the target account. It can also be said that the identification of the target account is carried in the statement information of the certificate of the target account.
  • the first authentication request message further includes: an identification of the target account, and the first signature is related to the first random number and the identification of the target account.
  • the identification of the target account is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the target account's certificate. In the data signed by the private key of the certificate.
  • the second authentication method the application server and the terminal device can be authenticated in a two-way authentication method.
  • processing module is specifically used for:
  • the second authentication request message is used to request to verify whether the certificate of the application server and the certificate of the target account are from the same root certificate.
  • the second authentication request message includes: information about the certificate of the target account, the identifier of the target account, and a second random number generated by the terminal device, and the information about the certificate of the target account is used to indicate The root certificate of the certificate of the target account.
  • the second authentication request message it is verified whether the certificate of the application server and the certificate of the target account are from the same root certificate. If, according to the second authentication request message, it is determined that the certificate of the application server and the certificate of the target account are from the same root certificate, a third authentication request message is sent to the terminal device through the transceiver module.
  • the third authentication request message is used to request the terminal device to authenticate the application server.
  • the third authentication request message includes: the certificate of the application server, a second signature obtained by signing using the private key of the certificate of the application server, and the second signature is related to the second random number and the third random number. The number is related, and the third random number is generated by the application server.
  • the fourth authentication request message sent by the terminal device after the authentication of the application server is passed is received through the transceiver module.
  • the fourth authentication request message is used to request the application server to authenticate the target account.
  • the fourth authentication request message includes: the certificate of the target account, the parent certificate of the certificate of the target account, and the third signature obtained by signing with the private key of the certificate of the target account; the third signature is connected with The third random number is related.
  • the terminal device is authenticated to obtain an authentication result, and the authentication result is sent to the terminal device through the transceiver module.
  • the root certificate of the certificate of the application server is used to verify the certificate of the target account and the parent certificate of the certificate of the target account.
  • the third signature is decrypted by using the certificate of the target account to obtain the third random number.
  • the signature data of the certificate of the target account carries the identifier of the target account. It can also be said that the identification of the target account is carried in the statement information of the certificate of the target account.
  • the fourth authentication request message further includes: the identification of the target account, and the third signature is related to the third random number and the identification of the target account.
  • the identification of the target account is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account.
  • the private key of the certificate signed data is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account.
  • the private key of the certificate signed data is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account
  • an embodiment of the present application provides a server, the server is a security server, and the security server includes: a processing module and a sending module.
  • the processing module is configured to use the certificate of the security server to generate the certificate of the target account and the private key of the certificate of the target account.
  • the sending module is used to send the certificate of the target account, the private key of the certificate of the target account, and the certificate of the security server to the terminal device.
  • an embodiment of the present application provides a terminal device.
  • the terminal device includes: a processor, a memory, a receiver, and a transmitter; the receiver and the transmitter are both coupled to the processor, and the The processor controls the receiving action of the receiver, and the processor controls the sending action of the transmitter;
  • the memory is used to store computer executable program code, and the program code includes instructions; when the processor executes the instructions, the instructions cause the terminal device to execute the method provided by the first aspect or each possible implementation of the first aspect.
  • an embodiment of the present application provides a server, where the server includes a processor and a memory;
  • the memory is used to store computer executable program code
  • the program code includes instructions; when the processor executes the instructions, the instructions cause the server to execute the method provided by the second aspect or each possible implementation of the second aspect, or , Execute the method provided in the third aspect.
  • an embodiment of the present application provides a communication device, which includes a unit, module, or circuit for executing the method provided in the foregoing first aspect or each possible implementation manner of the first aspect.
  • the communication device may be a terminal device or a module applied to the terminal device, for example, it may be a chip applied to the terminal device.
  • an embodiment of the present application provides a communication device, including a unit, module, or circuit for executing the above second aspect or each possible implementation of the second aspect or the method provided in the third aspect.
  • the communication device may be a server or a module applied to the server, for example, may be a chip applied to the server.
  • an embodiment of the present application provides a chip on which a computer program is stored, and when the computer program is executed by the chip, the first aspect or the possible implementation manners of the first aspect are implemented The method provided.
  • an embodiment of the present application provides a chip on which a computer program is stored, and when the computer program is executed by the chip, the second aspect or the possible implementation manners of the second aspect are implemented The method provided.
  • an embodiment of the present application provides a chip with a computer program stored on the chip, and when the computer program is executed by the chip, the method provided in the third aspect is implemented.
  • the embodiments of the present application provide a computer program product containing instructions, which when run on a computer, enable the computer to execute the foregoing first aspect or the methods in the various possible implementation manners of the first aspect.
  • the embodiments of the present application provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the foregoing second aspect or the methods in the various possible implementation manners of the second aspect.
  • embodiments of the present application provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method of the third aspect.
  • an embodiment of the present application provides a computer-readable storage medium that stores instructions in the computer-readable storage medium, which when run on a computer, causes the computer to execute the first aspect or the first aspect described above.
  • an embodiment of the present application provides a computer-readable storage medium that stores instructions in the computer-readable storage medium, which when run on a computer, causes the computer to execute the above-mentioned second aspect or the second aspect The methods provided by each possible implementation.
  • an embodiment of the present application provides a computer-readable storage medium that stores instructions in the computer-readable storage medium, which when run on a computer, causes the computer to execute the method provided in the third aspect.
  • an embodiment of the present application provides a communication system, including the terminal device, application server, and security server described above, wherein the terminal device can execute the first aspect or various possible implementations of the first aspect
  • the application server can execute the method provided by the foregoing second aspect or each possible implementation of the second aspect
  • the security server can execute the method provided by the foregoing third aspect.
  • the application server can authenticate the account through the certificate of the account stored in the secure element of the terminal device to verify whether the identity of the user using the terminal device is legal. Because the secure element can prevent external malicious analysis attacks and protect the data security on it. Therefore, the account is authenticated by the account certificate stored in the secure element of the terminal device, which can ensure the accuracy, security, stability, and efficiency of authentication, and there is no existing identity verification mentioned above.
  • the limitations of the method can meet the needs of users in actual use.
  • FIG. 1 is a schematic diagram of the eUICC system architecture involved in an embodiment of this application;
  • Figure 2 is a schematic diagram of a certificate chain in the existing eUICC system architecture
  • Figure 3 is a system architecture diagram that uses SMS verification codes for verification
  • FIG. 4 is a schematic diagram of the certificate chain in the eUICC system architecture provided by an embodiment of the application.
  • FIG. 5 is a flowchart of an authentication method provided by an embodiment of this application.
  • FIG. 6 is a flowchart of another authentication method provided by an embodiment of this application.
  • FIG. 7 is a flowchart of yet another authentication method provided by an embodiment of this application.
  • FIG. 8 is a flowchart of another authentication method provided by an embodiment of this application.
  • FIG. 9 is a flowchart of yet another authentication method provided by an embodiment of this application.
  • FIG. 10 is a flowchart of yet another authentication method provided by an embodiment of this application.
  • FIG. 11 is a schematic structural diagram of a terminal device provided by an embodiment of this application.
  • FIG. 12 is a schematic structural diagram of a server provided by an embodiment of this application.
  • FIG. 13 is a schematic structural diagram of another server provided by an embodiment of the application.
  • FIG. 14 is a schematic structural diagram of a terminal device provided by an embodiment of this application.
  • FIG. 15 is a schematic structural diagram of another server provided by an embodiment of this application.
  • SIM subscriber identification module
  • MNO mobile network operator
  • an embedded universal integrated circuit card also known as an embedded SIM (embedded SIM, eSIM) card
  • eUICC is a secure element that allows multiple MNOs to remotely manage contracted users, and can be inserted into the terminal device by plugging or welding to realize the communication function of the terminal device. That is, the eUICC can be embedded in the terminal device in the form of a single chip, or the eUICC can be embedded in the terminal device as a part of other single chips in the terminal device, or the eUICC can be in the form of a removable card (ie SIM card) inserted In the terminal equipment.
  • SIM embedded SIM
  • a profile of at least one telephone number of the MNO may be installed in the eUICC.
  • each phone number corresponds to a profile.
  • the profile of each phone number can include: a collection of MNO data and applications.
  • the MNO data mentioned here may include, for example, network access parameters (for example, key parameter Ki), international mobile subscriber identity (IMSI), mobile network operator-security domain (MNO) -SD), supplementary security domains (SSD), control authority security domain (CASD), applications (such as near field communication (NFC) applications, etc.), JAVA card programs, files Other elements in the system and configuration file metadata, etc.
  • the correspondence between IMSI and Ki is used to identify the identity of the user requesting network authentication.
  • the profile may also be called a subscription data set.
  • eUICC has multiple MNO phone number profiles (Profiles) installed, users can activate one phone number profile (Profile) according to their needs. In this way, the user can realize the communication function of the terminal device through the phone number.
  • Profiles MNO phone number profiles
  • FIG. 1 is a schematic diagram of the eUICC system architecture involved in an embodiment of the application.
  • the system includes: subscription management-data preparation (subscription manager-data preparation, SM-DP) + server, MNO server, terminal equipment, CI server, eUICC manufacturer (eUICC manufacturer, EUM) server, subscription Management discovery service (subscription manager-discovery service, SM-DS) server.
  • subscription management-data preparation subscription manager-data preparation, SM-DP
  • MNO terminal equipment
  • CI server eUICC manufacturer
  • EUM subscription Management discovery service
  • subscription manager-discovery service subscription manager-discovery service
  • the SM-DP+ server is used to generate a profile of the phone number of the MNO according to the basic subscription information provided by the MNO server (for example, the international mobile subscriber identity (IMSI), etc.). It can be downloaded to eUICC.
  • the SM-DP+ server is also referred to as a profile provider (provisioner) or a profile download server.
  • provisioner provisioner
  • FIG. 1 may include one or more SM-DP+ servers, and the one or more SM-DP+ servers are servers corresponding to the same MNO.
  • Figure 1 is a schematic diagram of an SM-DP+ server as an example.
  • the terminal device includes the eUICC and the local profile assistant (LPA).
  • LPA can be regarded as an application program, a communication bridge between the SM-DP+ server and eUICC.
  • LPA is used to manage the download of Profile.
  • the terminal device first obtains the SM-DP+ server address from the SM-DS server through the LPA. Then, the terminal device obtains the encrypted profile from the SM-DP+ server corresponding to the SM-DP+ server address through LPA. The terminal device can forward the encrypted Profile to the eUICC. After eUICC decrypts the profile, it installs the profile in eUICC.
  • LPA can provide a user interface (UI) to the user so that the user can manage the profile on the eUICC through the UI.
  • UI user interface
  • the user can activate the profile on the eUICC, deactivate the profile on the eUICC, delete the profile on the eUICC, etc. through the UI.
  • the eUICC of the terminal device obtains the corresponding profile from the SM-DP+ server, and is activated, it can be used by the terminal device, such as communication functions such as surfing the Internet and making phone calls.
  • the profile of the phone numbers of multiple MNOs needs to be installed in the eUICC, the profile of the phone numbers of the MNOs needs to be obtained from the SM-DP+ server corresponding to each MNO, which will not be repeated here.
  • the LPA can be installed on the terminal device or on the eUICC.
  • LPA can be regarded as a device, referred to as LPAd.
  • the LPAd can include a local discovery service (local discovery service, LDSd), a local data download device (local data download device, LPDd), and a local user interface device (local user interface, LUId).
  • LUId is used to provide UI for users
  • LDSd is used to interact with the SM-DS server
  • LPDd is used to interact with the SM-DP+ server.
  • LPA When LPA is installed on the eUICC, it can include local discovery service (LDS), local data download (local data download device, LPD), and local user interface (LUI).
  • LUI is used to provide UI for users
  • LDS is used to interact with the SM-DS server
  • LPD is used to interact with the SM-DP+ server.
  • Terminal devices can be mobile phones, tablets, computers with wireless transceiver functions, virtual reality (VR) terminal devices, augmented reality (Augmented Reality, AR) terminal devices, industrial control (industrial control) ), wireless terminals in self-driving (self-driving), wireless terminals in remote medical surgery, wireless terminals in smart grid, and wireless terminals in transportation safety (transportation safety) Terminal, wireless terminal in smart city, wireless terminal in smart home, etc.
  • VR virtual reality
  • AR Augmented Reality
  • industrial control industrial control
  • wireless terminals in self-driving self-driving
  • wireless terminals in remote medical surgery wireless terminals in smart grid
  • transportation safety transportation safety
  • the certificate is an indispensable and important part, and the main purpose is to verify the identity, Interactive authentication.
  • GSMA global system for mobile communications association
  • RSP remote SIM provisioning
  • FIG. 2 is a schematic diagram of a certificate chain in the existing eUICC system architecture.
  • the CI server is used to sign and issue (abbreviated: issuance) GSMA CI certificates (the name of the certificate can be, for example, CERT.CI.ECDSA), and the EUM certificate (the name of the certificate can be, for example, CERT.EUM. ECDSA), SM-DP+ server certificate, SM-DS server certificate, etc.
  • the EUM server is used to sign and issue an eUICC certificate for the eUICC produced by EUM (the name of the certificate may be, for example, CERT.EUICC.ECDSA), and preset the EUM certificate in the eUICC.
  • EUM the name of the certificate may be, for example, CERT.EUICC.ECDSA
  • the GSMA CI certificate is the root certificate of the entire RSP system
  • the EUM certificate is the certificate of the EUM server
  • the EUM certificate is generated by the root certificate.
  • the SM-DP+ server certificate is generated from the root certificate, and can include the verification certificate of the SM-DP+ server (the name of the certificate can be CERT.DPauth.ECDSA, for example), and the transport layer security (TLS) certificate of the SM-DP+ server (The name of the certificate can be, for example, CERT.DP.TLS) and the encryption certificate used for profile encryption in the SM-DP+ server (the name of the certificate can be, for example, CERT.DPpb.ECDSA).
  • the SM-DS server certificate is generated by the root certificate and can include: the verification certificate of the SM-DS server (the name of the certificate can be, for example, CERT.DSauth.ECDSA), the TLS certificate of the SM-DS server (the name of the certificate can be, for example, CERT.DS.TLS).
  • each certificate contains a public key and identity information.
  • the certificate is used for encryption and can be disclosed to the outside world.
  • Each certificate has a corresponding private key, which is used for signatures and is not public.
  • the names of the certificates shown in FIG. 2 and the names of the public and private keys of the certificates are merely illustrative.
  • the embodiment of the application describes the names of the certificates and the public keys of the certificates. And the name of the private key is not limited.
  • the SM-DP+ server and the MNO server can communicate through the ES2+ interface
  • the MNO server and eUICC can communicate through the ES6 interface
  • the SM-DP+ server and the LPA can communicate through the ES9+ interface
  • LPA and eUICC can communicate through ES10a, ES10b and ES10c interfaces
  • SM-DP+ server and eUICC can communicate through ES8+ interface
  • SM-DP+ server and SM-DS can communicate through ES12 interface
  • SM-DS Communication can be carried out through the ES15 interface
  • SM-DS and LPA can communicate through the ES11 interface.
  • the application server uses a dynamic password to authenticate the user using the terminal device.
  • FIG. 3 is a system architecture diagram that uses SMS verification codes for verification.
  • the system architecture includes: an application server (such as a web server), a third-party platform server, an MNO server, and terminal equipment.
  • the application server verifies based on the SMS verification code as follows:
  • Step 1 The application server can generate a short message verification code through, for example, a random function.
  • Step 2 The application server sends the SMS verification code to the third-party platform server.
  • Step 3 The third-party platform server sends a request message to the MNO server, where the request message is used to request to send the SMS verification code to the terminal device.
  • Step 4 The MNO server sends the SMS verification code to the terminal device via SMS.
  • Step 5 The MNO server sends a status code to the third-party platform server, where the status code is used to indicate that the SMS verification code is sent successfully.
  • Step 6 The third-party platform server forwards the status code to the application server.
  • Step 7 The application server stores the mapping relationship between the terminal device and the SMS verification code.
  • Step 8 The terminal device sends a login request or registration request to the application server, and the login request or registration request carries the SMS verification code manually entered by the user.
  • Step 9 The application server compares the SMS verification code in the login request or registration request of the terminal device, and whether the SMS verification code corresponding to the terminal device stored by the application server itself is consistent. If they are consistent, the application server determines that the user identity verification using the terminal device is passed. If they are inconsistent, the application server determines that the user authentication using the terminal device has failed.
  • the SMS verification code generally only stores a preset duration (for example, 60 seconds) in the application server. After the preset duration is exceeded, the SMS verification code will expire and the application server will delete the SMS verification code.
  • a preset duration for example, 60 seconds
  • SMS is lost.
  • the terminal device when the terminal device is in arrears or is located in an area where there is no operator’s network signal, the terminal device cannot receive the SMS and cannot be verified.
  • SMS verification code requires the intervention of a third-party platform, and there are problems such as SMS sniffing and hijacking, and it is easy to be obtained by viruses and Trojan horses from the terminal device.
  • the second method the application server verifies the user using the terminal device through biometric identification.
  • Biometric recognition refers to the use of human body's inherent physiological characteristics (such as fingerprints, face, iris, etc.) and behavior characteristics (such as handwriting, voice, gait, etc.) for verification.
  • biometric recognition is human face recognition and fingerprint recognition.
  • biometrics There is a risk of forgery in biometrics. For example, fingerprints can be copied.
  • the third method the application server authenticates the user using the terminal device through the USB key.
  • USB Key is a hardware device with USB interface. It has a built-in single-chip microcomputer or smart card chip, has a certain storage space, and can store the user's private key and digital certificate issued by the application server. The application server can use the public key algorithm built into the USB Key to verify the user's identity.
  • USB Key needs to be connected to the terminal device through the USB interface, so that the application server can use the USB Key to verify the user's identity. Therefore, this verification method is generally only available on personal computers with a USB interface that matches the USB Key. It can be used on (personal computer, PC) and cannot be used on terminal devices (such as mobile phones, PADs, etc.) that do not have a USB interface that matches the USB Key.
  • the USB key is a hardware device independent of the terminal device, which is not convenient to use. If the user forgets to carry the USB key, the identity verification cannot be performed.
  • USB Key only supports one application, that is, one application is one USB Key, resulting in poor versatility of USB Key.
  • the embodiment of the present application provides an authentication method.
  • the application server can authenticate the account through the certificate of the account stored in the secure element of the terminal device to verify whether the user identity of the terminal device is legitimate. Because the secure element can prevent external malicious analysis attacks and protect the data security on it. Therefore, the account is authenticated by the account certificate stored in the secure element of the terminal device, which can ensure the accuracy, security, stability, and efficiency of authentication, and there is no existing identity verification mentioned above.
  • the limitations of the method can meet the needs of users in actual use.
  • the account mentioned here can be any account with a profile, such as a phone number, etc.
  • the authentication method provided in the embodiment of the present application may be applicable to any scenario where the application server needs to perform identity verification on a user using a terminal device.
  • the user uses the account to log in to the application, uses the account to register the application, uses the payment function of the application (the user has logged in to the application with the account at this time), etc.
  • the aforementioned secure element may be an element that enables a terminal device to implement a communication function, such as a SIM, eUICC, and so on.
  • a communication function such as a SIM, eUICC, and so on.
  • the account number involved in this embodiment of the application is a phone number.
  • the certificate of the account can be the profile certificate of the phone number.
  • the certificate of the account in the secure element of the terminal device may be generated by the secure server. Take the profile certificate with the eUICC as the secure element, the phone number as the account number, and the phone number as the certificate of the account number as an example.
  • the security server mentioned here can be, for example, any of the SM-DP+ server, SM-DP server, SM-DS server, etc. . It should be noted that the SM-DP+ server is an evolution of the SM-DP server. In the embodiment of the present application, the SM-DP+ server is equivalent to the SM-DP server, which is not distinguished in the embodiment of the present application.
  • the certificate of the account in the secure element of the terminal device and the private key of the certificate can be preset in the secure element, or can be sent by the secure server to the secure element of the terminal device.
  • the security server may use the certificate of the security server to generate the certificate of the target account and the private key of the certificate of the target account, and send the certificate of the target account and the private key of the certificate of the target account to the terminal device, and, The certificate of the security server.
  • the terminal device receives the certificate of the target account and the private key of the certificate of the target account, and the certificate of the security server, and stores them in the security unit of the terminal device.
  • the secure server issues the profile certificate of the phone number to the secure element:
  • FIG. 4 is a schematic diagram of a certificate chain in the eUICC system architecture provided by an embodiment of the application.
  • the certificate chain provided by the embodiment of the present application is compared with the certificate chain in the prior art (ie, the certificate chain shown in FIG. 2), and a branch from the certificate of the SM-DP+ server to the profile certificate is added. That is, the SM-DP+ server can use its own certificate (such as a verification certificate) to generate a profile certificate and the private key of the profile certificate for the profile of the phone number corresponding to the SM-DP+ server according to the requirements of the MNO server Profile issues the profile certificate and the private key of the profile certificate. In other words, the MNO server controls whether the SM-DP+ server generates a certificate for the profile and the private key of the profile certificate.
  • the declaration information of the Profile certificate can include the phone number corresponding to the profile, IMSI, integrated circuit card identity (ICCID), and user identification (identification). , ID) and other at least one piece of information.
  • the at least one piece of information can be used as a unique identifier for declaring a profile.
  • the unique identifier may be at least one of ICCID, IMSI, and user ID.
  • the profile certificate and the private key of the profile certificate can be generated synchronously when the profile is generated by the SM-DP+ server, and downloaded to the eUICC together with the certificate and profile of the SM-DP+ server. For example, download the Profile certificate and the private key of the Profile certificate to the security domain dedicated to storing eUICC related certificates on the eUICC, or download the Profile certificate and the private key of the Profile certificate to the eUICC as the metadata of the profile storage.
  • the MNO server can manage the profile certificate in the form of over-the-air technology (OTA). For example, management operations such as profile certificate update and profile certificate deletion. It should be understood that the aforementioned management operation of the Profile certificate can also be implemented by other entities in the eUICC system architecture according to the management requirements of the MNO server, for example, the SM-DP+ server, the SM-DS server, etc.
  • OTA over-the-air technology
  • the MNO corresponding to the profile sends the profile certificate and the private key of the profile certificate to the eUICC via OTA.
  • the MNO server can manage the profile certificate in the form of OTA. For example, management operations such as profile certificate issuance, profile certificate update, and profile certificate deletion. It should be understood that the aforementioned management operation of the Profile certificate can also be implemented by other entities in the eUICC system architecture according to the management requirements of the MNO server, for example, the SM-DP+ server, the SM-DS server, etc.
  • the profile deletion operation may be a deletion operation implemented by the user through the LPA of the terminal device, may also be a profile deletion operation performed by the MNO server through OTA, or a remote deletion operation performed by the SM-DP+ server.
  • account information such as the user's nickname, birthday, and email address can be preset in the aforementioned Profile certificate or in the LPA of the terminal device for application use.
  • information such as the user's ID card can also be preset in the aforementioned Profile certificate. The specific information preset in the profile certificate can be determined according to actual usage requirements, and will not be repeated here.
  • the names of the certificates shown in FIG. 4 and the names of the public keys and private keys of the certificates are merely illustrative.
  • the embodiment of the application describes the names of the certificates and the public keys of the certificates.
  • the name of the private key is not limited.
  • the MNO server management profile certificate is only one way to achieve.
  • any owner of the profile ie, the profile owner
  • Fig. 5 is a flowchart of an authentication method provided by an embodiment of the application. As shown in Figure 5, the method includes:
  • the terminal device receives an initial authentication request message input by a user.
  • the initial authentication request message is used to request verification of the terminal device's right to use the application.
  • This application is any application that can log in with an account.
  • the above-mentioned initial authentication request message may be an initial authentication request message (also referred to as a login request message) generated by the user clicking the login button of the application on the user interface of the terminal device.
  • the foregoing initial authentication request message may be, for example, the initial authentication request message (also referred to as a registration request message) generated by the user clicking the registration button of the application on the user interface of the terminal device .
  • the aforementioned initial authentication request message may be the initial authentication request message generated by the user clicking the button to jump to the payment page of the application (also called the request message for jumping to the payment page) ).
  • the terminal device uses the certificate of the terminal device to log in to the target account of the application to perform authentication interaction with the application server.
  • the application server performs authentication interaction with the terminal device based on the certificate of the target account of the terminal device logging in to the application, and verifies the terminal device's right to use the application.
  • the certificate of the target account is stored in the secure element of the terminal device.
  • the account is the target account.
  • the aforementioned target account may be any one of the multiple accounts.
  • the target account may be an account randomly selected by the terminal device from multiple accounts, or may be an account selected by the user from multiple accounts.
  • the terminal device may display at least one account on the user interface, and use the account selected by the user on the user interface as the target account. It should be understood that both the at least one account and the certificate of the at least one account are stored in the secure element of the terminal device.
  • the terminal device may provide the user with a user interface for selecting the target account through the LPA, for example, and the implementation manner may refer to the prior art, which will not be repeated.
  • the terminal device after receiving the initial authentication request message input by the user, the terminal device can use the certificate of the target account stored in the secure element of the terminal device to interact with the application server for authentication to The application server verifies the use authority of the terminal device to the application.
  • the following two authentication methods are included:
  • the first authentication method the one-way authentication method is used for authentication between the application server and the terminal device. That is, the application server verifies the target account based on the certificate of the target account, and the terminal device does not need to verify the application server. It should be understood that when the one-way authentication method is used for authentication, it is not limited whether the application server certificate exists on the application server. Even if the certificate of the application server exists on the application server, it is not limited whether the certificate and the target account are from the same root certificate.
  • the second authentication method the application server and the terminal device can be authenticated in a two-way authentication method. That is, the application server verifies the target account based on the certificate of the target account, and the terminal device verifies the application server based on the certificate of the application server. It should be understood that when the two-way authentication is used for authentication, the certificate of the application server is required on the application server, and the certificate of the application server and the certificate of the target account come from the same root certificate. Continuing to refer to the certificate chain shown in FIG. 4, taking the secure element as the eUICC and the target account as the phone number on the eUICC as an example, the certificate of the application server and the private key of the certificate can be issued by the CI server.
  • which authentication method to use can be determined according to whether the application server has a certificate. For example, when there is no application server certificate on the application server, one-way authentication can be used for authentication. When the certificate of the application server is stored on the application server, the authentication can be performed in a two-way authentication mode or a unidirectional authentication mode.
  • the terminal device and the application server may negotiate before authentication to determine which authentication method is used for authentication. Or, before the authentication, the terminal device and the application server receive the instruction information sent by the application server, and the instruction information is used to indicate which authentication method the two parties use for authentication.
  • the indication information can, for example, indicate whether the application server has a certificate to implicitly indicate which authentication method the two parties use for authentication.
  • the indication information can, for example, indicate that the application server has a certificate to implicitly instruct both parties to use two-way authentication for authentication, or the indication information can, for example, indicate that the application server has no certificate to implicitly indicate that the two parties adopt one-way authentication. Way of authentication.
  • the following describes in detail how the terminal device uses the certificate of the target account to perform authentication interaction with the application server based on the above two authentication methods.
  • Fig. 6 is a flowchart of another authentication method provided by an embodiment of the application.
  • This embodiment relates to the authentication process between the application server and the terminal device in a one-way authentication manner. That is, the application server verifies the validity and legality of the certificate of the account of the terminal device, and verifies the private key of the certificate of the account of the terminal device through a random number to determine whether the terminal device is the legal holder of the certificate.
  • the initial authentication request message includes: a first random number generated by the application server.
  • the first random number may be a random number generated by the application server using a preset random function.
  • the first random number may be, for example, sent by the application server to the terminal device when the two parties negotiate an authentication mode.
  • the embodiment of the present application does not limit the length of the first random number.
  • the first random number may be a 16-byte random number.
  • the foregoing step S102 may include:
  • the terminal device sends a first authentication request message to the application server.
  • the application server receives the first authentication request message.
  • the first authentication request message includes: the certificate of the target account, the parent certificate of the certificate of the target account, and the first signature obtained by signing using the private key of the certificate of the target account.
  • the first signature is related to the first random number. That is, the first signature may be obtained based on the first random number.
  • the first signature may be a signature obtained by encrypting the first random number with the private key of the certificate of the target account.
  • the first signature may be, for example, a signature obtained by encrypting an operation result of the first random number and other preset random numbers using the private key of the certificate of the target account. For example, the sum of the first random number and other preset random numbers, the product of the first random number and other preset random numbers, the difference between the first random number and other preset random numbers, and so on.
  • the certificate of the target account can be the profile certificate of the target phone number, and the parent certificate of the certificate of the target account can be the profile certificate that generated the profile certificate.
  • the certificate of the SM-DP+ server (for example, the verification certificate of the SM-DP+ server).
  • S202 The application server authenticates the terminal device according to the first authentication request message, and obtains an authentication result.
  • the application server may first verify the certificate of the target account and the parent certificate of the certificate of the target account.
  • the application server may use an existing certificate chain verification method to verify the certificate of the target account and the parent certificate of the certificate of the target account. That is, the application server may first use the root certificate to verify the legality and validity of the parent certificate of the certificate of the target account. If the parent certificate of the certificate of the target account is legal and valid, the application server may use the parent certificate of the certificate of the target account to verify the legality and validity of the certificate of the target account.
  • the application server can confirm that the certificate of the target account and the parent certificate of the certificate of the target account have passed the verification; otherwise, the application server can confirm the certificate of the target account and the The verification of the parent certificate of the target account's certificate failed.
  • the application server may use the certificate of the target account to decrypt the first signature to obtain the first random number. If the first random number obtained by decryption is the same as the first random number generated by the application server, that is, the first random number obtained by decryption has not changed, indicating that the terminal device is the legal holder of the certificate, then the application The server confirms that the terminal device has passed the authentication.
  • the application server confirms that the authentication of the terminal device has failed.
  • the authentication of the terminal device mentioned here may be referred to as the authentication of the user using the terminal device, or the authentication of the target account.
  • the terminal device authentication failure mentioned here may be referred to as a user identity verification failure using the terminal device, or it may be referred to as a target account authentication failure.
  • the verification mentioned here may also be referred to as authenticating a user using a terminal device. That is, to identify the user's permission to use the application. In the embodiments of the present application, verification and authentication have the same meaning, and the embodiments of the present application do not distinguish this.
  • the application server may first use the certificate of the target account to decrypt the first signature to obtain the first random number. If the first random number obtained by decryption is the same as the first random number generated by the application server, that is, the first random number obtained by decryption has not changed, the application server further checks the certificate of the target account and the first random number generated by the application server. The parent certificate of the certificate of the target account is verified. If the verification is passed, it is confirmed that the authentication of the terminal device is passed. If the verification fails, it is confirmed that the terminal device authentication fails. If the first random number obtained by decryption is different from the first random number generated by the application server, that is, the first random number obtained by decryption has changed, the application server directly confirms that the terminal device authentication fails.
  • the application server sends the authentication result to the terminal device.
  • the terminal device receives the authentication result of the application server in response to the first authentication request message.
  • the terminal device can display the authentication result to the user through the user interface.
  • the signature data of the certificate of the target account carries the identifier of the target account.
  • the identifier of the target account may be able to uniquely identify the target account.
  • the identifier of the target account may be, for example, the phone number itself, or an identifier that can be converted into a phone number such as ICCID and/or IMSI.
  • the application server passes the authentication of the terminal device, it can obtain the identification of the target account from the certificate declaration information of the target account, and then obtain the target account.
  • the signature data of the certificate of the target account does not carry the identifier of the target account, but the first authentication request message carries the identifier of the target account. That is, the first authentication request message also includes the identifier of the target account.
  • the first signature may be related to the first random number and the identification of the target account. That is, the first signature is obtained according to the first random number and the identification of the target account.
  • the first signature may be signature (first random number, identification of the target account).
  • signature first random number, identification of the target account.
  • the decryption is obtained Neither the first random number nor the identification of the target account has changed, indicating that the terminal device is the legal holder of the certificate, and the application server confirms that the terminal device has passed the authentication.
  • the application server If the first random number obtained by decryption is different from the first random number generated by the application server, and/or the identifier of the target account obtained by decryption is different from the identifier of the target account carried in the first authentication request message, That is, the first random number obtained by decryption and/or the identification of the target account has changed, indicating that the terminal device is not the legal holder of the certificate (that is, the terminal device is the illegal holder of the certificate), then the application server confirms The terminal device authentication fails.
  • the application server may use the certificate of the target account to decrypt the first signature to obtain the first random number and the identifier of the target account. If the first random number obtained by decryption is the same as the first random number generated by the application server, and the identification of the target account obtained by decryption is the same as the identification of the target account carried in the first authentication request message, the decryption is obtained If the first random number and the identification of the target account remain unchanged, the application server further verifies the certificate of the target account and the parent certificate of the certificate of the target account. If the verification is passed, it is confirmed that the authentication of the terminal device is passed. If the verification fails, it is confirmed that the terminal device authentication fails.
  • the application server directly confirms that the authentication of the terminal device fails.
  • the application server after the application server passes the authentication of the terminal device, it can obtain the target account from the first authentication request message.
  • the application server authenticates the terminal device according to the first authentication request message, and after obtaining the authentication result, may send the authentication result to the terminal device.
  • the application server may use the target account to log in to the application, and send the authentication result passed the authentication to the terminal device.
  • the application server may refuse to use the target account to log in to the application, and send an authentication result that the authentication fails to the terminal device.
  • the authentication result can be indicated by login success or login failure.
  • the application server can create an account (that is, the target account) for the terminal device to log in to the application, and send the terminal device a successful registration authentication.
  • the application server may create an account (ie, target account) for the terminal device to log in to the application, use the target account to log in to the application, and send a registration message to the terminal device And the authentication result of successful login.
  • the application server may refuse to create an account for the terminal device to log in to the application, and send the authentication result of the registration failure to the terminal device.
  • the application server when the terminal device is authenticated, can push the data stream showing the payment page of the application to the terminal device, and send the authentication result that the verification is successful to the terminal device.
  • the above-mentioned application server may not separately send the authentication result, but indirectly instruct the terminal device to pass the authentication by pushing the data stream displaying the payment page of the application.
  • the application server may not push the data stream displaying the payment page of the application to the terminal device, and send the authentication result of the authentication failure to the terminal device.
  • the security server as the SM-DP+ server
  • the account number as the phone number
  • the account certificate as the profile certificate of the phone number
  • the user using the phone number to log in to the application as an example
  • the one-way authentication method provided in this embodiment of the application Give examples.
  • the certificate of the SM-DP+ server is called CERT_DP
  • the profile certificate generated by using the CERT_DP is called CERT_PF
  • the first random number is R1.
  • LPA Low-power amplifier
  • eUICC eUICC
  • application server the actions of the above applications may be implemented by the processor of the terminal device (for example, the application processor of the terminal device).
  • the aforementioned LPA actions may also be implemented by the processor of the terminal device.
  • LPA and eUICC can be located in the same terminal device, or in different terminal devices, that is, different terminal devices owned by the same user.
  • the LPA is located in a mobile phone owned by the user
  • the eUICC is located in a wearable device (such as a bracelet) owned by the user.
  • the LPA can be an independent application installed on the terminal device or an application installed on the eUICC.
  • Example 1 The statement information of the profile certificate (that is, the signature data of the certificate issuer on the certificate) carries the identification of the profile phone number.
  • FIG. 7 is a flowchart of another authentication method provided by an embodiment of the application. As shown in Figure 7, the method includes:
  • the application sends a login request message for logging in using eUICC to the LPA.
  • the login request message may carry R1.
  • the login request message is the aforementioned initial authentication request message.
  • the login request message may be a login request message triggered by the user clicking the registration or login button of the application.
  • step S301 after the user clicks the registration or login button of the application, the application negotiates with the application server which authentication method to use for authentication.
  • the application can receive R1 sent by the application server.
  • the LPA sends an authentication application message to the eUICC.
  • the authentication application message may include: the target phone number and R1. Among them, the target phone number is used to log in to the application.
  • the LPA may display at least one phone number in the eUICC on the user interface, so that the user can choose which phone number to use to log in to the application. Then, the LPA can use the phone number selected by the user on the user interface as the target phone number.
  • the application sends a login request message for logging in using the eUICC to the eUICC.
  • the login request message may carry R1.
  • the eUICC displays at least one phone number in the eUICC on the user interface by running LPA, so that the user can choose which phone number to use to log in to the application. Then, the eUICC can use the phone number selected by the user on the user interface as the target phone number.
  • the eUICC sends the certificate CERT_PF, the certificate CERT_DP, and the first signature to the application.
  • CERT_PF is the certificate of the profile corresponding to the target phone number
  • the first signature is the signature (R1) obtained by encrypting R1 with the private key of CERT_PF.
  • eUICC sends the certificate CERT_PF, certificate CERT_DP, and the first signature to the application. It can be that eUICC sends the certificate CERT_PF, certificate CERT_DP, and the first signature directly to the application, or it can be passed by eUICC.
  • the LPA sends the certificate CERT_PF, the certificate CERT_DP, and the first signature to the application, which is not limited.
  • the application sends a first authentication request message to the application server.
  • the first authentication request message includes: certificate CERT_PF, certificate CERT_DP, and first signature.
  • the application server authenticates the terminal device according to the first authentication request message, and obtains an authentication result.
  • the application server can use the existing certificate chain to verify the certificate to verify the certificate CERT_PF and the certificate CERT_DP. That is, the application server can obtain the root certificate from the CI server. Then, the application server can use the root certificate to verify the legality and validity of the certificate CERT_DP of the SM-DP+ server. If the certificate CERT_DP is legal and valid, the application server can use the certificate CERT_DP to verify the legality and validity of the certificate CERT_PF. If the certificate CERT_PF is legal and valid, the application server confirms that the certificate CERT_PF and the certificate CERT_DP have passed the verification; otherwise, the application server can confirm that the certificate CERT_PF and the certificate CERT_DP have failed verification.
  • the application server can use the certificate CERT_PF to decrypt the first signature signature (R1) to obtain R1. If the R1 obtained by decryption is the same as the R1 generated by the application server, that is, the R1 obtained by decryption has not changed, indicating that the terminal device is the legal holder of the certificate, the application server confirms that the terminal device has passed the authentication .
  • the application server confirms that the terminal device authentication fails.
  • the application server sends the authentication result to the application.
  • the application server uses the target phone number to create an account for the user and log in to the application.
  • the application server can send the created account information along with the authentication result to the application, or can also send it to the application separately, which is not limited.
  • the authentication result of successful authentication may be, for example, successful registration.
  • the application server may refuse to create an account for the terminal device to log in to the application, and return an authentication result that the authentication fails (for example, registration failure).
  • the application server uses the target phone number as the account of the application to log in to the application, and returns a successful authentication Authentication result (for example, successful login).
  • a successful authentication Authentication result for example, successful login
  • the application server may refuse to log in to the application using the target phone number, and return an authentication result that the authentication fails (for example, login failure).
  • Example 2 The statement information of the profile certificate (that is, the signature data of the certificate issuer on the certificate) does not carry the identification of the phone number of the profile.
  • FIG. 8 is a flowchart of another authentication method provided by an embodiment of the application. As shown in Figure 8, the method includes:
  • the application sends a login request message for logging in using eUICC to the LPA.
  • the login request message may carry R1.
  • the login request message is the aforementioned initial authentication request message.
  • the login request message may be a login request message triggered by the user clicking the registration or login button of the application.
  • the application may negotiate with the application server which authentication method to use for authentication.
  • the application can receive R1 sent by the application server.
  • the LPA sends an authentication application message to the eUICC.
  • the authentication application message may include: the target phone number and R1. Among them, the target phone number is used to log in to the application.
  • the LPA may display at least one phone number in the eUICC on the user interface, so that the user can choose which phone number to use to log in to the application. Then, the LPA can use the phone number selected by the user on the user interface as the target phone number.
  • the application sends a login request message for logging in using the eUICC to the eUICC.
  • the login request message may carry R1.
  • the eUICC displays at least one phone number in the eUICC on the user interface by running LPA, so that the user can choose which phone number to use to log in to the application. Then, the eUICC can use the phone number selected by the user on the user interface as the target phone number.
  • the eUICC sends the certificate CERT_PF, the certificate CERT_DP, the identification PN of the target phone number, and the first signature to the application.
  • CERT_PF is the certificate of the profile corresponding to the target phone number
  • the first signature is the signature (R1, PN) obtained by encrypting R1 and PN with the private key of the target phone number corresponding to CERT_PF.
  • eUICC sends the certificate CERT_PF, certificate CERT_DP, and the first signature to the application. It can be that eUICC sends the certificate CERT_PF, certificate CERT_DP, PN, and the first signature directly to the application, or it can be The eUICC sends the certificate CERT_PF, the certificate CERT_DP, PN, and the first signature to the application through LPA, which is not limited.
  • S404 The application sends a first authentication request message to the application server.
  • the first authentication request message includes: certificate CERT_PF, certificate CERT_DP, PN, and first signature.
  • the application server authenticates the terminal device according to the first authentication request message, and obtains an authentication result.
  • the application server can use the existing certificate chain to verify the certificate to verify the certificate CERT_PF and the certificate CERT_DP. That is, the application server can obtain the root certificate from the CI server. Then, the application server can use the root certificate to verify the legality and validity of the certificate CERT_DP of the SM-DP+ server. If the certificate CERT_DP is legal and valid, the application server can use the certificate CERT_DP to verify the legality and validity of the certificate CERT_PF. If the certificate CERT_PF is legal and valid, the application server confirms that the certificate CERT_PF and the certificate CERT_DP have passed the verification; otherwise, the application server can confirm that the certificate CERT_PF and the certificate CERT_DP have failed verification.
  • the application server can use the certificate CERT_PF to decrypt the first signature signature (R1, PN) to obtain R1 and PN. If R1 obtained by decryption is the same as R1 generated by the application server, and the PN obtained by decryption is the same as the PN carried in the first authentication request message, that is, both R1 and PN obtained by decryption have not changed, indicating that the terminal device If it is the legal holder of the certificate, the application server confirms that the terminal device has passed the authentication.
  • R1, PN first signature signature
  • the application server If the decrypted R1 is different from the R1 generated by the application server, and/or the decrypted PN is different from the PN carried in the first authentication request message, that is, the decrypted R1 and/or PN has changed , It means that the terminal device is not the legal holder of the certificate (that is, the terminal device is the illegal holder of the certificate), then the application server confirms that the authentication of the terminal device fails.
  • S406 The application server sends the authentication result to the application.
  • the application server uses the target phone number to create an account for the user and log in to the application.
  • the application server can send the created account information along with the authentication result to the application, or can also send it to the application separately, which is not limited.
  • the authentication result of successful authentication may be, for example, successful registration.
  • the application server may refuse to create an account for the terminal device to log in to the application, and return an authentication result that the authentication fails (for example, registration failure).
  • the application server uses the target phone number as the account of the application to log in to the application, and returns The authentication result of successful authentication (for example, successful login).
  • the application server may refuse to log in to the application using the target phone number, and return an authentication result that the authentication fails (for example, login failure).
  • FIG. 9 is a flowchart of another authentication method provided by an embodiment of the application.
  • This embodiment relates to the authentication process between the application server and the terminal device in a two-way authentication manner. That is, the application server and the terminal device use the root certificate to verify the validity and legality of the other party's certificate, and verify the private key of the certificate held by the other party through a random number to determine whether the terminal device is the legal holder of the certificate.
  • the foregoing step S102 may include:
  • S501 The terminal device sends a second authentication request message to the application server.
  • the application server receives the second authentication request message.
  • the second authentication request message is used to request the application server to verify whether the certificate of the application server and the certificate of the target account are from the same root certificate.
  • the second authentication request message includes: information of the certificate of the target account, the identifier of the target account, and a second random number generated by the terminal device.
  • the second random number may be a random number generated by the terminal device using a preset random function.
  • the embodiment of the present application does not limit the length of the second random number.
  • the second random number may be a 16-byte random number.
  • the information of the certificate of the target account is used to indicate the root certificate for issuing the certificate of the target account.
  • the information of the certificate of the target account may include the ID (PKID for short) of the root certificate of the certificate of the target account.
  • PID for short
  • the identifier of the target account mentioned above may also be carried in the information of the certificate of the target account.
  • S502 The application server verifies whether the certificate of the application server and the certificate of the target account are from the same root certificate according to the second authentication request message.
  • the application server determines whether the root certificate indicated by the certificate information of the target account is the same as the root certificate of the certificate of the application server. If they are the same, it is determined that the certificate of the application server and the certificate of the target account are from the same root certificate. If they are different, it is determined that the certificate of the application server and the certificate of the target account are not from the same root certificate.
  • the application server can determine that the PKID carried in the second authentication request message is the same as the root certificate of the certificate of the application server. Are the IDs the same. If so, it means that the root certificate indicated by the certificate information of the target account is the same as the root certificate of the certificate of the application server, and it is determined that the certificate of the application server and the certificate of the target account are from the same root certificate. If it is different, it means that the root certificate indicated by the certificate information of the target account is different from the root certificate of the certificate of the application server, and it is determined that the certificate of the application server and the certificate of the target account are not from the same root certificate .
  • the application server and the terminal device can use the root certificate to verify each other’s certificate, and then perform the subsequent step S503 to pass the third
  • the authentication request message requests the terminal device to verify the certificate of the application server. If the certificate of the application server and the certificate of the target account are not from the same root certificate, the application server and the terminal device cannot use the root certificate to verify each other’s certificate, and the application server may send authentication failure to the terminal device The authentication result.
  • the application server sends a third authentication request message to the terminal device when determining that the certificate of the application server and the certificate of the target account are from the same root certificate.
  • the terminal device receives the third authentication request message.
  • the third authentication request message is used to request the terminal device to authenticate the application server, and the third authentication request message includes: the certificate of the application server, the certificate of using the application server The second signature obtained by signing with the private key.
  • the second signature is related to the second random number and the third random number. That is, the second signature may be obtained based on the second random number and the third random number.
  • the second signature ie signature
  • the second signature may be a signature (second random number, third random number) obtained by encrypting the second random number and the third random number using the private key of the certificate of the application server.
  • the third random number is generated by the application server.
  • the third random number may be a random number generated by the application server using a preset random function.
  • the embodiment of the present application does not limit the length of the third random number.
  • the third random number may be a 16-byte random number.
  • S504 The terminal device authenticates the application server according to the third authentication request message.
  • the terminal device may use the root certificate of the certificate of the target account to first verify the certificate of the application server.
  • the terminal device may use an existing certificate chain to verify the certificate, and use the root certificate of the certificate of the target account to first verify the certificate of the application server, which is not repeated here.
  • the terminal device may use the certificate of the application server to decrypt the second signature to obtain the second random number and the third random number. If the second random number obtained by decryption is the same as the second random number generated by the terminal device, that is, the second random number obtained by decryption has not changed, indicating that the application server is the legal holder of the certificate, then the terminal The device confirms that the application server has passed the authentication.
  • the terminal device If the second random number obtained by decryption is different from the second random number generated by the terminal device, that is, the second random number obtained by decryption has changed, indicating that the application server is not the legal holder of the certificate (that is, the application server is The illegal holder of the certificate), the terminal device confirms that the authentication of the application server has failed.
  • the application server authentication passed here may be referred to as the application server authentication passed.
  • the authentication failure of the application server mentioned here can be referred to as the authentication failure of the application server.
  • verification and authentication have the same meaning, and the embodiments of the present application do not distinguish this.
  • the aforementioned terminal device may also first use the certificate of the application server to decrypt the second signature to obtain the second random number and the third random number. If the second random number obtained by decryption is the same as the second random number generated by the terminal device, that is, the second random number obtained by decryption has not changed, the terminal device further uses the root certificate of the certificate of the target account To verify the certificate of the application server. If the verification passes, it is confirmed that the application server authentication passes. If the verification fails, it is confirmed that the authentication of the application server has failed. If the second random number obtained by decryption is different from the second random number generated by the terminal device, that is, the second random number obtained by decryption has changed, the terminal device directly confirms that the authentication of the application server has failed.
  • the terminal device after the terminal device has verified the certificate of the application server, it can request the application server to verify the terminal device through the fourth authentication request message.
  • the application server receives the fourth authentication request message.
  • the fourth authentication request message is used to request the application server to authenticate the target account, and the fourth authentication request message includes: the certificate of the target account, the certificate of the target account The parent certificate and the third signature obtained by signing using the private key of the certificate of the target account.
  • the third signature is related to the third random number. That is, the third signature may be obtained based on the third random number.
  • the third signature may be a signature obtained by encrypting the third random number with the private key of the certificate of the target account.
  • the third signature may be, for example, a signature obtained by encrypting an operation result of the third random number and other preset random numbers using the private key of the certificate of the target account. For example, the sum of the third random number and other preset random numbers, the product of the third random number and other preset random numbers, the difference between the third random number and other preset random numbers, and so on.
  • the certificate of the target account can be the profile certificate of the target phone number, and the parent certificate of the certificate of the target account can be the profile certificate that generated the profile certificate.
  • the certificate of the SM-DP+ server can be the profile certificate of the target phone number, and the parent certificate of the certificate of the target account can be the profile certificate that generated the profile certificate.
  • S506 The application server authenticates the terminal device according to the fourth authentication request message to obtain an authentication result.
  • the application server may use the root certificate of the certificate of the application server to verify the certificate of the target account and the parent certificate of the certificate of the target account.
  • the application server may use an existing certificate chain to verify the certificate, using the root certificate of the application server certificate to first verify the target account certificate and the parent certificate of the target account certificate, I won't repeat it here.
  • the signature data of the certificate of the target account carries the identifier of the target account.
  • the identifier of the target account may be able to uniquely identify the target account. Taking the target account as a phone number as an example, the identifier of the target account may be, for example, a phone number, or an ICCID and/or IMSI that can be converted into a phone number.
  • the application server may obtain the identification of the target account from the certificate of the target account, and then obtain the target account.
  • the signature data of the certificate of the target account does not carry the identifier of the target account, but the fourth authentication request message carries the identifier of the target account. That is, the fourth authentication request message also includes the identifier of the target account.
  • the third signature may be related to the third random number and the identification of the target account. That is, the third signature is obtained according to the third random number and the identification of the target account.
  • the third signature ie signature
  • the third signature may be a signature (third random number, identification of the target account) obtained by encrypting the third random number and the identification of the target account using the private key of the certificate of the target account.
  • the application server passes the verification of the target account’s certificate and the parent certificate of the target account’s certificate, it can use the target account’s certificate to decrypt the third signature to obtain The identifier of the target account.
  • the application server may use the certificate of the target account to decrypt the third signature to obtain the third random number. If the third random number obtained by decryption is the same as the third random number generated by the application server, and the identifier of the target account obtained from the fourth authentication request message is the same as the second authentication request The identity of the target account carried in the message is the same, that is, the third random number obtained by decryption has not changed (indicating that the terminal device is the legal holder of the certificate), and the identity of the target account has not changed, then the application The server confirms that the terminal device has passed the authentication.
  • the application server confirms that the terminal device authentication fails.
  • the authentication of the terminal device mentioned here may be referred to as the authentication of the user using the terminal device, or the authentication of the target account.
  • the terminal device authentication failure mentioned here may be referred to as a user identity verification failure using the terminal device, or it may be referred to as a target account authentication failure.
  • the verification mentioned here may also be referred to as authenticating a user using a terminal device. That is, to identify the user's permission to use the application. In the embodiments of the present application, verification and authentication have the same meaning, and the embodiments of the present application do not distinguish this.
  • the application server may first use the certificate of the target account to decrypt the third signature to obtain the third random number. If the third random number obtained by decryption is the same as the third random number generated by the application server, and the identifier of the target account obtained from the fourth authentication request message is the same as the second authentication request The identity of the target account carried in the message is the same, that is, the third random number obtained by decryption has not changed, and the identity of the target account has not changed, then the application server further checks the certificate of the target account with the The parent certificate of the target account’s certificate is verified. If the verification is passed, it is confirmed that the authentication of the terminal device is passed. If the verification fails, it is confirmed that the terminal device authentication fails.
  • the application server directly confirms that the authentication of the terminal device fails.
  • S507 The application server sends an authentication result to the terminal device.
  • the terminal device receives the authentication result from the application server in response to the fourth authentication request message.
  • the terminal device can display the authentication result to the user through the user interface.
  • the application server may use the target account to log in to the application, and send the authentication result passed the authentication to the terminal device.
  • the application server may refuse to use the target account to log in to the application, and send an authentication result that the authentication fails to the terminal device.
  • the authentication result can be indicated by login success or login failure.
  • the application server can create an account (that is, the target account) for the terminal device to log in to the application, and send the terminal device a successful registration authentication.
  • the application server may create an account (ie, target account) for the terminal device to log in to the application, use the target account to log in to the application, and send a registration message to the terminal device And the authentication result of successful login.
  • the application server may refuse to create an account for the terminal device to log in to the application, and send the authentication result of the registration failure to the terminal device.
  • the application server when the terminal device is authenticated, can push the data stream showing the payment page of the application to the terminal device, and send the authentication result that the verification is successful to the terminal device.
  • the above-mentioned application server may not separately send the authentication result, but indirectly instruct the terminal device to pass the authentication by pushing the data stream displaying the payment page of the application.
  • the application server may not push the data stream displaying the payment page of the application to the terminal device, and send the authentication result of the authentication failure to the terminal device.
  • the two-way authentication method provided by the embodiment of the application is used to log in to the application.
  • Example description Taking the eUICC as the security element, the SM-DP+ server as the security server, the profile certificate with the account number as the phone number, and the account certificate as the phone number, as an example, the two-way authentication method provided by the embodiment of the application is used to log in to the application. Example description.
  • the certificate of the SM-DP+ server is called CERT_DP
  • the profile certificate generated by using the CERT_DP is called CERT_PF
  • the certificate of the application server is CERT_SP
  • the second random number is R2
  • the third random number is R3.
  • LPA Low-power amplifier
  • eUICC eUICC
  • application server the actions of the above applications may be implemented by the processor of the terminal device (for example, the application processor of the terminal device).
  • the aforementioned LPA actions may also be implemented by the processor of the terminal device.
  • LPA and eUICC can be located in the same terminal device, or in different terminal devices, that is, different terminal devices owned by the same user.
  • the LPA is located in a mobile phone owned by the user
  • the eUICC is located in a wearable device (such as a bracelet) owned by the user.
  • the LPA can be an independent application installed on the terminal device or an application installed on the eUICC.
  • FIG. 10 is a flowchart of another authentication method provided by an embodiment of this application. As shown in Figure 10, the method includes:
  • the application sends a login request message for logging in using eUICC to the LPA.
  • the login request message is the aforementioned initial authentication request message.
  • the login request message may be a login request message triggered by the user clicking the registration or login button of the application.
  • step S601 after the user clicks the registration or login button of the application, the application negotiates with the application server which authentication method to use for authentication.
  • the two parties negotiated and decided to use two-way authentication for authentication.
  • the LPA sends an acquisition request message to the eUICC.
  • the obtaining request message is used to request obtaining the profile certificate information (abbreviated as: CERT_PF information) corresponding to the target phone number.
  • the CERT_PF information includes the root certificate PKID that issued the CERT_PF and the identification of the target phone number.
  • the LPA may display at least one phone number in the eUICC on the user interface, so that the user can choose which phone number to use to log in to the application. Then, the LPA can use the phone number selected by the user on the user interface as the target phone number.
  • the application sends a login request message for logging in using the eUICC to the eUICC.
  • the eUICC displays at least one phone number in the eUICC on the user interface by running LPA, so that the user can choose which phone number to use to log in to the application. Then, the eUICC can use the phone number selected by the user on the user interface as the target phone number.
  • eUICC CERT_PF transmits information to the application target phone number, a second random number R2.
  • the eUICC sends the CERT_PF information and the second random number R2 to the application.
  • the eUICC can send it directly to the application, or the eUICC can send it to the application through the LPA. .
  • the second random number R2 may be a random number generated by the terminal device using a preset random function.
  • the embodiment of the present application does not limit the length of the second random number R2.
  • the second random number R2 may be a 16-byte random number.
  • the application sends a second authentication request message to the application server.
  • the second authentication request message includes: CERT_PF information, identification of the target phone number, and R2.
  • the application server verifies whether CERT_SP and CERT_PF are from the same root certificate according to the CERT_PF information.
  • the application server can determine whether the PKID carried in the CERT_PF information in the second authentication request message is the same as the ID of the root certificate of the certificate CERT_SP of the application server. If yes, it means that the root certificate indicated by the CERT_PF information is the same as the root certificate of CERT_SP, and it is determined that CERT_SP and CERT_PF are from the same root certificate. If they are different, it means that the root certificate indicated by the CERT_PF information is different from the root certificate of CERT_SP, and it is determined that CERT_SP and CERT_PF are not from the same root certificate.
  • CERT_SP and CERT_PF come from the same root certificate
  • the application server and the terminal device can use the root certificate to verify each other’s certificate, and then perform the subsequent step S606 to request the terminal device to perform the CERT_SP through the third authentication request message. verification. If CERT_SP and CERT_PF are not from the same root certificate, the application server and the terminal device cannot use the root certificate to verify each other's certificate, and the application server can send the authentication result that the authentication fails to the terminal device.
  • the application server sends a third authentication request message to the eUICC when the CERT_SP and CERT_PF are from the same root certificate.
  • the third authentication request message includes: the certificate CERT_SP of the application server and the second signature.
  • the second signature is the signature (R2, R3) obtained by encrypting R2 and R3 with the private key of CERT_SP.
  • the third random number R3 may be a random number generated by the application server using a preset random function.
  • the embodiment of the present application does not limit the length of the third random number R3.
  • the third random number R3 may be a 16-byte random number.
  • the third authentication request message sent by the application server to the eUICC may be the third authentication request message sent by the application server to the application, and the application forwards the third authentication request message to the eUICC through the LPA.
  • the eUICC may use the root certificate of CERT_PF to first verify the certificate CERT_SP of the application server.
  • the eUICC may use an existing certificate chain to verify the certificate, use the root certificate of CERT_PF, and first verify the certificate CERT_SP of the application server, which will not be repeated here.
  • the certificate CERT_SP of the application server may be used to decrypt the second signature to obtain the second random number R2 and the third random number R3. If the second random number R2 obtained by decryption is the same as the second random number R2 generated by the eUICC, that is, the second random number R2 obtained by decryption has not changed, indicating that the application server is the legal holder of the certificate, then The eUICC confirms that the authentication of the application server is passed.
  • the eUICC confirms that the authentication of the application server has failed.
  • the eUICC confirms that the application server is authenticated, the eUICC further sends a fourth authentication request message to the application server to request the application server to verify the profile certificate of the eUICC target phone number, and then perform the subsequent steps S608. If the eUICC confirms that the authentication of the application server has failed, the process ends. At this time, the terminal device may display prompt information such as illegal application on the user interface, for example.
  • the fourth authentication request message includes: CERT_PF, CERT_DP, and the third signature obtained by using the CERT_PF signature.
  • the third signature is the signature (R3) obtained by using the private key of CERT_PF to encrypt R3 obtained by decrypting the second signature.
  • the application server authenticates the terminal device according to the fourth authentication request message to obtain an authentication result.
  • the application server may use the root certificate of the certificate CERT_SP of the application server to verify CERT_DP and CERT_PF.
  • the application server can use an existing certificate chain to verify the certificate, and use the root certificate of the application server's certificate CERT_SP to verify CERT_DP and CERT_PF first, which will not be repeated here.
  • the application server may use CERT_PF to decrypt the third signature to obtain the third random number R3. If the third random number R3 obtained by decryption is the same as the third random number R3 generated by the application server, and the identifier of the target phone number carried in the fourth authentication request message is the same as the second authentication The identification of the target phone number carried in the request message is the same, that is, the third random number R3 obtained by decryption has not changed (indicating that the terminal device is the legal holder of the certificate), and the identification of the target phone number has not changed either, Then the application server confirms that the terminal device has passed the authentication.
  • the application server If the third random number R3 obtained by decryption is different from the third random number R3 generated by the application server, and/or the identifier of the target phone number carried in the fourth authentication request message is different from the first 2.
  • the identification of the target phone number carried in the authentication request message is different, that is, the third random number R3 obtained by decryption has changed (indicating that the terminal device is not the legal holder of the certificate (that is, the terminal device is an illegal The holder)) and/or the identification of the target phone number changes, the application server confirms that the terminal device authentication fails.
  • the identification of the target phone number carried in the fourth authentication request message may be: the signature data of CERT_PF carries the identification of the target phone number, and the identification of the target phone number is stored in all In the eUICC of the terminal device.
  • the identifier of the target phone number may be able to uniquely identify the target phone number, for example, it may be a phone number, or may be an identifier that can be converted into a phone number such as ICCID and/or IMSI.
  • the application server may obtain the identifier of the target phone number from CERT_PF, and then obtain the target phone number.
  • the signature data of the CERT_PF does not carry the identification of the target phone number, but the fourth authentication request message carries the identification of the target phone number. That is, the fourth authentication request message also includes the identification of the target phone number.
  • the third signature is obtained according to the third random number R3, or the third signature is related to the third random number R3 and the identification of the target phone number. That is, the third signature is obtained according to the identification of the third random number and the target phone number.
  • the third signature (ie signature) may be a signature obtained by encrypting the third random number R3 and the identification of the target phone number using the private key of the CERT_PF (the third random number R3, the identification of the target phone number).
  • the application server can use CERT_PF to decrypt the third signature to obtain the identifier of the target phone number, and then obtain the target phone number.
  • S610 The application server sends an authentication result to the application.
  • the terminal device can display the authentication result to the user through the user interface.
  • the application server uses the target phone number to create an account for the user and log in to the application.
  • the application server can send the created account information along with the authentication result to the application, or can also send it to the application separately, which is not limited.
  • the authentication result of successful authentication may be, for example, successful registration.
  • the application server may refuse to create an account for the terminal device to log in to the application, and return an authentication result that the authentication fails (for example, registration failure).
  • the application server uses the target phone number as the account of the application to log in to the application, and returns an authentication result indicating successful authentication (for example, login successful).
  • the application server may refuse to log in to the application using the target phone number, and return an authentication result that the authentication fails (for example, login failure).
  • the embodiment of the application provides an authentication method.
  • the application server can authenticate the account through the certificate of the account stored in the secure element of the terminal device to verify whether the identity of the user using the terminal device is legal. Because the secure element can prevent external malicious analysis attacks and protect the data security on it. Therefore, the account is authenticated by the account certificate stored in the secure element of the terminal device, which can ensure the accuracy, security, stability, and efficiency of authentication, and there is no existing identity verification mentioned above.
  • the limitations of the method can meet the needs of users in actual use. Taking the eUICC as the secure element and the phone number as the account number as an example, the following table 1 illustrates that the authentication method provided in the embodiment of the present application does not have the limitations of the existing identity verification method:
  • FIG. 11 is a schematic structural diagram of a terminal device provided by an embodiment of this application. As shown in FIG. 11, the terminal device includes: a transceiver module 11 and a processing module 12. among them,
  • the transceiver module 11 is configured to receive an initial authentication request message input by a user, and the initial authentication request message is used to request verification of the terminal device's right to use the application.
  • the processing module 12 is configured to use the terminal device to log in the certificate of the target account of the application, perform authentication interaction with the application server through the transceiver module 11, and store the certificate of the target account in the terminal device Secure component.
  • the target account number is a phone number.
  • the authentication interaction can include the following two authentication methods:
  • one-way authentication is used for authentication between the application server and the terminal device.
  • the initial authentication request message includes: the first random number generated by the application server.
  • the processing module 12 is specifically configured to send a first authentication request message to the application server through the transceiver module 11, and receive an authentication result from the application server in response to the first authentication request message.
  • the first authentication request message includes: the certificate of the target account, the parent certificate of the certificate of the target account, and the first signature obtained by signing using the private key of the certificate of the target account; The signature is related to the first random number.
  • the signature data of the certificate of the target account carries the identifier of the target account. It can also be said that the identification of the target account is carried in the statement information of the certificate of the target account.
  • the first authentication request message further includes: an identification of the target account, and the first signature is related to the first random number and the identification of the target account.
  • the identification of the target account is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the target account's certificate. In the data signed by the private key of the certificate.
  • the second authentication method the application server and the terminal device can be authenticated in a two-way authentication method.
  • processing module 12 is specifically configured to:
  • the second authentication request message is sent to the application server through the transceiver module 11.
  • the second authentication request message is used to request the application server to verify whether the certificate of the application server and the certificate of the target account are from the same root certificate.
  • the second authentication request message includes: information about the certificate of the target account, the identifier of the target account, and a second random number generated by the processing module 12, and the information about the certificate of the target account is used to indicate issuance The root certificate of the certificate of the target account.
  • the third authentication request message sent by the application server when the certificate of the application server and the certificate of the target account are from the same root certificate is received through the transceiver module 11.
  • the third authentication request message is used to request the terminal device to authenticate the application server.
  • the third authentication request message includes: the certificate of the application server, a second signature obtained by signing using the private key of the certificate of the application server, and the second signature is related to the second random number and the third random number. The number is related, and the third random number is generated by the application server.
  • the root certificate of the certificate of the target account is used to verify the certificate of the application server.
  • the second signature is decrypted using the certificate of the application server to obtain the second random number and the third random number. If the second random number does not change, it is confirmed that the authentication of the application server is passed.
  • a fourth authentication request message is sent to the application server through the transceiver module 11.
  • the fourth authentication request message is used to request the application server to authenticate the target account.
  • the fourth authentication request message includes: the certificate of the target account, the parent certificate of the certificate of the target account, and the third signature obtained by signing with the private key of the certificate of the target account; the third signature is connected with The third random number is related.
  • the authentication result from the application server in response to the fourth authentication request message is received through the transceiver module 11.
  • the signature data of the certificate of the target account carries the identifier of the target account. It can also be said that the identification of the target account is carried in the statement information of the certificate of the target account.
  • the fourth authentication request message further includes: the identification of the target account, and the third signature is related to the third random number and the identification of the target account.
  • the identification of the target account is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account.
  • the private key of the certificate signed data is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account.
  • the private key of the certificate signed data is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account
  • the processing module 12 is further configured to perform authentication interaction with the application server through the transceiver module 11 according to the certificate of the terminal device logging in the target account of the application, before The user interface displays at least one account, and uses the account selected by the user on the user interface as the target account.
  • the transceiver module 11 is further configured to receive the certificate of the target account, the private key of the certificate of the target account, and the parent certificate of the certificate of the target account from the security server.
  • the parent certificate is the certificate of the security server.
  • the terminal device provided in the embodiment of the present application can perform the actions of the terminal device in the foregoing method embodiment, and its implementation principles and technical effects are similar, and will not be repeated here.
  • FIG. 12 is a schematic structural diagram of a server provided by an embodiment of this application.
  • the server is an application server, and the application server includes a processing module 21.
  • the application server may further include a transceiver module 22.
  • the processing module 21 is configured to perform authentication interaction with the terminal device based on the certificate of the target account of the terminal device logging in to the application, and verify the terminal device's right to use the application.
  • the target account number is a phone number.
  • the authentication interaction can include the following two authentication methods:
  • one-way authentication is used for authentication between the application server and the terminal device.
  • the processing module 21 is specifically configured to receive a first authentication request message from the terminal device through the transceiver module 22; according to the first authentication request message, perform authentication on the terminal device.
  • the authentication result is obtained, and the authentication result is sent to the terminal device through the transceiver module 22.
  • the first authentication request message includes: the certificate of the target account, the parent certificate of the certificate of the target account, and the first signature obtained by signing using the private key of the certificate of the target account;
  • the signature is related to a first random number, and the first random number is a random number generated by the application server.
  • the processing module 21 is specifically configured to verify the certificate of the target account and the parent certificate of the certificate of the target account, and verify the certificate of the target account and the parent certificate of the certificate of the target account. After passing, decrypt the first signature using the certificate of the target account to obtain the first random number. If the first random number does not change, it is confirmed that the terminal device authentication is passed, and if the first random number changes, it is confirmed that the terminal device authentication fails.
  • the signature data of the certificate of the target account carries the identifier of the target account. It can also be said that the identification of the target account is carried in the statement information of the certificate of the target account.
  • the first authentication request message further includes: an identification of the target account, and the first signature is related to the first random number and the identification of the target account.
  • the identification of the target account is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the target account's certificate. In the data signed by the private key of the certificate.
  • the second authentication method the application server and the terminal device can be authenticated in a two-way authentication method.
  • processing module 21 is specifically configured to:
  • the second authentication request message from the terminal device is received through the transceiver module 22.
  • the second authentication request message is used to request to verify whether the certificate of the application server and the certificate of the target account are from the same root certificate.
  • the second authentication request message includes: information about the certificate of the target account, the identifier of the target account, and a second random number generated by the terminal device, and the information about the certificate of the target account is used to indicate The root certificate of the certificate of the target account.
  • the second authentication request message it is verified whether the certificate of the application server and the certificate of the target account are from the same root certificate. If, according to the second authentication request message, it is determined that the certificate of the application server and the certificate of the target account are from the same root certificate, a third authentication request message is sent to the terminal device through the transceiver module 22.
  • the third authentication request message is used to request the terminal device to authenticate the application server.
  • the third authentication request message includes: the certificate of the application server, a second signature obtained by signing using the private key of the certificate of the application server, and the second signature is related to the second random number and the third random number. The number is related, and the third random number is generated by the application server.
  • the fourth authentication request message sent by the terminal device after the authentication of the application server is passed is received through the transceiver module 22.
  • the fourth authentication request message is used to request the application server to authenticate the target account.
  • the fourth authentication request message includes: the certificate of the target account, the parent certificate of the certificate of the target account, and the third signature obtained by signing with the private key of the certificate of the target account; the third signature is connected with The third random number is related.
  • the terminal device is authenticated to obtain an authentication result, and the authentication result is sent to the terminal device through the transceiver module 22.
  • the root certificate of the certificate of the application server is used to verify the certificate of the target account and the parent certificate of the certificate of the target account.
  • the third signature is decrypted by using the certificate of the target account to obtain the third random number.
  • the signature data of the certificate of the target account carries the identifier of the target account. It can also be said that the identification of the target account is carried in the statement information of the certificate of the target account.
  • the fourth authentication request message further includes: the identification of the target account, and the third signature is related to the third random number and the identification of the target account.
  • the identification of the target account is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account.
  • the private key of the certificate signed data is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account.
  • the private key of the certificate signed data is not carried in the signature data of the certificate of the target account (or the identification of the target account is not carried in the declaration information of the certificate of the target account), but is placed in the use of the target account
  • the application server provided in the embodiment of the present application can execute the actions of the application server in the foregoing method embodiment, and its implementation principles and technical effects are similar, and will not be repeated here.
  • FIG. 13 is a schematic structural diagram of another server provided by an embodiment of this application.
  • the server is a security server, and the security server includes: a processing module 31 and a sending module 32. among them,
  • the processing module 31 is configured to use the certificate of the security server to generate the certificate of the target account and the private key of the certificate of the target account.
  • the sending module 32 is configured to send the certificate of the target account, the private key of the certificate of the target account, and the certificate of the security server to the terminal device.
  • the security server provided in the embodiment of the present application can execute the actions of the security server in the foregoing method embodiment, and its implementation principles and technical effects are similar, and will not be repeated here.
  • the above transceiver module may be a transceiver or a communication interface in actual implementation, and the sending module may be a transmitter or a communication interface in actual implementation.
  • the processing module can be implemented in the form of software calling through processing elements; it can also be implemented in the form of hardware.
  • the processing module may be a separately established processing element, or it may be integrated in a chip of the above-mentioned device for implementation.
  • it may also be stored in the memory of the above-mentioned device in the form of program code, and a certain processing element of the above-mentioned device Call and execute the functions of the above processing module.
  • all or part of these modules can be integrated together or implemented independently.
  • the processing element described here may be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by hardware integrated logic circuits in the processor element or instructions in the form of software.
  • the above modules may be one or more integrated circuits configured to implement the above methods, for example: one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processor, DSP), or, one or more field programmable gate arrays (FPGA), etc.
  • ASIC application specific integrated circuit
  • DSP digital signal processor
  • FPGA field programmable gate arrays
  • the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program codes.
  • CPU central processing unit
  • these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
  • SOC system-on-a-chip
  • FIG. 14 is a schematic structural diagram of a terminal device provided by an embodiment of the application.
  • the terminal device may include: a processor 41 (such as a CPU), a memory 42, a receiver 43, and a transmitter 44; both the receiver 43 and the transmitter 44 are coupled to the processor 41, and the processor 41 controls the receiver
  • the memory 42 may include high-speed random-access memory (RAM), or may also include non-volatile memory (non-volatile memory, NVM), for example, at least one disk storage.
  • the memory 42 can store various instructions for completing various processing functions and implementing the method steps of the present application.
  • the terminal device involved in the present application may further include: a power supply 45, a communication bus 46, and a communication port 47.
  • the receiver 43 and the transmitter 44 may be integrated in the transceiver of the terminal device, or may be independent transceiver antennas on the terminal device.
  • the communication bus 46 is used to implement communication connections between components.
  • the aforementioned communication port 47 is used to implement connection and communication between the terminal device and other peripherals.
  • the aforementioned memory 42 is used to store computer executable program code, and the program code includes instructions; when the processor 41 executes the instructions, the instructions cause the processor 41 of the terminal device to perform the processing of the terminal device in the foregoing method embodiment
  • the action is to cause the receiver 43 to execute the receiving action of the terminal device in the foregoing method embodiment, and the sender 44 to execute the sending action of the terminal device in the foregoing method embodiment.
  • FIG. 15 is a schematic structural diagram of another server provided by an embodiment of this application.
  • the server may include: at least one processor 51 and a memory 52.
  • Figure 15 shows a server with a processor as an example, in which,
  • the memory 52 is used to store programs.
  • the program may include program code, and the program code includes computer operation instructions.
  • the memory 52 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), for example, at least one disk memory.
  • the processor 51 is configured to execute computer-executable instructions stored in the memory 52 to implement the actions of the application server in the authentication method in the foregoing embodiment.
  • the implementation principles and technical effects are similar. This will not be repeated here.
  • the processor 51 is configured to execute the computer-executable instructions stored in the memory 52 to implement the actions of the security server in the authentication method in the foregoing embodiment.
  • the implementation principles and technical effects are similar. I will not repeat them here.
  • processor 51 may be a central processing unit (Central Processing Unit, abbreviated as CPU), or a specific integrated circuit (Application Specific Integrated Circuit, abbreviated as ASIC), or may be configured to implement an embodiment of the present invention. Or multiple integrated circuits.
  • CPU Central Processing Unit
  • ASIC Application Specific Integrated Circuit
  • the communication interface, the memory 52 and the processor 51 may be connected to each other through a bus and complete mutual communication.
  • the bus can be an Industry Standard Architecture (ISA) bus, Peripheral Component (PCI) bus, or Extended Industry Standard Architecture (EISA) bus Wait.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into address bus, data bus, control bus, etc., but it does not mean that there is only one bus or one type of bus.
  • the communication interface, the memory 52 and the processor 51 are integrated on one chip, the communication interface, the memory 52 and the processor 51 can complete the same communication through an internal interface.
  • the processing module or processor
  • storage module or memory
  • transceiver module communicate with each other through internal connection paths, and transfer control and/or Data signal.
  • the foregoing method embodiments of the present application may be applied to a processor, or the processor may implement the steps of the foregoing method embodiments.
  • the processor may be an integrated circuit chip with signal processing capabilities.
  • the steps of the foregoing method embodiments can be completed by hardware integrated logic circuits in the processor or instructions in the form of software.
  • the aforementioned processor may be a central processing unit (CPU), a network processor (NP), or a combination of CPU and NP, a digital signal processor (DSP), or an application specific integrated circuit (application integrated circuit).
  • CPU central processing unit
  • NP network processor
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • the methods, steps and logic block diagrams disclosed in this application can be implemented or executed.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like. Combining the steps of the method disclosed in this application may be directly embodied as being executed and completed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
  • the apparatus may include multiple processors or the processor includes multiple processing modules.
  • the processor may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
  • the memory is used to store computer instructions executed by the processor.
  • the memory can be a storage circuit or a memory.
  • the memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory can be read-only memory (ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), and electronic Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • the volatile memory may be random access memory (RAM), which is used as an external cache.
  • RAM random access memory
  • the memory may be independent of the processor, or may be a storage module in the processor, which is not limited here. Although only one memory is shown in the figure, the device may also include multiple memories or the memory includes multiple storage modules.
  • the transceiver is used to implement content interaction between the processor and other modules or network elements.
  • the transceiver may be a communication interface of the device, a transceiver circuit or a communication module, or a transceiver.
  • the transceiver may also be a communication interface or a transceiver circuit of the processor.
  • the transceiver may be a transceiver chip.
  • the transceiver may also include a sending module and/or a receiving module.
  • the transceiver may include at least one communication interface.
  • the transceiver may also be a module implemented in the form of software.
  • the processor may interact with other modules or network elements through a transceiver. For example, the processor obtains or receives content from other network elements through the transceiver. If the processor and the transceiver are two physically separate components, the processor can interact with other modules of the device without going through the transceiver.
  • the processor, memory, and transceiver may be connected to each other through a bus.
  • the bus can be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus, etc.
  • words such as “exemplary” or “for example” are used as examples, illustrations, or illustrations. Any embodiment or design solution described as “exemplary” or “for example” in the embodiments of the present application should not be construed as being more preferable or advantageous than other embodiments or design solutions. To be precise, words such as “exemplary” or “for example” are used to present related concepts in a specific manner.
  • the names of request messages, response messages, and other various messages are used.
  • these messages are merely examples to illustrate the content that needs to be carried or the functions implemented, and the specific name of the message does not limit the application, for example: the first message, the second message, the third message, etc.
  • These messages can be some specific messages, or some fields in the messages.
  • These messages can also represent various servicing operations.
  • the above embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer program instructions When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application are generated in whole or in part.
  • the computer can be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices.
  • Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • computer instructions can be transmitted from a website, computer, server, or data center through a cable (such as Coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means to transmit to another website, computer, server or data center.
  • a computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
  • plural herein refers to two or more.
  • the term “and/or” in this article is only an association relationship describing associated objects, which means that there can be three relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, exist alone B these three situations.
  • the character "/" in this article generally indicates that the associated objects before and after are in an "or” relationship; in the formula, the character "/" indicates that the associated objects before and after are in a "division" relationship.
  • the size of the sequence numbers of the foregoing processes does not mean the order of execution.
  • the execution order of each process should be determined by its function and internal logic, and should not be implemented in this application.
  • the implementation process of the example constitutes any limitation.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Telephonic Communication Services (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请实施例提供了一种鉴权方法、设备及服务器,该方法包括:终端设备接收用户输入的初始鉴权请求消息,初始鉴权请求消息用于请求验证终端设备对应用的使用权限。终端设备使用终端设备登录该应用的目标账号的证书,与应用服务器进行鉴权交互,目标账号的证书存储在终端设备的安全元件中。本申请实施例提供的鉴权方法、设备及服务器,应用服务器可以通过终端设备的安全元件中的账号的证书,对该账号进行鉴权,以验证使用终端设备的用户身份是否合法。该鉴权方法能够使应用服务器快速、稳定、安全的对使用终端设备的用户进行身份验证,并且没有现有的身份验证方法存在的局限性。

Description

鉴权方法、设备及服务器
本申请要求在2019年7月5日提交中国国家知识产权局、申请号为201910605556.6的中国专利申请的优先权,发明名称为“鉴权方法、设备及服务器”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及通信技术,尤其涉及一种鉴权方法、设备及服务器。
背景技术
随着技术和需求的演进,提出了一种嵌入式通用集成电路卡(embedded universal integrated circuit card,eUICC),也称为嵌入式用户身份识别模块(embedded subscriber identification module,eSIM)卡。该eUICC是一种可由多个移动网络运营商(mobile network operator,MNO)远程管理签约用户的安全元件,可通过插拔的方式或焊接的方式放入终端设备中,实现终端设备的通信功能。即,eUICC可以是单个芯片形态嵌入在终端设备中,或者,eUICC可以作为终端设备中其他单个芯片的一部分嵌入在终端设备中,或者,eUICC可以是可移动的卡片形态(即SIM卡形态)插入终端设备中。
随着移动互联网的普及,通讯、支付、娱乐等应用风靡终端设备。传统的密码验证,已经难以应对复杂的网络环境。因此,网络安全也成为了行业焦点。目前,用户在终端设备上,使用eUICC上的电话号码登录或注册某一应用时,应用服务器通常采用采用动态口令、生物识别、U盾等方式对该电话号码进行验证,以对使用终端设备的用户进行身份验证。但是,这些验证方式都有其自身的局限性,无法满足用户实际使用时的需求。
因此,用户在终端设备上使用eUICC上的电话号码登录或注册某一应用时,应用服务器如何快速、安全的对用户进行身份验证是一个亟待解决的问题。
发明内容
本申请实施例提供一种鉴权方法、设备及服务器,用于解决用户在终端设备上使用eUICC上的电话号码登录或注册某一应用时,应用服务器如何快速、安全的对用户进行身份验证的技术问题。
第一方面,本申请实施例提供一种鉴权方法,该方法中,终端设备接收用户输入的初始鉴权请求消息,其中,所述初始鉴权请求消息用于请求验证所述终端设备对应用的使用权限。在接收到该初始鉴权请求消息后,所述终端设备可以使用所述终端设备登录所述应用的目标账号的证书,与所述应用服务器进行鉴权交互,所述目标账号的证书存储在所述终端设备的安全元件中。示例性的,所述目标账号为电话号码。
在上述方法中,应用服务器可以通过存储在终端设备的安全元件中的账号的证书,对该账号进行鉴权,以验证使用终端设备的用户身份是否合法。因安全元件能够防止外部恶意解析攻击,保护其上的数据安全。因此,通过存储在终端设备的安全元件中的账号的证书对账号进行鉴权,可以确保鉴权的准确性、安全性、稳定性及鉴权效率,并且没有前述所说的现有的身份验证方法存在的局限性,能够满足用户实际使用时的需求
在本实施例中,终端设备在接收到用户输入的初始鉴权请求消息之后,可以使用存储在所述终端设备的安全元件中的目标账号的证书,与所述应用服务器进行鉴权交互,以使应用服务器验证所述终端设备对应用的使用权限。对于该鉴权交互,包括如下两种鉴权方式:
第一种鉴权方式:应用服务器与终端设备之间采用单向鉴权的方式进行鉴权。
在该实现方式下,所述初始鉴权请求消息包括:所述应用服务器生成的第一随机数。则所述终端设备使用所述终端设备登录所述应用的目标账号的证书,与所述应用服务器进行鉴权交互,包括:所述终端设备向所述应用服务器发送第一鉴权请求消息。其中,所述第一鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第一签名,所述第一签名与所述第一随机数相关。然后,所述终端设备接收来自所述应用服务器响应所述第一鉴权请求消息的鉴权结果。
通过上述单向鉴权的方法,无需对应用服务器进行鉴权,可以快速完成鉴权,提高了鉴权效率。
可选的,所述目标账号的证书的签名数据中携带有所述目标账号的标识。也可以说,目标账号的标识携带在所述目标账号的证书的声明信息中。或者,所述第一鉴权请求消息还包括:所述目标账号的标识,所述第一签名与所述第一随机数和所述目标账号的标识相关。例如,目标账号的标识未携带在所述目标账号的证书的签名数据中(或者说目标账号的标识未携带在所述目标账号的证书的声明信息中),而是放在使用该目标账号的证书的私钥签名的数据中。通过该方式,可以扩展鉴权方法的应用场景,以及,确保所携带的目标账号的标识的安全性。
第二种鉴权方式:应用服务器与终端设备之间可以采用双向鉴权的方式进行鉴权。
在该实现方式下,所述终端设备使用所述终端设备登录所述目标应用的目标账号的证书,与所述应用服务器进行鉴权交互,包括:
所述终端设备向应用服务器发送第二鉴权请求消息,其中,所述第二鉴权请求消息用于请求所述应用服务器验证应用服务器的证书与所述目标账号的证书是否来自同一根证书。所述第二鉴权请求消息包括:所述目标账号的证书的信息、所述目标账号的标识、所述终端设备生成的第二随机数,所述目标账号的证书的信息用于指示签发所述目标账号的证书的根证书。
所述终端设备接收所述应用服务器在应用服务器的证书与所述目标账号的证书来自同一根证书时发送的第三鉴权请求消息。其中,所述第三鉴权请求消息用于请求所述终端设备对所述应用服务器进行鉴权。所述第三鉴权请求消息包括:所述应用服务器的证书、使用所述应用服务器的证书的私钥签名得到的第二签名,所述第二签名与所述第二随机数和第三随机数相关,所述第三随机数为所述应用服务器生成的。
所述终端设备根据所述第三鉴权请求消息,对所述应用服务器鉴权。例如,所述终端设备使用所述目标账号的证书的根证书,对所述应用服务器的证书进行验证。然后,所述终端设备在所述应用服务器的证书验证通过后,使用所述应用服务器的证书对所述第二签名进行解密,得到所述第二随机数和所述第三随机数。若所述第二随机数未发生变化,则所述终端设备确认所述应用服务器鉴权通过,若所述第二随机数发生变化,则所述终端设备确认所述应用服务器鉴权失败。
在所述应用服务器鉴权通过后,所述终端设备向所述应用服务器发送第四鉴权请求消息。其中,所述第四鉴权请求消息用于请求所述应用服务器对所述目标账号进行鉴权。所述第四鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账 号的证书的私钥签名得到的第三签名;所述第三签名与所述第三随机数相关。
所述终端设备接收来自所述应用服务器响应所述第四鉴权请求消息的鉴权结果。
通过上述双向鉴权的方法,可以进一步地确保鉴权结果的准确性,避免登录恶意应用。
可选的,所述目标账号的证书的签名数据中携带有所述目标账号的标识。也可以说,目标账号的标识携带在所述目标账号的证书的声明信息中。或者,所述第四鉴权请求消息还包括:所述目标账号的标识,所述第三签名与所述第三随机数和所述目标账号的标识相关。例如,目标账号的标识未携带在所述目标账号的证书的签名数据中(或者说目标账号的标识未携带在所述目标账号的证书的声明信息中),而是放在使用所述目标账号的证书的私钥签名的数据中。通过该方式,可以扩展鉴权方法的应用场景,以及,确保所携带的目标账号的标识的安全性。
作为一种可能的实现方式,所述终端设备根据所述终端设备登录所述应用的目标账号的证书,与所述应用服务器进行鉴权交互之前,所述方法还包括:所述终端设备在用户界面显示至少一个账号。所述终端设备将用户在所述用户界面所选择的账号作为所述目标账号。通过该方式,可以使用户选择安装在安全元件中的多个账号证书对应的账号中的一个来完成身份验证。
作为一种可能的实现方式,所述终端设备上预置有所述目标账号的证书和所述目标账号的证书的父证书,或者,所述方法还包括:所述终端设备接收来自安全服务器的所述目标账号的证书、所述目标账号的证书的私钥和所述目标账号的证书的父证书,所述父证书为所述安全服务器的证书。通过该方式,可以扩展终端设备上的账号的证书的实现方式。
第二方面,本申请实施例提供一种鉴权方法,该方法中,应用服务器基于终端设备登录应用的目标账号的证书,与所述终端设备进行鉴权交互,验证所述终端设备对所述应用的使用权限。示例性的,所述目标账号为电话号码。
该鉴权交互可以包括如下两种鉴权方式:
第一种鉴权方式,应用服务器与终端设备之间采用单向鉴权的方式进行鉴权。
在该实现方式下,所述应用服务器基于终端设备登录目标应用的目标账号的证书,与所述终端设备进行鉴权交互,包括:所述应用服务器接收来自所述终端设备的第一鉴权请求消息。其中,所述第一鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第一签名。所述第一签名与第一随机数相关,所述第一随机数为所述应用服务器生成的随机数。
然后,所述应用服务器根据所述第一鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果,并向所述终端设备发送所述鉴权结果。例如,所述应用服务器对所述目标账号的证书和所述目标账号的证书的父证书进行验证。然后,所述应用服务器在所述目标账号的证书和所述目标账号的证书的父证书验证通过后,使用所述目标账号的证书对所述第一签名进行解密,得到所述第一随机数。若所述第一随机数未发生变化,则所述应用服务器确认所述终端设备鉴权通过。若所述第一随机数发生变化,则所述应用服务器确认所述终端设备鉴权失败。
可选的,所述目标账号的证书的签名数据中携带有所述目标账号的标识。也可以说,目标账号的标识携带在所述目标账号的证书的声明信息中。或者,所述第一鉴权请求消息还包括:所述目标账号的标识,所述第一签名与所述第一随机数和所述目标账号的标识相关。例如,目标账号的标识未携带在所述目标账号的证书的签名数据中(或者说目标账号的标识未携带在所述目标账号的证书的声明信息中),而是放在使用该目标账号的证书的私钥签名的数 据中。
第二种鉴权方式:应用服务器与终端设备之间可以采用双向鉴权的方式进行鉴权。
在该实现方式下,所述应用服务器基于终端设备登录目标应用的目标账号的证书,与所述终端设备进行鉴权交互,包括:
所述应用服务器接收来自所述终端设备的第二鉴权请求消息。其中,所述第二鉴权请求消息用于请求验证应用服务器的证书与所述目标账号的证书是否来自同一根证书。所述第二鉴权请求消息包括:所述目标账号的证书的信息、所述目标账号的标识、所述终端设备生成的第二随机数,所述目标账号的证书的信息用于指示签发所述目标账号的证书的根证书。
所述应用服务器根据所述第二鉴权请求消息,验证所述应用服务器的证书与所述目标账号的证书是否来自同一根证书。若所述应用服务器根据所述第二鉴权请求消息,确定应用服务器的证书与所述目标账号的证书来自同一根证书,则所述应用服务器向所述终端设备发送第三鉴权请求消息。其中,所述第三鉴权请求消息用于请求所述终端设备对所述应用服务器进行鉴权。所述第三鉴权请求消息包括:所述应用服务器的证书、使用所述应用服务器的证书的私钥签名得到的第二签名,所述第二签名与所述第二随机数和第三随机数相关,所述第三随机数为所述应用服务器生成的。
所述应用服务器接收所述终端设备在对所述应用服务器鉴权通过后发送的第四鉴权请求消息。其中,所述第四鉴权请求消息用于请求所述应用服务器对所述目标账号进行鉴权,所述第四鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第三签名,所述第三签名与所述第三随机数相关。
所述应用服务器根据所述第四鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果,并向所述终端设备发送所述鉴权结果。例如,所述应用服务器使用所述应用服务器的证书的根证书,对所述目标账号的证书和所述目标账号的证书的父证书进行验证。所述应用服务器在所述目标账号的证书和所述目标账号的证书的父证书验证通过后,使用所述目标账号的证书对所述第三签名进行解密,得到所述第三随机数,并从所述第四鉴权请求消息中获取所述目标账号的标识。若所述第三随机数未发生变化、且所述第四鉴权请求消息中携带的所述目标账号的标识与所述第二鉴权请求消息中携带的所述目标账号的标识相同,则所述应用服务器确认所述终端设备鉴权通过。若所述第三随机数发生变化,和/或,所述第四鉴权请求消息中携带的所述目标账号的标识与所述第二鉴权请求消息中携带的所述目标账号的标识不同,则所述应用服务器确认所述终端设备鉴权失败。
可选的,所述目标账号的证书的签名数据中携带有所述目标账号的标识。也可以说,目标账号的标识携带在所述目标账号的证书的声明信息中。或者,所述第四鉴权请求消息还包括:所述目标账号的标识,所述第三签名与所述第三随机数和所述目标账号的标识相关。例如,目标账号的标识未携带在所述目标账号的证书的签名数据中(或者说目标账号的标识未携带在所述目标账号的证书的声明信息中),而是放在使用所述目标账号的证书的私钥签名的数据中。
上述第二方面和第二方面的各可能的实现方式所提供的鉴权方法,其有益效果可以参见上述第一方面和第一方面的各可能的实现方式所带来的有益效果,在此不加赘述。
第三方面,本申请实施例提供一种鉴权方法,该方法中,安全服务器使用所述安全服务器的证书生成目标账号的证书和所述目标账号的证书的私钥。然后,所述安全服务器向终端设备发送所述目标账号的证书、所述目标账号的证书的私钥,以及,所述安全服务器的证书。
上述第三方面所提供的鉴权方法,其有益效果可以参见上述第一方面和第一方面的各可 能的实现方式所带来的有益效果,在此不加赘述。
第四方面,本申请实施例提供一种终端设备,所述终端设备包括:收发模块和处理模块。
收发模块,用于接收用户输入的初始鉴权请求消息,所述初始鉴权请求消息用于请求验证所述终端设备对应用的使用权限。
处理模块,用于使用所述终端设备登录所述应用的目标账号的证书,通过所述收发模块与所述应用服务器进行鉴权交互,所述目标账号的证书存储在所述终端设备的安全元件中。示例性的,所述目标账号为电话号码。
该鉴权交互可以包括如下两种鉴权方式:
第一种鉴权方式,应用服务器与终端设备之间采用单向鉴权的方式进行鉴权。
在该实现方式下,所述初始鉴权请求消息包括:所述应用服务器生成的第一随机数。所述处理模块,具体用于通过所述收发模块向所述应用服务器发送第一鉴权请求消息,并接收来自所述应用服务器响应所述第一鉴权请求消息的鉴权结果。其中,所述第一鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第一签名;所述第一签名与所述第一随机数相关。
可选的,所述目标账号的证书的签名数据中携带有所述目标账号的标识。也可以说,目标账号的标识携带在所述目标账号的证书的声明信息中。或者,所述第一鉴权请求消息还包括:所述目标账号的标识,所述第一签名与所述第一随机数和所述目标账号的标识相关。例如,目标账号的标识未携带在所述目标账号的证书的签名数据中(或者说目标账号的标识未携带在所述目标账号的证书的声明信息中),而是放在使用该目标账号的证书的私钥签名的数据中。
第二种鉴权方式:应用服务器与终端设备之间可以采用双向鉴权的方式进行鉴权。
在该实现方式下,所述处理模块,具体用于:
通过所述收发模块向应用服务器发送第二鉴权请求消息。其中,所述第二鉴权请求消息用于请求所述应用服务器验证应用服务器的证书与所述目标账号的证书是否来自同一根证书。所述第二鉴权请求消息包括:所述目标账号的证书的信息、所述目标账号的标识、所述处理模块生成的第二随机数,所述目标账号的证书的信息用于指示签发所述目标账号的证书的根证书。
通过所述收发模块接收所述应用服务器在应用服务器的证书与所述目标账号的证书来自同一根证书时发送的第三鉴权请求消息。其中,所述第三鉴权请求消息用于请求所述终端设备对所述应用服务器进行鉴权。所述第三鉴权请求消息包括:所述应用服务器的证书、使用所述应用服务器的证书的私钥签名得到的第二签名,所述第二签名与所述第二随机数和第三随机数相关,所述第三随机数为所述应用服务器生成的。
根据所述第三鉴权请求消息,对所述应用服务器鉴权。例如,使用所述目标账号的证书的根证书,对所述应用服务器的证书进行验证。在所述应用服务器的证书验证通过后,使用所述应用服务器的证书对所述第二签名进行解密,得到所述第二随机数和所述第三随机数。若所述第二随机数未发生变化,则确认所述应用服务器鉴权通过。
在所述应用服务器鉴权通过后,通过所述收发模块向所述应用服务器发送第四鉴权请求消息。其中,所述第四鉴权请求消息用于请求所述应用服务器对所述目标账号进行鉴权。所述第四鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第三签名;所述第三签名与所述第三随机数相关。
通过所述收发模块接收来自所述应用服务器响应所述第四鉴权请求消息的鉴权结果。
可选的,所述目标账号的证书的签名数据中携带有所述目标账号的标识。也可以说,目标账号的标识携带在所述目标账号的证书的声明信息中。或者,所述第四鉴权请求消息还包括:所述目标账号的标识,所述第三签名与所述第三随机数和所述目标账号的标识相关。例如,目标账号的标识未携带在所述目标账号的证书的签名数据中(或者说目标账号的标识未携带在所述目标账号的证书的声明信息中),而是放在使用所述目标账号的证书的私钥签名的数据中。
作为一种可能的实现方式,所述处理模块,还用于在根据所述终端设备登录所述应用的目标账号的证书,通过上述收发模块与所述应用服务器进行鉴权交互之前,在用户界面显示至少一个账号,并将用户在所述用户界面所选择的账号作为所述目标账号。
作为一种可能的实现方式,所述收发模块,还用于接收来自安全服务器的所述目标账号的证书和所述目标账号的证书的父证书,所述父证书为所述安全服务器的证书。
上述第四方面和第四方面的各可能的实现方式所提供的终端设备,其有益效果可以参见上述第一方面和第一方面的各可能的实现方式所带来的有益效果,在此不加赘述。
第五方面,本申请实施例提供了一种服务器,所述服务器为应用服务器,所述应用服务器包括:处理模块。可选的,所述应用服务器还可以包括收发模块。
处理模块,用于基于终端设备登录应用的目标账号的证书,与所述终端设备进行鉴权交互,验证所述终端设备对所述应用的使用权限。示例性的,所述目标账号为电话号码。
该鉴权交互可以包括如下两种鉴权方式:
第一种鉴权方式,应用服务器与终端设备之间采用单向鉴权的方式进行鉴权。
在该实现方式下,所述处理模块,具体用于通过收发模块接收来自所述终端设备的第一鉴权请求消息;根据所述第一鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果,并通过所述收发模块向所述终端设备发送所述鉴权结果。其中,所述第一鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第一签名;所述第一签名与第一随机数相关,所述第一随机数为所述应用服务器生成的随机数。例如,所述处理模块,具体用于对所述目标账号的证书和所述目标账号的证书的父证书进行验证,并在所述目标账号的证书和所述目标账号的证书的父证书验证通过后,使用所述目标账号的证书对所述第一签名进行解密,得到所述第一随机数。若所述第一随机数未发生变化,则确认所述终端设备鉴权通过,若所述第一随机数发生变化,则确认所述终端设备鉴权失败。
可选的,所述目标账号的证书的签名数据中携带有所述目标账号的标识。也可以说,目标账号的标识携带在所述目标账号的证书的声明信息中。或者,所述第一鉴权请求消息还包括:所述目标账号的标识,所述第一签名与所述第一随机数和所述目标账号的标识相关。例如,目标账号的标识未携带在所述目标账号的证书的签名数据中(或者说目标账号的标识未携带在所述目标账号的证书的声明信息中),而是放在使用该目标账号的证书的私钥签名的数据中。
第二种鉴权方式:应用服务器与终端设备之间可以采用双向鉴权的方式进行鉴权。
在该实现方式下,所述处理模块,具体用于:
通过所述收发模块接收来自所述终端设备的第二鉴权请求消息。其中,所述第二鉴权请求消息用于请求验证应用服务器的证书与所述目标账号的证书是否来自同一根证书。所述第二鉴权请求消息包括:所述目标账号的证书的信息、所述目标账号的标识、所述终端设备生成的第二随机数,所述目标账号的证书的信息用于指示签发所述目标账号的证书的根证书。
根据所述第二鉴权请求消息,验证所述应用服务器的证书与所述目标账号的证书是否来自同一根证书。若根据所述第二鉴权请求消息,确定应用服务器的证书与所述目标账号的证书来自同一根证书,则通过所述收发模块向所述终端设备发送第三鉴权请求消息。其中,所述第三鉴权请求消息用于请求所述终端设备对所述应用服务器进行鉴权。所述第三鉴权请求消息包括:所述应用服务器的证书、使用所述应用服务器的证书的私钥签名得到的第二签名,所述第二签名与所述第二随机数和第三随机数相关,所述第三随机数为所述应用服务器生成的。
通过所述收发模块接收所述终端设备在对所述应用服务器鉴权通过后发送的第四鉴权请求消息。其中,所述第四鉴权请求消息用于请求所述应用服务器对所述目标账号进行鉴权。所述第四鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第三签名;所述第三签名与所述第三随机数相关。
根据所述第四鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果,并通过所述收发模块向所述终端设备发送所述鉴权结果。例如,使用所述应用服务器的证书的根证书,对所述目标账号的证书和所述目标账号的证书的父证书进行验证。在所述目标账号的证书和所述目标账号的证书的父证书验证通过后,使用所述目标账号的证书对所述第三签名进行解密,得到所述第三随机数。从所述第四鉴权请求消息中获取所述目标账号的标识。若所述第三随机数未发生变化、且所述第四鉴权请求消息中携带的所述目标账号的标识与所述第二鉴权请求消息中携带的所述目标账号的标识相同,则确认所述终端设备鉴权通过。若所述第三随机数发生变化,和/或,所述第四鉴权请求消息中携带的所述目标账号的标识与所述第二鉴权请求消息中携带的所述目标账号的标识不同,则确认所述终端设备鉴权失败。
可选的,所述目标账号的证书的签名数据中携带有所述目标账号的标识。也可以说,目标账号的标识携带在所述目标账号的证书的声明信息中。或者,所述第四鉴权请求消息还包括:所述目标账号的标识,所述第三签名与所述第三随机数和所述目标账号的标识相关。例如,目标账号的标识未携带在所述目标账号的证书的签名数据中(或者说目标账号的标识未携带在所述目标账号的证书的声明信息中),而是放在使用所述目标账号的证书的私钥签名的数据中。
上述第五方面和第五方面的各可能的实现方式所提供的应用服务器,其有益效果可以参见上述第一方面和第一方面的各可能的实现方式所带来的有益效果,在此不加赘述。
第六方面,本申请实施例提供了一种服务器,所述服务器为安全服务器,所述安全服务器包括:处理模块和发送模块。
处理模块,用于使用所述安全服务器的证书生成目标账号的证书和所述目标账号的证书的私钥。
发送模块,用于向终端设备发送所述目标账号的证书、所述目标账号的证书的私钥,以及,所述安全服务器的证书。
上述第六方面所提供的安全服务器,其有益效果可以参见上述第一方面和第一方面的各可能的实现方式所带来的有益效果,在此不加赘述。
第七方面,本申请实施例提供一种终端设备,所述终端设备包括:处理器、存储器、接收器、发送器;所述接收器和所述发送器均耦合至所述处理器,所述处理器控制所述接收器的接收动作,所述处理器控制所述发送器的发送动作;
其中,存储器用于存储计算机可执行程序代码,程序代码包括指令;当处理器执行指令时,指令使所述终端设备执行如第一方面或第一方面的各可能的实现方式所提供的方法。
第八方面,本申请实施例提供一种服务器,所述服务器包括:处理器、存储器;
其中,存储器用于存储计算机可执行程序代码,程序代码包括指令;当处理器执行指令时,指令使所述服务器执行如第二方面或第二方面的各可能的实现方式所提供的方法,或者,执行如第三方面所提供的方法。
第九方面,本申请实施例提供一种通信装置,包括用于执行以上第一方面或第一方面各可能的实现方式所提供的方法的单元、模块或电路。该通信装置可以为终端设备,也可以为应用于终端设备的一个模块,例如,可以为应用于终端设备的芯片。
第十方面,本申请实施例提供一种通信装置,包括用于执行以上第二方面或第二方面各可能的实现方式或第三方面所提供的方法的单元、模块或电路。该通信装置可以为服务器,也可以为应用于服务器的一个模块,例如,可以为应用于服务器的芯片。
第十一方面,本申请实施例提供一种芯片,所述芯片上存储有计算机程序,在所述计算机程序被所述芯片执行时,实现如第一方面或第一方面的各可能的实现方式所提供的方法。
第十二方面,本申请实施例提供一种芯片,所述芯片上存储有计算机程序,在所述计算机程序被所述芯片执行时,实现如第二方面或第二方面的各可能的实现方式所提供的方法。
第十三方面,本申请实施例提供一种芯片,所述芯片上存储有计算机程序,在所述计算机程序被所述芯片执行时,实现如第三方面所提供的方法。
第十四方面,本申请实施例提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面或第一方面的各种可能的实现方式中的方法。
第十五方面,本申请实施例提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第二方面或第二方面的各种可能的实现方式中的方法。
第十六方面,本申请实施例提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第三方面的方法。
第十七方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面或第一方面的各种可能的实现方式中的方法。
第十八方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第二方面或第二方面的各可能的实现方式所提供的方法。
第十九方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第三方面所提供的方法。
第二十方面,本申请实施例提供一种通信系统,包括前述所描述的终端设备、应用服务器和安全服务器,其中,终端设备可以执行上述第一方面或第一方面的各种可能的实现方式中的方法,应用服务器可以执行上述第二方面或第二方面的各可能的实现方式所提供的方法,安全服务器可以执行上述第三方面所提供的方法。
本申请实施例提供的鉴权方法、设备及服务器,应用服务器可以通过存储在终端设备的安全元件中的账号的证书,对该账号进行鉴权,以验证使用终端设备的用户身份是否合法。因安全元件能够防止外部恶意解析攻击,保护其上的数据安全。因此,通过存储在终端设备的安全元件中的账号的证书对账号进行鉴权,可以确保鉴权的准确性、安全性、稳定性及鉴权效率,并且没有前述所说的现有的身份验证方法存在的局限性,能够满足用户实际使用时的需求。
附图说明
图1为本申请实施例涉及的eUICC系统架构示意图;
图2为现有的eUICC系统架构中的证书链的示意图;
图3为一种采用短信验证码进行验证的系统架构图;
图4为本申请实施例提供的eUICC系统架构中的证书链的示意图;
图5为本申请实施例提供的一种鉴权方法的流程图;
图6为本申请实施例提供的另一种鉴权方法的流程图;
图7为本申请实施例提供的又一种鉴权方法的流程图;
图8为本申请实施例提供的又一种鉴权方法的流程图;
图9为本申请实施例提供的又一种鉴权方法的流程图;
图10为本申请实施例提供的又一种鉴权方法的流程图;
图11为本申请实施例提供的一种终端设备的结构示意图;
图12为本申请实施例提供的一种服务器的结构示意图;
图13为本申请实施例提供的另一种服务器的结构示意图;
图14为本申请实施例提供的一种终端设备的结构示意图;
图15为本申请实施例提供的又一种服务器的结构示意图。
具体实施方式
用户在使用终端设备时,需要在移动网络运营商(mobile network operator,MNO)处购买用户身份识别模块(subscriber identification module,SIM)卡。该SIM卡存储有MNO提供的用户的签约信息、加密的密钥等,可供MNO对用户进行身份鉴别,以判断用户是否有权使用该运营商提供的通信服务。
随着技术和需求的演进,提出了一种嵌入式通用集成电路卡(embedded universal integrated circuit card,eUICC),也称为嵌入式SIM(embedded SIM,eSIM)卡。该eUICC是一种可由多个MNO远程管理签约用户的安全元件,可通过插拔的方式或焊接的方式放入终端设备中,实现终端设备的通信功能。即,eUICC可以是单个芯片形态嵌入在终端设备中,或者,eUICC可以作为终端设备中其他单个芯片的一部分嵌入在终端设备中,或者,eUICC可以是可移动的卡片形态(即SIM卡形态)插入终端设备中。
上述eUICC中可以安装有至少一个MNO的电话号码的配置文件(Profile)。其中,每个电话号码对应一个Profile。每个电话号码的Profile可以包括:MNO数据和应用的集合等。这里所说的MNO数据例如可以包括网络接入参数(例如密钥参数Ki),国际移动用户识别码(international mobile subscriber identity,IMSI)、移动网络运营商安全域(mobile network operator-security domain,MNO-SD)、补充安全域(supplementary security domains,SSD)、控制权安全域(controlling authority security domain,CASD)、应用(例如近场通信(near field communication,NFC)应用等)、JAVA卡程序、文件系统中的其他元素以及配置文件元数据等。其中,IMSI和Ki的对应关系用于识别请求网络鉴权的用户的身份。在一些实施例中,Profile也可以叫做签约数据集。
当eUICC安装有多个MNO的电话号码的配置文件(Profile)时,用户可以根据自己需求,激活一个电话号码的配置文件(Profile)。这样,用户可以通过该电话号码实现终端设备的通信功能。
下面结合图1所示的系统架构示意图,对如何为eUICC提供配置文件进行示例说明。图1为本申请实施例涉及的eUICC系统架构示意图。如图1所示,该系统包括:签约管理-数据准备(subscription manager-data preparation,SM-DP)+服务器、MNO服务器、终端设备、CI服务器、eUICC制造商(eUICC manufacturer,EUM)服务器、签约管理发现服务(subscription manager-discovery service,SM-DS)服务器。
其中,SM-DP+服务器,用于根据MNO服务器提供的基本签约信息(例如国际移动用户识别码(international mobile subscriber identity,IMSI)等),生成该MNO的电话号码的配置文件(Profile),该Profile可以下载到eUICC上。在一些实施例中,SM-DP+服务器也称为Profile供应商(provisioner)或Profile下载服务器。应理解,在图1所示的系统架构中,可以包括一个或多个SM-DP+服务器,该一个或多个SM-DP+服务器为同一MNO对应的服务器。图1是以一个SM-DP+服务器为例的示意图。
终端设备包括eUICC和本地配置文件助手(local profile assistant,LPA)。LPA可以看作是一个应用程序,是SM-DP+服务器与eUICC之间通信的桥梁。一方面,LPA用于管理Profile的下载。以LPA安装在终端设备上为例,终端设备通过LPA,先从SM-DS服务器获取SM-DP+服务器地址。然后,终端设备通过LPA从SM-DP+服务器地址对应的SM-DP+服务器中获取加密的Profile。终端设备可以将该加密的Profile转发给eUICC。eUICC解密Profile后,将该Profile安装在eUICC中。另一方面,LPA可以提供用户界面(user interface,UI)给用户,以使用户可以通过UI管理eUICC上的Profile。例如,用户可以通过UI激活eUICC上的Profile、去激活eUICC上的Profile、删除eUICC上的Profile等。需要说明是,当终端设备的eUICC从SM-DP+服务器中获取到相应的Profile,并被激活后才可以被终端设备所使用,例如上网、打电话等通信功能。应理解,当eUICC中需要安装多个MNO的电话号码的Profile时,需要从每个MNO对应的SM-DP+服务器中获取该MNO的电话号码的Profile,对此不再赘述。
LPA可以安装在终端设备上,也可以安装在eUICC上。当LPA安装在终端设备时,LPA可以视为一个装置(device),简称LPAd。作为一种可能的实现方式,LPAd可以包括本地发现服务装置(local discovery service,LDSd)、本地数据下载装置(local data download device,LPDd)、本地用户界面装置(local user interface,LUId)。其中,LUId用于为用户提供UI,LDSd用于与SM-DS服务器进行交互,LPDd用于与SM-DP+服务器进行交互。
当LPA安装在eUICC上时,可以包括本地发现服务(local discovery service,LDS)、本地数据下载(local data download device,LPD)、本地用户界面(local user interface,LUI)。其中,LUI用于为用户提供UI,LDS用于与SM-DS服务器进行交互,LPD用于与SM-DP+服务器进行交互。
应理解,本申请实施例所涉及的终端设备也可以称为终端Terminal、用户设备(user equipment,UE)、移动台(mobile station,MS)、移动终端(mobile terminal,MT)等。终端设备可以是手机(mobile phone)、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(Virtual Reality,VR)终端设备、增强现实(Augmented Reality,AR)终端设备、工业控制(industrial control)中的无线终端、无人驾驶(self driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端等等。
在全球移动通信系统协会(global system for mobile communications association,GSMA)的远程SIM卡供应(remote SIM provisioning,RSP)体系中,证书是是必不可少的重要组成 部分,主要目的在于进行身份的验证、交互的鉴权。下面结合图2为所示的证书链,对本申请实施例所涉及的系统架构中现有的证书的签发进行说明和介绍。
图2为现有的eUICC系统架构中的证书链的示意图。如图2所示,CI服务器用于签名和颁发(简称:签发)GSMA CI证书(该证书的名称例如可以为CERT.CI.ECDSA)、EUM证书(该证书的名称例如可以为CERT.EUM.ECDSA)、SM-DP+服务器证书、SM-DS服务器证书等。EUM服务器用于为EUM生产的eUICC签名和颁发eUICC证书(该证书的名称例如可以为CERT.EUICC.ECDSA),并将EUM证书预置在eUICC中。这样,在进行RSP业务时,各个实体之间使用GSMA根证书来相互验证对方证书的合法性。
其中,GSMA CI证书为整个RSP体系的根证书,EUM证书为EUM服务器的证书,该EUM证书由根证书生成。SM-DP+服务器证书由根证书生成,可以包括SM-DP+服务器的验证证书(该证书的名称例如可以为CERT.DPauth.ECDSA)、SM-DP+服务器的传输层安全(transport layer security,TLS)证书(该证书的名称例如可以为CERT.DP.TLS)和SM-DP+服务器中用于为Profile加密的加密证书(该证书的名称例如可以为CERT.DPpb.ECDSA)。SM-DS服务器证书由根证书生成,可以包括:SM-DS服务器的验证证书(该证书的名称例如可以为CERT.DSauth.ECDSA)、SM-DS服务器的TLS证书(该证书的名称例如可以为CERT.DS.TLS)。
上述图2所示的证书链中,各证书包含公钥和身份信息,证书用于加密,可以对外公开。每个证书具有对应的私钥,私钥用于签名,不对外公开。应理解,上述图2中示出的各证书的名称,以及,各证书的公钥和私钥的名称仅是一种示意,本申请实施例对各证书的名称,以及,各证书的公钥和私钥的名称并不进行限定。
在上述图1所示的系统架构中,SM-DP+服务器与MNO服务器可通过ES2+接口通信,MNO服务器和eUICC之间可通过ES6接口通信,SM-DP+服务器与LPA之间可以通过ES9+接口通信;LPA与eUICC可以通过ES10a、ES10b以及ES10c等接口进行通信;SM-DP+服务器与eUICC之间可以通过ES8+接口进行通信;SM-DP+服务器与SM-DS之间可以通过ES12接口进行通信;SM-DS之间可以通过ES15接口进行通信;SM-DS与LPA可以通过ES11接口进行通信。
随着移动互联网的普及,通讯、支付、娱乐等应用风靡终端设备。传统的密码验证,已经难以应对复杂的网络环境。因此,网络安全也成为了行业焦点。目前,用户在终端设备上,使用eUICC上的电话号码登录或注册某一应用时,应用服务器通常采用如下三种方式对该电话号码进行验证,以对使用终端设备的用户进行身份验证。应理解,这里所说的验证也可以称为对使用终端设备的用户进行鉴权。即,鉴别用户对该应用的使用权限。在本申请实施例中,验证和鉴权的含义等同,本申请实施例对此不进行区分。
第一种方式:应用服务器使用动态口令对使用终端设备的用户进行验证。
动态口令是根据特定的算法生成一个不可预测的随机数字组合,每个密码只能使用一次。当前最广为人知的动态口令是短信验证码。图3为一种采用短信验证码进行验证的系统架构图。如图3所示,该系统架构包括:应用服务器(例如web服务器)、第三方平台服务器、MNO服务器、终端设备。
在用户操作终端设备登录或注册应用时,应用服务器基于短信验证码进行验证的流程如下:
步骤一、应用服务器可以通过例如随机函数生成短信验证码。
步骤二、应用服务器向第三方平台服务器发送该短信验证码。
步骤三、第三方平台服务器向MNO服务器发送请求消息,所述请求消息用于请求向终端设备发送该短信验证码。
步骤四、MNO服务器通过短信向终端设备发送该短信验证码。
步骤五、MNO服务器向第三方平台服务器发送状态码,所述状态码用于指示短信验证码发送成功。
步骤六、第三方平台服务器向应用服务器转发该状态码。
步骤七、应用服务器存储该终端设备与该短信验证码的映射关系。
步骤八、终端设备向应用服务器发送登录请求或注册请求,该登录请求或注册请求携带用户手动输入的短信验证码。
步骤九、应用服务器对比终端设备的登录请求或注册请求中的短信验证码,以及,应用服务器自己存储的终端设备对应的短信验证码是否一致。若一致,则应用服务器确定使用终端设备的用户身份验证通过。若不一致,则应用服务器确定使用终端设备的用户身份验证失败。
应理解,短信验证码一般在应用服务器中只存储预设时长(例如60秒),超过预设时长后,短信验证码会过期失效,应用服务器会删除该短信验证码。
应用服务器在采用该方式对使用终端设备的用户进行验证时,存在如下问题:
1、短信接收存在时延。
2、操作不便利。原因如下:需要用户手动输入短信验证码。
3、可靠性低。原因如下:短信存在丢失的情况,另外,当终端设备欠费、或者终端设备位于无运营商的网络信号的区域时,终端设备无法接收到短信,进而无法进行验证。
4、安全性较差。原因如下:短信验证码需要第三方平台介入,存在短信嗅探、劫持等问题,容易被病毒、木马从终端设备中获取该短信验证码。
第二种方式:应用服务器通过生物识别,对使用终端设备的用户进行验证。
生物识别是指利用人体固有的生理特性(例如指纹、脸象、虹膜等)和行为特征(例如笔迹、声音、步态等)来进行验证。目前,常见的生物识别有人脸识别和指纹识别。
在应用服务器在采用该方式对使用终端设备的用户进行验证时,存在如下问题:
1、生物特征存在伪造的风险。例如,指纹可以被复制。
2、验证方的问题。即,存在由谁验证的问题。若由应用服务器验证,需要上传生物特征到应用服务器。但是,当前各应用服务器的安全性良莠不齐,存在“盗库”和生物特征被非法使用的风险。若由终端设备自己验证,则应用服务器也无法做到完全信赖终端设备提供的验证结果。
第三种方式:应用服务器通过U盾(USB key),对使用终端设备的用户进行验证。
USB Key是一种USB接口的硬件设备。它内置单片机或智能卡芯片,有一定的存储空间,可以存储由应用服务器下发的用户的私钥以及数字证书。应用服务器可以利用USB Key内置的公钥算法对用户的身份进行验证。
应用服务器在采用该方式对使用终端设备的用户进行验证时,存在如下问题:
1、使用场景受限。原因如下:因USB Key需要通过USB接口接入终端设备,从而才能使应用服务器利用该USB Key对用户的身份进行验证,因此,该验证方式一般只有在具有雨USB Key匹配的USB接口的个人计算机(personal computer,PC)上使用,无法在无USB Key匹配 的USB接口的终端设备(例如手机、PAD等)上使用。
2、USB key是一种独立于终端设备的硬件设备,使用不便利。若用户忘记携带USB key,则无法进行身份验证。
3、通用性差。原因如下:目前一个USB Key只支持一个应用,即,一个应用一个USB Key,导致USB Key的通用性差。
通过上述描述可以看出,现有的这些身份验证方式都有其自身的局限性,无法满足用户实际使用时的需求。因此,用户在终端设备上使用eUICC上的电话号码登录或注册某一应用时,应用服务器如何快速、安全的对用户进行身份验证是一个亟待解决的问题。
考虑到上述问题,本申请实施例提供了一种鉴权方法,应用服务器可以通过存储在终端设备的安全元件中的账号的证书,对该账号进行鉴权,以验证使用终端设备的用户身份是否合法。因安全元件能够防止外部恶意解析攻击,保护其上的数据安全。因此,通过存储在终端设备的安全元件中的账号的证书对账号进行鉴权,可以确保鉴权的准确性、安全性、稳定性及鉴权效率,并且没有前述所说的现有的身份验证方法存在的局限性,能够满足用户实际使用时的需求。这里所说的账号可以为任一具有Profile的账号,例如:电话号码等。
应理解,本申请实施例提供的鉴权方法,可以适用于应用服务器需要对使用终端设备的用户进行身份验证的任一场景。例如,用户在终端设备上,使用账号登录应用的场景、使用账号注册应用的场景,使用应用的支付功能的场景(此时用户已使用账号登录该应用)等。
上述所说的安全元件(secure element,SE)可以是能够使终端设备实现通信功能的元件,例如,SIM、eUICC等。以eUICC为例,则本申请实施例中所涉及的账号为电话号码。则账号的证书可以为电话号码的Profile证书。
在本实施例中,终端设备的安全元件中的账号的证书可以由安全服务器生成。以安全元件为eUICC、账号为电话号码、账号的证书为电话号码的Profile证书为例,这里所说的安全服务器例如可以为SM-DP+服务器、SM-DP服务器、SM-DS服务器等中任一个。需要说明的是,SM-DP+服务器是SM-DP服务器的演进,在本申请实施例中,SM-DP+服务器与SM-DP服务器等同,本申请实施例对此不进行区分。
终端设备的安全元件中的账号的证书和该证书的私钥可以预置在安全元件中,也可以由安全服务器发送给终端设备的安全元件。例如,安全服务器可以使用所述安全服务器的证书生成目标账号的证书和该目标账号的证书的私钥,并向终端设备发送所述目标账号的证书和该目标账号的证书的私钥,以及,所述安全服务器的证书。相应地,终端设备接收该所述目标账号的证书和该目标账号的证书的私钥,以及,所述安全服务器的证书,并存储在所述终端设备的安全单元中。
下面以安全元件为eUICC、账号为电话号码、安全服务器为SM-DP+服务器、账号的证书为电话号码的Profile证书为例,对安全服务器如何向安全元件签发电话号码的Profile证书进行介绍:
图4为本申请实施例提供的eUICC系统架构中的证书链的示意图。如图4所示,本申请实施例所提供的证书链相比现有技术中的证书链(即图2所示的证书链),新增了SM-DP+服务器的证书至Profile证书的分支。即,SM-DP+服务器可以根据MNO服务器的需求,使用自己的证书(例如验证证书)为SM-DP+服务器对应的电话号码的Profile生成Profile证书和该Profile证书的私钥,并为该电话号码的Profile签发Profile证书和该Profile证书的私钥。也就是说,MNO服务器控制SM-DP+服务器是否为Profile生成证书和该Profile证书的私钥。
Profile证书的声明信息(也可以称为证书颁发者对证书的签名数据)可以包括该Profile 对应的电话号码、IMSI、集成电路卡识别码(integrate circuit card identity,ICCID)、用户的身份标识(identification,ID)等至少一项信息。在本申请实施例中,该至少一项信息可以作为声明Profile的唯一标识符。通过Profile证书的声明信息中声明Profile的唯一标识符,可以建立Profile证书和Profile的一一对应关系。例如,该唯一标识符可以是ICCID、IMSI、用户的ID等至少一项。
作为一种可能的实现方式,Profile证书和该Profile证书的私钥可以由SM-DP+服务器生成该Profile时同步生成,并和SM-DP+服务器的证书、Profile一同下载到eUICC上。例如,将Profile证书和该Profile证书的私钥下载到eUICC上专门用于存储eUICC相关证书的安全域中,或者,将Profile证书和该Profile证书的私钥下载到eUICC上,作为Profile的元数据存储。在该实现方式下,MNO服务器可以通过空中下载技术(over-the-air technology,OTA)的形式,对Profile证书进行管理。例如,Profile证书更新、Profile证书删除等管理操作。应理解,上述所说的Profile证书的管理操作,也可以由eUICC系统架构中的其他实体根据MNO服务器的管理需求来实现,例如,SM-DP+服务器、SM-DS服务器等。
作为另一种可能的实现方式,在将Profile下载到eUICC上后,该Profile对应的MNO通过OTA,将Profile证书和该Profile证书的私钥下发到eUICC上。在该场景下,MNO服务器可以通过OTA的形式,对Profile证书进行管理。例如,Profile证书下发、Profile证书更新、Profile证书删除等管理操作。应理解,上述所说的Profile证书的管理操作,也可以由eUICC系统架构中的其他实体根据MNO服务器的管理需求来实现,例如,SM-DP+服务器、SM-DS服务器等。
需要说明的是,当一个电话号码变更了Profile时,可以注销该电话号码旧的Profile证书。当删除eUICC内的一个Profile时,Profile证书可被同步删除,无需单独对Profile证书执行删除操作。应理解,该删除Profile操作可以是由用户通过终端设备的LPA实现的删除操作,还可以是MNO服务器通过OTA执行的删除Profile操作,还可以是SM-DP+服务器远程执行的删除操作。
可选的,在一些实施例中,上述Profile证书内或者终端设备的LPA还可以预置用户的昵称、生日、邮箱等账号信息,以供应用使用。另外,若用户是实名认证用户,则上述Profile证书内还可以预置有用户的身份证等信息。Profile证书内具体预置什么信息可以根据实际使用的需求确定,对此不再赘述。
应理解,上述图4中示出的各证书的名称,以及,各证书的公钥和私钥的名称仅是一种示意,本申请实施例对各证书的名称,以及,各证书的公钥和私钥的名称并不进行限定。另外,图4所示的证书链中,MNO服务器管理Profile证书仅是一种实现方式。具体实现时,可以是由Profile的任意拥有者(即Profile owner)管理Profile证书,本申请实施例对此不再进行赘述。
下面通过一些实施例对应用服务器如何通过存储在终端设备的安全元件中的账号的证书,对该账号进行鉴权进行详细说明。下面这几个实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例不再赘述。
图5为本申请实施例提供的一种鉴权方法的流程图。如图5所示,该方法包括:
S101、终端设备接收用户输入的初始鉴权请求消息。
其中,所述初始鉴权请求消息用于请求验证所述终端设备对应用的使用权限。该应用为任一可以使用账号进行登录的应用。
以用户登录应用的场景为例,则上述初始鉴权请求消息可以为用户在终端设备的用户界 面上,点击应用的登录按钮所生成的初始鉴权请求消息(也可以称为登录请求消息)。以用户注册应用的场景为例,则上述初始鉴权请求消息例如可以为用户在终端设备的用户界面上,点击应用的注册按钮所生成的初始鉴权请求消息(也可以称为注册请求消息)。以用户使用应用的支付功能场景,则上述初始鉴权请求消息可以为用户点击跳转至该应用的支付页面的按钮所生成的初始鉴权请求消息(也可以称为跳转支付页面的请求消息)。
S102、所述终端设备使用所述终端设备登录所述应用的目标账号的证书,与所述应用服务器进行鉴权交互。
即,所述应用服务器基于终端设备登录应用的目标账号的证书,与所述终端设备进行鉴权交互,验证所述终端设备对所述应用的使用权限。
其中,所述目标账号的证书存储在所述终端设备的安全元件中。可选的,若上述终端设备的安全元件中仅存储有一个账号,以及该账号的证书,则该账号即为目标账号。若上述终端设备的安全元件中存储有多个账号,以及,该多个账号的证书,则上述所说的目标账号可以为该多个账号中的任一个。例如,该目标账号可以为终端设备从多个账号中随机选择的一个账号,也可以为用户从多个账号中选择的一个账号。
作为一种可能的实现方式,在步骤S102之前,所述终端设备可以在用户界面显示至少一个账号,并将用户在所述用户界面所选择的账号作为所述目标账号。应理解,该至少一个账号和该至少一个账号的证书均存储在终端设备的安全元件中。示例性的,以安全元件为eUICC为例,则终端设备例如可以通过LPA为用户提供选择目标账号的用户界面,其实现方式可以参见现有技术,对此不再赘述。
在本实施例中,终端设备在接收到用户输入的初始鉴权请求消息之后,可以使用存储在所述终端设备的安全元件中的目标账号的证书,与所述应用服务器进行鉴权交互,以使应用服务器验证所述终端设备对应用的使用权限。对于该鉴权交互,包括如下两种鉴权方式:
第一种鉴权方式:应用服务器与终端设备之间采用单向鉴权的方式进行鉴权。即,应用服务器基于目标账号的证书,对目标账号进行验证,而终端设备无需对应用服务器进行验证。应理解,在使用单向鉴权的方式进行鉴权时,不限定应用服务器上是否存在应用服务器的证书。即便应用服务器上存在应用服务器的证书,也不限定该证书与目标账号是否来自同一根证书。
第二种鉴权方式:应用服务器与终端设备之间可以采用双向鉴权的方式进行鉴权。即,应用服务器基于目标账号的证书,对目标账号进行验证,终端设备基于应用服务器的证书,对应用服务器进行验证。应理解,在使用双向鉴权的方式进行鉴权时,应用服务器上需要有应用服务器的证书,且应用服务器的证书与目标账号的证书来自同一根证书。继续参照图4所示的证书链,以安全元件为eUICC、目标账号为eUICC上的电话号码为例,则应用服务器的证书和该证书的私钥可以由CI服务器签发。
作为一种可能的实现方式,对于使用哪种鉴权方式,可以根据应用服务器是否存在证书确定。例如,当应用服务器上无应用服务器的证书时,可以采用单向鉴权的方式进行鉴权。当应用服务器上存储有应用服务器的证书时,可以选择双向鉴权的方式进行鉴权,也可以选择单向鉴权的方式进行鉴权。示例性的,终端设备与应用服务器在鉴权之前可以进行协商,以确定采用哪种鉴权方式进行鉴权。或者,终端设备与应用服务器在鉴权之前,接收应用服务器发送的指示信息,该指示信息用于指示双方采用哪种鉴权方式进行鉴权。该指示信息例如可以通过指示应用服务器是否有证书来隐式的指示双方采用哪种鉴权方式进行鉴权。该指示信息例如可以通过指示应用服务器有证书来隐式的指示双方采用双向鉴权方式进行鉴权, 或者,该指示信息例如可以通过指示应用服务器无证书来隐式的指示双方采用单向鉴权方式进行鉴权。
下面基于上述两种鉴权方式,对终端设备如何使用目标账号的证书,与应用服务器进行鉴权交互进行详细说明。
图6为本申请实施例提供的另一种鉴权方法的流程图。本实施例涉及的是应用服务器与终端设备之间采用单向鉴权的方式进行鉴权的过程。即,应用服务器对终端设备的账号的证书的有效性和合法性进行验证,并通过随机数验证终端设备的账号的证书的私钥,以确定终端设备是否为该证书的合法持有者。
在本实施例中,所述初始鉴权请求消息包括:所述应用服务器生成的第一随机数。该第一随机数可以为所述应用服务器采用预设随机函数生成的随机数。该第一随机数例如可以为双方协商鉴权方式时,应用服务器发送给终端设备的。本申请实施例对第一随机数的长度不进行限定。例如,该第一随机数可以为16字节的随机数。
如图6所示,上述步骤S102可以包括:
S201、所述终端设备向所述应用服务器发送第一鉴权请求消息。
相应地,应用服务器接收该第一鉴权请求消息。其中,所述第一鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第一签名。所述第一签名与所述第一随机数相关。即,第一签名可以为根据该第一随机数得到。示例性的,该第一签名例如可以为使用目标账号的证书的私钥对第一随机数加密得到的签名。或者,该第一签名例如可以为使用目标账号的证书的私钥对第一随机数和其他预设随机数的运算结果进行加密得到的签名。例如,第一随机数和其他预设随机数之和、第一随机数和其他预设随机数之积、第一随机数和其他预设随机数之差等。
以账号为电话号码,安全元件为eUICC、安全服务器为SM-DP+服务器为例,则上述目标账号的证书可以为目标电话号码的Profile证书,目标账号的证书的父证书可以为生成该Profile证书的SM-DP+服务器的证书(例如SM-DP+服务器的验证证书)。
S202、所述应用服务器根据所述第一鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果。
在本步骤中,所述应用服务器可以先对所述目标账号的证书和所述目标账号的证书的父证书进行验证。例如,所述应用服务器可以采用现有的证书链验证证书的方式,对所述目标账号的证书和所述目标账号的证书的父证书进行验证。即,所述应用服务器可以先用根证书验证所述目标账号的证书的父证书的合法性和有效性。若所述目标账号的证书的父证书合法且有效,则所述应用服务器可以使用所述目标账号的证书的父证书,验证所述目标账号的证书的合法性和有效性。若所述目标账号的证书合法且有效,则应用服务器可以确认所述目标账号的证书和所述目标账号的证书的父证书验证通过,否则,应用服务器可以确认所述目标账号的证书和所述目标账号的证书的父证书验证失败。
所述应用服务器在所述目标账号的证书和所述目标账号的证书的父证书验证通过后,可以使用所述目标账号的证书对所述第一签名进行解密,得到所述第一随机数。若解密所得到的第一随机数与所述应用服务器生成的第一随机数相同,即解密得到的第一随机数未发生变化,说明终端设备是该证书的合法持有者,则所述应用服务器确认所述终端设备鉴权通过。若解密所得到的第一随机数与所述应用服务器生成的第一随机数不同,即解密得到的第一随机数发生了变化,说明终端设备不是该证书的合法持有者(即终端设备是该证书的非法持有者),则所述应用服务器确认所述终端设备鉴权失败。
应理解,这里所说的终端设备鉴权通过可以称为使用终端设备的用户身份验证通过,也可以称为目标账号的鉴权通过。这里所说的终端设备鉴权失败可以称为使用终端设备的用户身份验证失败,也可以称为目标账号的鉴权失败。应理解,这里所说的验证也可以称为对使用终端设备的用户进行鉴权。即,鉴别用户对该应用的使用权限。在本申请实施例中,验证和鉴权的含义等同,本申请实施例对此不进行区分。
在另一可能的实现方式中,所述应用服务器可以先使用所述目标账号的证书对所述第一签名进行解密,得到所述第一随机数。若解密所得到的第一随机数与所述应用服务器生成的第一随机数相同,即解密得到的第一随机数未发生变化,则所述应用服务器进一步地对所述目标账号的证书和所述目标账号的证书的父证书进行验证。若验证通过,则确认所述终端设备鉴权通过。若验证失败,则确认所述终端设备鉴权失败。若解密所得到的第一随机数与所述应用服务器生成的第一随机数不同,即解密得到的第一随机数发生了变化,则所述应用服务器直接确认所述终端设备鉴权失败。
S203、所述应用服务器向所述终端设备发送所述鉴权结果。
相应地,所述终端设备接收所述应用服务器响应所述第一鉴权请求消息的鉴权结果。在该场景下,终端设备可以通过用户界面向用户显示该鉴权结果。
可选的,所述目标账号的证书的签名数据中携带有所述目标账号的标识。该目标账号的标识可以能够唯一的标识该目标账号。以目标账号为电话号码为例,则目标账号的标识例如可以为电话号码本身,也可以为ICCID和/或IMSI等能够转换为电话号码的标识。在该实现方式下,所述应用服务器在对终端设备鉴权通过后,可以从目标账号的证书声明信息中获取该目标账号的标识,进而获取该目标账号。
在另一实现方式中,所述目标账号的证书的签名数据中不携带所述目标账号的标识,而是所述第一鉴权请求消息中携带所述目标账号的标识。即,所述第一鉴权请求消息还包括所述目标账号的标识。则在该实现方式下,所述第一签名可以与所述第一随机数和所述目标账号的标识相关。即,所述第一签名为根据第一随机数和所述目标账号的标识得到的。
例如,第一签名(即signature)可以为signature(第一随机数,目标账号的标识)。则在该实现方式下,所述应用服务器在所述目标账号的证书和所述目标账号的证书的父证书验证通过后,可以使用所述目标账号的证书对所述第一签名进行解密,得到所述第一随机数和目标账号的标识。若解密所得到的第一随机数与所述应用服务器生成的第一随机数相同、且解密所得到的目标账号的标识与第一鉴权请求消息中携带的目标账号的标识相同,即解密得到的第一随机数和目标账号的标识均未发生变化,说明终端设备是该证书的合法持有者,则所述应用服务器确认所述终端设备鉴权通过。若解密所得到的第一随机数与所述应用服务器生成的第一随机数不同,和/或,解密所得到的目标账号的标识与第一鉴权请求消息中携带的目标账号的标识不同,即解密得到的第一随机数和/或目标账号的标识发生了变化,说明终端设备不是该证书的合法持有者(即终端设备是该证书的非法持有者),则所述应用服务器确认所述终端设备鉴权失败。
或者,所述应用服务器可以使用所述目标账号的证书对所述第一签名进行解密,得到所述第一随机数和目标账号的标识。若解密所得到的第一随机数与所述应用服务器生成的第一随机数相同、且解密所得到的目标账号的标识与第一鉴权请求消息中携带的目标账号的标识相同,即解密得到的第一随机数和目标账号的标识均未发生变化,则所述应用服务器进一步地对所述目标账号的证书和所述目标账号的证书的父证书进行验证。若验证通过,则确认所述终端设备鉴权通过。若验证失败,则确认所述终端设备鉴权失败。若解密所得到的第一随 机数与所述应用服务器生成的第一随机数不同,和/或,解密所得到的目标账号的标识与第一鉴权请求消息中携带的目标账号的标识不同,即解密得到的第一随机数和/或目标账号的标识发生了变化,则所述应用服务器直接确认所述终端设备鉴权失败。
在上述实现方式中,应用服务器在对终端设备鉴权通过后,可以从第一鉴权请求消息中获取该目标账号。
所述应用服务器根据所述第一鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果之后,可以向所述终端设备发送所述鉴权结果。
以用户登录应用的场景为例,在所述终端设备鉴权通过时,所述应用服务器可以使用所述目标账号登录所述应用,并向终端设备发送鉴权通过的鉴权结果。在所述终端设备鉴权失败时,所述应用服务器可以拒绝使用所述目标账号登录所述应用,并向终端设备发送鉴权失败的鉴权结果。例如,可以通过登录成功或登录失败来指示该鉴权结果。
以用户注册应用的场景为例,在所述终端设备鉴权通过时,所述应用服务器可以创建所述终端设备登录所述应用的账号(即目标账号),并向终端设备发送注册成功的鉴权结果。或者,在所述终端设备鉴权通过时,所述应用服务器可以创建所述终端设备登录所述应用的账号(即目标账号),使用所述目标账号登录所述应用,并向终端设备发送注册和登录成功的鉴权结果。在所述终端设备鉴权失败时,所述应用服务器可以拒绝为所述终端设备创建登录所述应用的账号,并向终端设备发送注册失败的鉴权结果。
以用户使用应用的支付功能场景,在所述终端设备鉴权通过时,所述应用服务器可以向终端设备推送显示该应用的支付页面的数据流,并向终端设备发送验证成功的鉴权结果。在一些实施例中,上述应用服务器也可以不单独发送鉴权结果,而是通过推送显示该应用的支付页面的数据流间接的指示所述终端设备鉴权通过。在所述终端设备鉴权失败时,所述应用服务器可以不向终端设备推送显示该应用的支付页面的数据流,并向终端设备发送验证失败的鉴权结果。
下面以安全元件为eUICC、安全服务器为SM-DP+服务器、账号为电话号码、账号的证书为电话号码的Profile证书、用户使用电话号码登录应用为例,对本申请实施例提供的单向鉴权方法进行示例说明。
下述实施例中,将SM-DP+服务器的证书称为CERT_DP,使用该CERT_DP生成的Profile证书称为CERT_PF,第一随机数为R1。
为了便于理解,下述实施例分别从应用、LPA、eUICC、应用服务器四者交互的角度进行了描述。应理解,上述应用的动作可以是由终端设备的处理器执行所实现的(例如,终端设备的应用处理器)。上述LPA的动作也可以是由终端设备的处理器执行所实现的。在该实现方式下,LPA和eUICC可以位于同一终端设备中,也可以在不同终端设备中,即为同一用户所拥有的不同终端设备。例如,LPA位于用户所拥有的手机中,eUICC位于用户所拥有的可穿戴设备(例如手环)中。当LPA和eUICC位于同一终端设备中时,LPA可以是安装在终端设备上的独立应用,也可以是安装在eUICC上的应用。
示例一、Profile证书的声明信息(即证书颁发者对证书的签名数据)中携带有该profile的电话号码的标识。
图7为本申请实施例提供的又一种鉴权方法的流程图。如图7所示,该方法包括:
S301、应用向LPA发送使用eUICC登录的登录请求消息。
其中,该登录请求消息可以携带有R1。在本示例中,该登录请求消息即为前述所说的初始鉴权请求消息。该登录请求消息可以为用户点击应用的注册或登录按钮所触发的登录请求消息。
可选的,在步骤S301之前,应用在用户点击应用的注册或登录按钮后,与应用服务器协商采用哪种鉴权方式进行鉴权。当双方协商确定采用单向鉴权方式进行鉴权时,应用可以接收到应用服务器发送的R1。
S302、LPA向eUICC发送鉴权申请消息。
其中,该鉴权申请消息可以包括:目标电话号码和R1。其中,该目标电话号码用于登录该应用。
可选的,LPA在向eUICC发送鉴权申请消息之前,可以在用户界面上显示eUICC中的至少一个电话号码,以由用户选择使用哪个电话号码登录该应用。然后,LPA可以将用户在所述用户界面所选择的电话号码作为目标电话号码。
应理解,若LPA和eUICC位于同一终端设备中,且LPA是安装在eUICC上的应用,则上述步骤S301和S302可以被下述步骤替换:
S301’、应用向eUICC发送使用eUICC登录的登录请求消息。其中,该登录请求消息可以携带有R1。
可选的,eUICC在接收到该登录请求消息后,通过运行LPA在用户界面上显示eUICC中的至少一个电话号码,以由用户选择使用哪个电话号码登录该应用。然后,eUICC可以将用户在所述用户界面所选择的电话号码作为目标电话号码。
S303、eUICC向应用发送证书CERT_PF、证书CERT_DP、第一签名。
在本示例中,CERT_PF为目标电话号码对应Profile的证书,第一签名为使用CERT_PF的私钥对R1进行加密得到的signature(R1)。
可以理解,若LPA并非是安装在eUICC上的应用,则eUICC向应用发送证书CERT_PF、证书CERT_DP、第一签名可以是eUICC直接向应用发送证书CERT_PF、证书CERT_DP、第一签名,也可以是eUICC通过LPA向应用发送证书CERT_PF、证书CERT_DP、第一签名,对此不进行限定。
S304、应用向应用服务器发送第一鉴权请求消息。
其中,第一鉴权请求消息包括:证书CERT_PF、证书CERT_DP、第一签名。
S305、应用服务器根据第一鉴权请求消息,对终端设备进行鉴权,得到鉴权结果。
参照图4所示的证书链,应用服务器可以采用现有的证书链验证证书的方式,对证书CERT_PF、证书CERT_DP进行验证。即,所述应用服务器可以从CI服务器获取根证书。然后,所述应用服务器可以使用该根证书,验证SM-DP+服务器的证书CERT_DP的合法性和有效性。若该证书CERT_DP合法且有效,则所述应用服务器可以使用证书CERT_DP验证证书CERT_PF的合法性和有效性。若证书CERT_PF合法且有效,则应用服务器确认证书CERT_PF和证书CERT_DP验证通过,否则,应用服务器可以确认证书CERT_PF和证书CERT_DP验证失败。
所述应用服务器在证书CERT_PF和证书CERT_DP验证通过后,可以使用证书CERT_PF对所述第一签名signature(R1)进行解密,得到R1。若解密所得到的R1与所述应用服务器生成的R1相同,即解密得到的R1未发生变化,说明终端设备是该证书的合法持有者,则所述应用服务器确认所述终端设备鉴权通过。若解密所得到的R1与所述应用服务器生成的R1不同,即解密得到的R1发生了变化,说明终端设备不是该证书的合法持有者(即终端设备是 该证书的非法持有者),则所述应用服务器确认所述终端设备鉴权失败。
S306、应用服务器向应用发送鉴权结果。
在所述终端设备鉴权通过之后,若证书CERT_PF中携带的目标电话号码是第一次登录该应用,则应用服务器使用该目标电话号码为用户创建账号,并登录该应用。在该场景下,应用服务器可以将所创建的账号信息随同鉴权结果一同发送给应用,也可以单独发送给应用,对此不进行限定。此时,该鉴权成功的鉴权结果例如可以为注册成功。在所述终端设备鉴权失败时,所述应用服务器可以拒绝为所述终端设备创建登录所述应用的账号,并返回鉴权失败的鉴权结果(例如注册失败)。
若证书CERT_PF中携带的目标电话号码并非第一次登录该应用,则在所述终端设备鉴权通过之后,应用服务器使用该目标电话号码作为该应用的账号登录该应用,并返回鉴权成功的鉴权结果(例如登录成功)。在所述终端设备鉴权失败时,所述应用服务器可以拒绝使用所述目标电话号码登录所述应用,并返回鉴权失败的鉴权结果(例如登录失败)。
示例二、Profile证书的声明信息(即证书颁发者对证书的签名数据)中没有携带该profile的电话号码的标识。
图8为本申请实施例提供的又一种鉴权方法的流程图。如图8所示,该方法包括:
S401、应用向LPA发送使用eUICC登录的登录请求消息。
其中,该登录请求消息可以携带有R1。在本示例中,该登录请求消息即为前述所说的初始鉴权请求消息。该登录请求消息可以为用户点击应用的注册或登录按钮所触发的登录请求消息。
可选的,在步骤S401之前,应用在用户点击应用的注册或登录按钮后,可以与应用服务器协商采用哪种鉴权方式进行鉴权。当双方协商确定采用单向鉴权方式进行鉴权时,应用可以接收到应用服务器发送的R1。
S402、LPA向eUICC发送鉴权申请消息。
其中,该鉴权申请消息可以包括:目标电话号码和R1。其中,该目标电话号码用于登录该应用。
可选的,LPA在向eUICC发送鉴权申请消息之前,可以在用户界面上显示eUICC中的至少一个电话号码,以由用户选择使用哪个电话号码登录该应用。然后,LPA可以将用户在所述用户界面所选择的电话号码作为目标电话号码。
应理解,若LPA和eUICC位于同一终端设备中,且LPA是安装在eUICC上的应用,则上述步骤S401和S402可以被下述步骤替换:
S401’、应用向eUICC发送使用eUICC登录的登录请求消息。其中,该登录请求消息可以携带有R1。
可选的,eUICC在接收到该登录请求消息后,通过运行LPA在用户界面上显示eUICC中的至少一个电话号码,以由用户选择使用哪个电话号码登录该应用。然后,eUICC可以将用户在所述用户界面所选择的电话号码作为目标电话号码。
S403、eUICC向应用发送证书CERT_PF、证书CERT_DP、目标电话号码的标识PN、第一签名。
在本示例中,CERT_PF为目标电话号码对应Profile的证书,第一签名为使用目标电话号码对应CERT_PF的私钥对R1和PN进行加密得到的signature(R1,PN)。
可以理解,若LPA并非是安装在eUICC上的应用,则eUICC向应用发送证书CERT_PF、 证书CERT_DP、第一签名可以是eUICC直接向应用发送证书CERT_PF、证书CERT_DP、PN、第一签名,也可以是eUICC通过LPA向应用发送证书CERT_PF、证书CERT_DP、PN、第一签名,对此不进行限定。
S404、应用向应用服务器发送第一鉴权请求消息。
其中,第一鉴权请求消息包括:证书CERT_PF、证书CERT_DP、PN、第一签名。
S405、应用服务器据第一鉴权请求消息,对终端设备进行鉴权,得到鉴权结果。
参照图4所示的证书链,应用服务器可以采用现有的证书链验证证书的方式,对证书CERT_PF、证书CERT_DP进行验证。即,所述应用服务器可以从CI服务器获取根证书。然后,所述应用服务器可以使用该根证书,验证SM-DP+服务器的证书CERT_DP的合法性和有效性。若该证书CERT_DP合法且有效,则所述应用服务器可以使用证书CERT_DP验证证书CERT_PF的合法性和有效性。若证书CERT_PF合法且有效,则应用服务器确认证书CERT_PF和证书CERT_DP验证通过,否则,应用服务器可以确认证书CERT_PF和证书CERT_DP验证失败。
所述应用服务器在证书CERT_PF和证书CERT_DP验证通过后,可以使用证书CERT_PF对所述第一签名signature(R1、PN)进行解密,得到R1和PN。若解密所得到的R1与所述应用服务器生成的R1相同、且解密所得到的PN与第一鉴权请求消息中携带的PN相同,即解密得到的R1和PN均未发生变化,说明终端设备是该证书的合法持有者,则所述应用服务器确认所述终端设备鉴权通过。若解密所得到的R1与所述应用服务器生成的R1不同,和/或,解密所得到的PN与第一鉴权请求消息中携带的PN不同,即解密得到的R1和/或PN发生了变化,说明终端设备不是该证书的合法持有者(即终端设备是该证书的非法持有者),则所述应用服务器确认所述终端设备鉴权失败。
S406、应用服务器向应用发送鉴权结果。
在所述终端设备鉴权通过之后,若第一鉴权请求消息中携带的目标电话号码是第一次登录该应用,则应用服务器使用该目标电话号码为用户创建账号,并登录该应用。在该场景下,应用服务器可以将所创建的账号信息随同鉴权结果一同发送给应用,也可以单独发送给应用,对此不进行限定。此时,该鉴权成功的鉴权结果例如可以为注册成功。在所述终端设备鉴权失败时,所述应用服务器可以拒绝为所述终端设备创建登录所述应用的账号,并返回鉴权失败的鉴权结果(例如注册失败)。
若第一鉴权请求消息中携带的目标电话号码并非第一次登录该应用,则在所述终端设备鉴权通过之后,应用服务器使用该目标电话号码作为该应用的账号登录该应用,并返回鉴权成功的鉴权结果(例如登录成功)。在所述终端设备鉴权失败时,所述应用服务器可以拒绝使用所述目标电话号码登录所述应用,并返回鉴权失败的鉴权结果(例如登录失败)。
图9为本申请实施例提供的又一种鉴权方法的流程图。本实施例涉及的是应用服务器与终端设备之间采用双向鉴权的方式进行鉴权的过程。即,应用服务器与终端设备使用根证书完成对方证书的有效性和合法性的验证,并通过随机数验证对方持有的证书的私钥,以确定终端设备是否为该证书的合法持有者。如图9所示,上述步骤S102可以包括:
S501、所述终端设备向应用服务器发送第二鉴权请求消息。
相应地,所述应用服务器接收该第二鉴权请求消息。
其中,所述第二鉴权请求消息用于请求所述应用服务器验证应用服务器的证书与所述目标账号的证书是否来自同一根证书。所述第二鉴权请求消息包括:所述目标账号的证书的信 息、所述目标账号的标识、所述终端设备生成的第二随机数。该第二随机数可以为所述终端设备采用预设随机函数生成的随机数。本申请实施例对第二随机数的长度不进行限定。例如,该第二随机数可以为16字节的随机数。所述目标账号的证书的信息用于指示签发所述目标账号的证书的根证书。例如,所述目标账号的证书的信息可以包括所述目标账号的证书的根证书的ID(简称PKID)。关于目标账号的标识的描述可以参见前述实施例。
可选的,在一些实施例中,上述所述目标账号的标识也可以携带在目标账号的证书的信息中。
S502、所述应用服务器根据所述第二鉴权请求消息,验证所述应用服务器的证书与所述目标账号的证书是否来自同一根证书。
所述应用服务器判断所述目标账号的证书的信息所指示的根证书,与所述应用服务器的证书的根证书是否相同。若相同,则确定所述应用服务器的证书与所述目标账号的证书来自同一根证书。若不同,则确定所述应用服务器的证书与所述目标账号的证书不是来自同一根证书。
以所述目标账号的证书的信息包括所述目标账号的证书的根证书的ID(简称PKID),则应用服务器可以判断第二鉴权请求消息中携带的PKID,与应用服务器的证书的根证书的ID是否相同。若是,说明所述目标账号的证书的信息所指示的根证书,与所述应用服务器的证书的根证书相同,则确定所述应用服务器的证书与所述目标账号的证书来自同一根证书。若不同,说明所述目标账号的证书的信息所指示的根证书,与所述应用服务器的证书的根证书不同,则确定所述应用服务器的证书与所述目标账号的证书不是来自同一根证书。
应理解,若所述应用服务器的证书与所述目标账号的证书来自同一根证书,则应用服务器与终端设备才可以使用根证书对对方的证书进行验证,则执行后续步骤S503,以通过第三鉴权请求消息请求终端设备对应用服务器的证书进行验证。若所述应用服务器的证书与所述目标账号的证书不是来自同一根证书,则应用服务器与终端设备无法使用根证书对对方的证书进行验证,则所述应用服务器可以向终端设备发送鉴权失败的鉴权结果。
S503、所述应用服务器在确定应用服务器的证书与所述目标账号的证书来自同一根证书时,向所述终端设备发送第三鉴权请求消息。
相应地,所述终端设备接收该第三鉴权请求消息。
其中,所述第三鉴权请求消息用于请求所述终端设备对所述应用服务器进行鉴权,所述第三鉴权请求消息包括:所述应用服务器的证书、使用所述应用服务器的证书的私钥签名得到的第二签名。
所述第二签名与所述第二随机数和第三随机数相关。即,第二签名可以为根据该第二随机数和第三随机数得到。例如,第二签名(即signature)可以为使用所述应用服务器的证书的私钥对该第二随机数和第三随机数加密得到的signature(第二随机数,第三随机数)。所述第三随机数为所述应用服务器生成的。该第三随机数可以为所述应用服务器采用预设随机函数生成的随机数。本申请实施例对第三随机数的长度不进行限定。例如,该第三随机数可以为16字节的随机数。
S504、所述终端设备根据所述第三鉴权请求消息,对所述应用服务器鉴权。
在本步骤中,所述终端设备可以使用所述目标账号的证书的根证书,先对所述应用服务器的证书进行验证。例如,所述终端设备可以采用现有的证书链验证证书的方式,使用所述目标账号的证书的根证书,先对所述应用服务器的证书进行验证,对此不再赘述。
所述终端设备在所述应用服务器的证书验证通过后,可以使用所述应用服务器的证书对 所述第二签名进行解密,得到所述第二随机数和第三随机数。若解密所得到的第二随机数与所述终端设备生成的第二随机数相同,即解密得到的第二随机数未发生变化,说明应用服务器是该证书的合法持有者,则所述终端设备确认所述应用服务器鉴权通过。若解密所得到的第二随机数与所述终端设备生成的第二随机数不同,即解密得到的第二随机数发生了变化,说明应用服务器不是该证书的合法持有者(即应用服务器是该证书的非法持有者),则所述终端设备确认所述应用服务器鉴权失败。
应理解,这里所说的应用服务器鉴权通过可以称为使用应用服务器的身份验证通过。这里所说的应用服务器鉴权失败可以称为使用应用服务器的身份验证失败。在本申请实施例中,验证和鉴权的含义等同,本申请实施例对此不进行区分。
在另一可能的实现方式中,上述终端设备也可以先使用所述应用服务器的证书对所述第二签名进行解密,得到所述第二随机数和第三随机数。若解密所得到的第二随机数与所述终端设备生成的第二随机数相同,即解密得到的第二随机数未发生变化,则所述终端设备进一步使用所述目标账号的证书的根证书,对所述应用服务器的证书进行验证。若验证通过,则确认所述应用服务器鉴权通过。若验证失败,则确认所述应用服务器鉴权失败。若解密所得到的第二随机数与所述终端设备生成的第二随机数不同,即解密得到的第二随机数发生了变化,则所述终端设备直接确认所述应用服务器鉴权失败。
S505、所述终端设备在所述应用服务器鉴权通过后,向所述应用服务器发送第四鉴权请求消息。
即,在终端设备验证完应用服务器的证书之后,可以通过第四鉴权请求消息请求应用服务器对终端设备进行验证。相应地,应用服务器接收该第四鉴权请求消息。其中,所述第四鉴权请求消息用于请求所述应用服务器对所述目标账号进行鉴权,所述第四鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第三签名。
所述第三签名与所述第三随机数相关。即,第三签名可以为根据该第三随机数得到。示例性的,该第三签名例如可以为使用目标账号的证书的私钥对第三随机数加密得到的签名。或者,该第三签名例如可以为使用目标账号的证书的私钥对第三随机数和其他预设随机数的运算结果进行加密得到的签名。例如,第三随机数和其他预设随机数之和、第三随机数和其他预设随机数之积、第三随机数和其他预设随机数之差等。
以账号为电话号码,安全元件为eUICC、安全服务器为SM-DP+服务器为例,则上述目标账号的证书可以为目标电话号码的Profile证书,目标账号的证书的父证书可以为生成该Profile证书的SM-DP+服务器的证书。
S506、所述应用服务器根据所述第四鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果。
在本步骤中,所述应用服务器可以使用所述应用服务器的证书的根证书,对所述目标账号的证书和所述目标账号的证书的父证书进行验证。例如,所述应用服务器可以采用现有的证书链验证证书的方式,使用所述应用服务器的证书的根证书,先对所述目标账号的证书和所述目标账号的证书的父证书进行验证,对此不再赘述。
所述目标账号的证书的签名数据中携带有所述目标账号的标识。该目标账号的标识可以能够唯一的标识该目标账号。以目标账号为电话号码为例,则目标账号的标识例如可以为电话号码,也可以为ICCID和/或IMSI等能够转换为电话号码的标识。在该实现方式下,所述应用服务器可以从目标账号的证书中获取该目标账号的标识,进而获取该目标账号。
或者,所述目标账号的证书的签名数据中不携带所述目标账号的标识,而是所述第四鉴权请求消息中携带所述目标账号的标识。即,所述第四鉴权请求消息还包括所述目标账号的标识。则在该实现方式下,所述第三签名可以与所述第三随机数和所述目标账号的标识相关。即,所述第三签名为根据第三随机数和所述目标账号的标识得到的。例如,第三签名(即signature)可以为使用目标账号的证书的私钥对第三随机数和目标账号的标识进行加密得到的signature(第三随机数,目标账号的标识)。则在该实现方式下,所述应用服务器在所述目标账号的证书和所述目标账号的证书的父证书验证通过后,可以使用所述目标账号的证书对所述第三签名进行解密,得到所述目标账号的标识。
所述应用服务器在所述目标账号的证书和所述目标账号的证书的父证书验证通过后,可以使用所述目标账号的证书对所述第三签名进行解密,得到所述第三随机数。若解密所得到的第三随机数与所述应用服务器生成的第三随机数相同、且从所述第四鉴权请求消息中获取到的所述目标账号的标识与所述第二鉴权请求消息中携带的所述目标账号的标识相同,即解密得到的第三随机数未发生变化(说明终端设备是该证书的合法持有者)、目标账号的标识也未发生变化,则所述应用服务器确认所述终端设备鉴权通过。若解密所得到的第三随机数与所述应用服务器生成的第三随机数不同,和/或、从所述第四鉴权请求消息中获取到的所述目标账号的标识与所述第二鉴权请求消息中携带的所述目标账号的标识不同,即解密得到的第三随机数发生了变化(说明终端设备不是该证书的合法持有者(即终端设备是该证书的非法持有者))和/或目标账号的标识发生了变化,则所述应用服务器确认所述终端设备鉴权失败。
应理解,这里所说的终端设备鉴权通过可以称为使用终端设备的用户身份验证通过,也可以称为目标账号的鉴权通过。这里所说的终端设备鉴权失败可以称为使用终端设备的用户身份验证失败,也可以称为目标账号的鉴权失败。应理解,这里所说的验证也可以称为对使用终端设备的用户进行鉴权。即,鉴别用户对该应用的使用权限。在本申请实施例中,验证和鉴权的含义等同,本申请实施例对此不进行区分。
在另一可能的实现方式中,所述应用服务器可以先使用所述目标账号的证书对所述第三签名进行解密,得到所述第三随机数。若解密所得到的第三随机数与所述应用服务器生成的第三随机数相同、且从所述第四鉴权请求消息中获取到的所述目标账号的标识与所述第二鉴权请求消息中携带的所述目标账号的标识相同,即解密得到的第三随机数未发生变化、目标账号的标识也未发生变化,则所述应用服务器进一步地对所述目标账号的证书和所述目标账号的证书的父证书进行验证。若验证通过,则确认所述终端设备鉴权通过。若验证失败,则确认所述终端设备鉴权失败。若解密所得到的第三随机数与所述应用服务器生成的第三随机数不同,和/或、从所述第四鉴权请求消息中获取到的所述目标账号的标识与所述第二鉴权请求消息中携带的所述目标账号的标识不同,即解密得到的第三随机数和/或目标账号的标识发生了变化,则所述应用服务器直接确认所述终端设备鉴权失败。
S507、所述应用服务器向所述终端设备发送鉴权结果。
相应地,所述终端设备接收来自所述应用服务器响应所述第四鉴权请求消息的鉴权结果。在该场景下,终端设备可以通过用户界面向用户显示该鉴权结果。
以用户登录应用的场景为例,在所述终端设备鉴权通过时,所述应用服务器可以使用所述目标账号登录所述应用,并向终端设备发送鉴权通过的鉴权结果。在所述终端设备鉴权失败时,所述应用服务器可以拒绝使用所述目标账号登录所述应用,并向终端设备发送鉴权失败的鉴权结果。例如,可以通过登录成功或登录失败来指示该鉴权结果。
以用户注册应用的场景为例,在所述终端设备鉴权通过时,所述应用服务器可以创建所 述终端设备登录所述应用的账号(即目标账号),并向终端设备发送注册成功的鉴权结果。或者,在所述终端设备鉴权通过时,所述应用服务器可以创建所述终端设备登录所述应用的账号(即目标账号),使用所述目标账号登录所述应用,并向终端设备发送注册和登录成功的鉴权结果。在所述终端设备鉴权失败时,所述应用服务器可以拒绝为所述终端设备创建登录所述应用的账号,并向终端设备发送注册失败的鉴权结果。
以用户使用应用的支付功能场景,在所述终端设备鉴权通过时,所述应用服务器可以向终端设备推送显示该应用的支付页面的数据流,并向终端设备发送验证成功的鉴权结果。在一些实施例中,上述应用服务器也可以不单独发送鉴权结果,而是通过推送显示该应用的支付页面的数据流间接的指示所述终端设备鉴权通过。在所述终端设备鉴权失败时,所述应用服务器可以不向终端设备推送显示该应用的支付页面的数据流,并向终端设备发送验证失败的鉴权结果。
下面以安全元件为eUICC、安全服务器为SM-DP+服务器、账号为电话号码、账号的证书为电话号码的Profile证书、用户使用电话号码登录应用为例,对本申请实施例提供的双向鉴权方法进行示例说明。
下述实施例中,将SM-DP+服务器的证书称为CERT_DP,使用该CERT_DP生成的Profile证书称为CERT_PF,应用服务器的证书为CERT_SP,第二随机数为R2、第三随机数为R3。
为了便于理解,下述实施例分别从应用、LPA、eUICC、应用服务器四者交互的角度进行了描述。应理解,上述应用的动作可以是由终端设备的处理器执行所实现的(例如,终端设备的应用处理器)。上述LPA的动作也可以是由终端设备的处理器执行所实现的。在该实现方式下,LPA和eUICC可以位于同一终端设备中,也可以在不同终端设备中,即为同一用户所拥有的不同终端设备。例如,LPA位于用户所拥有的手机中,eUICC位于用户所拥有的可穿戴设备(例如手环)中。当LPA和eUICC位于同一终端设备中时,LPA可以是安装在终端设备上的独立应用,也可以是安装在eUICC上的应用。
图10为本申请实施例提供的又一种鉴权方法的流程图。如图10所示,该方法包括:
S601、应用向LPA发送使用eUICC登录的登录请求消息。
在本示例中,该登录请求消息即为前述所说的初始鉴权请求消息。该登录请求消息可以为用户点击应用的注册或登录按钮所触发的登录请求消息。
可选的,在步骤S601之前,应用在用户点击应用的注册或登录按钮后,与应用服务器协商采用哪种鉴权方式进行鉴权。在本示例中,双方协商确定采用双向鉴权方式进行鉴权。
S602、LPA向eUICC发送获取请求消息。
其中,所述获取请求消息用于请求获取目标电话号码对应的Profile证书的信息(简称:CERT_PF信息)。其中,CERT_PF信息包括签发CERT_PF的根证书PKID和目标电话号码的标识。
可选的,LPA在向eUICC发送获取请求之前,可以在用户界面上显示eUICC中的至少一个电话号码,以由用户选择使用哪个电话号码登录该应用。然后,LPA可以将用户在所述用户界面所选择的电话号码作为目标电话号码。
应理解,若LPA和eUICC位于同一终端设备中,且LPA是安装在eUICC上的应用,则上述步骤S601和S602可以被下述步骤替换:
S601’、应用向eUICC发送使用eUICC登录的登录请求消息。
可选的,eUICC在接收到该登录请求消息后,通过运行LPA在用户界面上显示eUICC 中的至少一个电话号码,以由用户选择使用哪个电话号码登录该应用。然后,eUICC可以将用户在所述用户界面所选择的电话号码作为目标电话号码。
S603、eUICC向应用发送 目标电话号码的CERT_PF信息、第二随机数R2。
可以理解,若LPA并非是安装在eUICC上的应用,则eUICC向应用发送CERT_PF信息和第二随机数R2可以是eUICC直接向应用发送,也可以是eUICC通过LPA向应用发送,对此不进行限定。
该第二随机数R2可以为所述终端设备采用预设随机函数生成的随机数。本申请实施例对第二随机数R2的长度不进行限定。例如,该第二随机数R2可以为16字节的随机数。
S604、应用向应用服务器发送第二鉴权请求消息。
其中,第二鉴权请求消息包括:CERT_PF信息、目标电话号码的标识和R2。
S605、应用服务器根据CERT_PF信息,验证CERT_SP与CERT_PF是否来自同一根证书。
应用服务器可以判断第二鉴权请求消息中CERT_PF信息所携带的PKID,与应用服务器的证书CERT_SP的根证书的ID是否相同。若是,说明CERT_PF信息所指示的根证书,与CERT_SP的根证书相同,则确定CERT_SP与CERT_PF来自同一根证书。若不同,说明所述CERT_PF信息所指示的根证书,与CERT_SP的根证书不同,则确定CERT_SP与CERT_PF不是来自同一根证书。
应理解,若CERT_SP与CERT_PF来自同一根证书,则应用服务器与终端设备才可以使用根证书对对方的证书进行验证,则执行后续步骤S606,以通过第三鉴权请求消息请求终端设备对CERT_SP进行验证。若CERT_SP与CERT_PF不是来自同一根证书,则应用服务器与终端设备无法使用根证书对对方的证书进行验证,则所述应用服务器可以向终端设备发送鉴权失败的鉴权结果。
S606、所述应用服务器在CERT_SP与CERT_PF来自同一根证书时,向eUICC发送第三鉴权请求消息。
其中,第三鉴权请求消息包括:应用服务器的证书CERT_SP、第二签名。在本示例中,第二签名为使用CERT_SP的私钥对R2和R3进行加密得到的signature(R2,R3)。
该第三随机数R3可以为所述应用服务器采用预设随机函数生成的随机数。本申请实施例对第三随机数R3的长度不进行限定。例如,该第三随机数R3可以为16字节的随机数。
可以理解,所述应用服务器向eUICC发送第三鉴权请求消息可以是所述应用服务器向应用发送该第三鉴权请求消息,应用通过LPA将该第三鉴权请求消息转发给eUICC。
S607、所述eUICC根据所述第三鉴权请求消息,对所述应用服务器鉴权。
在本步骤中,所述eUICC可以使用CERT_PF的根证书,先对所述应用服务器的证书CERT_SP进行验证。例如,所述eUICC可以采用现有的证书链验证证书的方式,使用CERT_PF的根证书,先对所述应用服务器的证书CERT_SP进行验证,对此不再赘述。
所述eUICC在所述应用服务器的证书CERT_SP验证通过后,可以使用所述应用服务器的证书CERT_SP对所述第二签名进行解密,得到所述第二随机数R2和第三随机数R3。若解密所得到的第二随机数R2与所述eUICC生成的第二随机数R2相同,即解密得到的第二随机数R2未发生变化,说明应用服务器是该证书的合法持有者,则所述eUICC确认所述应用服务器鉴权通过。若解密所得到的第二随机数R2与所述eUICC生成的第二随机数R2不同,即解密得到的第二随机数R2发生了变化,说明应用服务器不是该证书的合法持有者(即应用服务器是该证书的非法持有者),则所述eUICC确认所述应用服务器鉴权失败。
应理解,若所述eUICC确认所述应用服务器鉴权通过,则eUICC进一步向应用服务器发送第四鉴权请求消息,以请求应用服务器对eUICC的目标电话号码的Profile证书进行验证,则执行后续步骤S608。若所述eUICC确认所述应用服务器鉴权失败,则流程结束。此时,终端设备例如可以在用户界面显示应用非法等提示信息。
S608、eUICC在应用服务器鉴权通过时,向所述应用服务器发送第四鉴权请求消息。
其中,所述第四鉴权请求消息包括:CERT_PF、CERT_DP、使用CERT_PF签名得到的第三签名。在本示例中,第三签名为使用CERT_PF的私钥对从第二签名解密得到的R3进行加密得到的signature(R3)。
S609、所述应用服务器根据所述第四鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果。
在本步骤中,所述应用服务器可以使用所述应用服务器的证书CERT_SP的根证书,对CERT_DP、CERT_PF进行验证。例如,所述应用服务器可以采用现有的证书链验证证书的方式,使用所述应用服务器的证书CERT_SP的根证书,先对CERT_DP、CERT_PF进行验证,对此不再赘述。
所述应用服务器在CERT_DP、CERT_PF验证通过后,可以使用CERT_PF对所述第三签名进行解密,得到所述第三随机数R3。若解密所得到的第三随机数R3与所述应用服务器生成的第三随机数R3相同、且所述第四鉴权请求消息中携带的所述目标电话号码的标识与所述第二鉴权请求消息中携带的所述目标电话号码的标识相同,即解密得到的第三随机数R3未发生变化(说明终端设备是该证书的合法持有者)、目标电话号码的标识也未发生变化,则所述应用服务器确认所述终端设备鉴权通过。若解密所得到的第三随机数R3与所述应用服务器生成的第三随机数R3不同,和/或、所述第四鉴权请求消息中携带的所述目标电话号码的标识与所述第二鉴权请求消息中携带的所述目标电话号码的标识不同,即解密得到的第三随机数R3发生了变化(说明终端设备不是该证书的合法持有者(即终端设备是该证书的非法持有者))和/或目标电话号码的标识发生了变化,则所述应用服务器确认所述终端设备鉴权失败。
上述所说的所述第四鉴权请求消息中携带的所述目标电话号码的标识可以是:CERT_PF的签名数据中携带有所述目标电话号码的标识,所述目标电话号码的标识存储在所述终端设备的eUICC中。该目标电话号码的标识可以能够唯一的标识该目标电话号码,例如可以为电话号码,也可以为ICCID和/或IMSI等能够转换为电话号码的标识。在该实现方式下,所述应用服务器可以从CERT_PF中获取该目标电话号码的标识,进而获取该目标电话号码。
在另一实现方式中,所述CERT_PF的签名数据中不携带所述目标电话号码的标识,而是所述第四鉴权请求消息中携带所述目标电话号码的标识。即,所述第四鉴权请求消息还包括所述目标电话号码的标识。则在该实现方式下,所述第三签名为根据第三随机数R3得到的,或者,所述第三签名与所述第三随机数R3和所述目标电话号码的标识相关。即,所述第三签名为根据第三随机数和所述目标电话号码的标识得到的。例如,第三签名(即signature)可以为使用所述CERT_PF的私钥对第三随机数R3和目标电话号码的标识进行加密得到的signature(第三随机数R3,目标电话号码的标识)。则在该实现方式下,所述应用服务器在CERT_DP、CERT_PF验证通过后,可以使用CERT_PF对所述第三签名进行解密,得到所述目标电话号码的标识,进而获取该目标电话号码。
S610、所述应用服务器向应用发送鉴权结果。
在该场景下,终端设备可以通过用户界面向用户显示该鉴权结果。
在所述终端设备鉴权通过之后,若目标电话号码是第一次登录该应用,则应用服务器使用该目标电话号码为用户创建账号,并登录该应用。在该场景下,应用服务器可以将所创建的账号信息随同鉴权结果一同发送给应用,也可以单独发送给应用,对此不进行限定。此时,该鉴权成功的鉴权结果例如可以为注册成功。在所述终端设备鉴权失败时,所述应用服务器可以拒绝为所述终端设备创建登录所述应用的账号,并返回鉴权失败的鉴权结果(例如注册失败)。
若目标电话号码并非第一次登录该应用,则在所述终端设备鉴权通过之后,应用服务器使用该目标电话号码作为该应用的账号登录该应用,并返回鉴权成功的鉴权结果(例如登录成功)。在所述终端设备鉴权失败时,所述应用服务器可以拒绝使用所述目标电话号码登录所述应用,并返回鉴权失败的鉴权结果(例如登录失败)。
本申请实施例提供额鉴权方法,应用服务器可以通过存储在终端设备的安全元件中的账号的证书,对该账号进行鉴权,以验证使用终端设备的用户身份是否合法。因安全元件能够防止外部恶意解析攻击,保护其上的数据安全。因此,通过存储在终端设备的安全元件中的账号的证书对账号进行鉴权,可以确保鉴权的准确性、安全性、稳定性及鉴权效率,并且没有前述所说的现有的身份验证方法存在的局限性,能够满足用户实际使用时的需求。下面以安全元件为eUICC、账号为电话号码为例,通过表1,来对本申请实施例提供的鉴权方法不存在现有的身份验证方法存在的局限性进行说明:
表1
Figure PCTCN2020100107-appb-000001
图11为本申请实施例提供的一种终端设备的结构示意图。如图11所示,所述终端设备包括:收发模块11和处理模块12。其中,
收发模块11,用于接收用户输入的初始鉴权请求消息,所述初始鉴权请求消息用于请求 验证所述终端设备对应用的使用权限。
处理模块12,用于使用所述终端设备登录所述应用的目标账号的证书,通过所述收发模块11与所述应用服务器进行鉴权交互,所述目标账号的证书存储在所述终端设备的安全元件中。示例性的,所述目标账号为电话号码。
该鉴权交互可以包括如下两种鉴权方式:
第一种鉴权方式,应用服务器与终端设备之间采用单向鉴权的方式进行鉴权。
在该实现方式下,所述初始鉴权请求消息包括:所述应用服务器生成的第一随机数。所述处理模块12,具体用于通过所述收发模块11向所述应用服务器发送第一鉴权请求消息,并接收来自所述应用服务器响应所述第一鉴权请求消息的鉴权结果。其中,所述第一鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第一签名;所述第一签名与所述第一随机数相关。
可选的,所述目标账号的证书的签名数据中携带有所述目标账号的标识。也可以说,目标账号的标识携带在所述目标账号的证书的声明信息中。或者,所述第一鉴权请求消息还包括:所述目标账号的标识,所述第一签名与所述第一随机数和所述目标账号的标识相关。例如,目标账号的标识未携带在所述目标账号的证书的签名数据中(或者说目标账号的标识未携带在所述目标账号的证书的声明信息中),而是放在使用该目标账号的证书的私钥签名的数据中。
第二种鉴权方式:应用服务器与终端设备之间可以采用双向鉴权的方式进行鉴权。
在该实现方式下,所述处理模块12,具体用于:
通过所述收发模块11向应用服务器发送第二鉴权请求消息。其中,所述第二鉴权请求消息用于请求所述应用服务器验证应用服务器的证书与所述目标账号的证书是否来自同一根证书。所述第二鉴权请求消息包括:所述目标账号的证书的信息、所述目标账号的标识、所述处理模块12生成的第二随机数,所述目标账号的证书的信息用于指示签发所述目标账号的证书的根证书。
通过所述收发模块11接收所述应用服务器在应用服务器的证书与所述目标账号的证书来自同一根证书时发送的第三鉴权请求消息。其中,所述第三鉴权请求消息用于请求所述终端设备对所述应用服务器进行鉴权。所述第三鉴权请求消息包括:所述应用服务器的证书、使用所述应用服务器的证书的私钥签名得到的第二签名,所述第二签名与所述第二随机数和第三随机数相关,所述第三随机数为所述应用服务器生成的。
根据所述第三鉴权请求消息,对所述应用服务器鉴权。例如,使用所述目标账号的证书的根证书,对所述应用服务器的证书进行验证。在所述应用服务器的证书验证通过后,使用所述应用服务器的证书对所述第二签名进行解密,得到所述第二随机数和所述第三随机数。若所述第二随机数未发生变化,则确认所述应用服务器鉴权通过。
在所述应用服务器鉴权通过后,通过所述收发模块11向所述应用服务器发送第四鉴权请求消息。其中,所述第四鉴权请求消息用于请求所述应用服务器对所述目标账号进行鉴权。所述第四鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第三签名;所述第三签名与所述第三随机数相关。
通过所述收发模块11接收来自所述应用服务器响应所述第四鉴权请求消息的鉴权结果。
可选的,所述目标账号的证书的签名数据中携带有所述目标账号的标识。也可以说,目标账号的标识携带在所述目标账号的证书的声明信息中。或者,所述第四鉴权请求消息还包括:所述目标账号的标识,所述第三签名与所述第三随机数和所述目标账号的标识相关。例 如,目标账号的标识未携带在所述目标账号的证书的签名数据中(或者说目标账号的标识未携带在所述目标账号的证书的声明信息中),而是放在使用所述目标账号的证书的私钥签名的数据中。
作为一种可能的实现方式,所述处理模块12,还用于在根据所述终端设备登录所述应用的目标账号的证书,通过上述收发模块11与所述应用服务器进行鉴权交互之前,在用户界面显示至少一个账号,并将用户在所述用户界面所选择的账号作为所述目标账号。
作为一种可能的实现方式,所述收发模块11,还用于接收来自安全服务器的所述目标账号的证书、所述目标账号的证书的私钥和所述目标账号的证书的父证书,所述父证书为所述安全服务器的证书。
本申请实施例提供的终端设备,可以执行上述方法实施例中终端设备的动作,其实现原理和技术效果类似,在此不再赘述。
图12为本申请实施例提供的一种服务器的结构示意图。如图12所示,所述服务器为应用服务器,所述应用服务器包括:处理模块21。可选的,所述应用服务器还可以包括收发模块22。
处理模块21,用于基于终端设备登录应用的目标账号的证书,与所述终端设备进行鉴权交互,验证所述终端设备对所述应用的使用权限。示例性的,所述目标账号为电话号码。
该鉴权交互可以包括如下两种鉴权方式:
第一种鉴权方式,应用服务器与终端设备之间采用单向鉴权的方式进行鉴权。
在该实现方式下,所述处理模块21,具体用于通过收发模块22接收来自所述终端设备的第一鉴权请求消息;根据所述第一鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果,并通过所述收发模块22向所述终端设备发送所述鉴权结果。其中,所述第一鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第一签名;所述第一签名与第一随机数相关,所述第一随机数为所述应用服务器生成的随机数。例如,所述处理模块21,具体用于对所述目标账号的证书和所述目标账号的证书的父证书进行验证,并在所述目标账号的证书和所述目标账号的证书的父证书验证通过后,使用所述目标账号的证书对所述第一签名进行解密,得到所述第一随机数。若所述第一随机数未发生变化,则确认所述终端设备鉴权通过,若所述第一随机数发生变化,则确认所述终端设备鉴权失败。
可选的,所述目标账号的证书的签名数据中携带有所述目标账号的标识。也可以说,目标账号的标识携带在所述目标账号的证书的声明信息中。或者,所述第一鉴权请求消息还包括:所述目标账号的标识,所述第一签名与所述第一随机数和所述目标账号的标识相关。例如,目标账号的标识未携带在所述目标账号的证书的签名数据中(或者说目标账号的标识未携带在所述目标账号的证书的声明信息中),而是放在使用该目标账号的证书的私钥签名的数据中。
第二种鉴权方式:应用服务器与终端设备之间可以采用双向鉴权的方式进行鉴权。
在该实现方式下,所述处理模块21,具体用于:
通过所述收发模块22接收来自所述终端设备的第二鉴权请求消息。其中,所述第二鉴权请求消息用于请求验证应用服务器的证书与所述目标账号的证书是否来自同一根证书。所述第二鉴权请求消息包括:所述目标账号的证书的信息、所述目标账号的标识、所述终端设备生成的第二随机数,所述目标账号的证书的信息用于指示签发所述目标账号的证书的根证书。
根据所述第二鉴权请求消息,验证所述应用服务器的证书与所述目标账号的证书是否来 自同一根证书。若根据所述第二鉴权请求消息,确定应用服务器的证书与所述目标账号的证书来自同一根证书,则通过所述收发模块22向所述终端设备发送第三鉴权请求消息。其中,所述第三鉴权请求消息用于请求所述终端设备对所述应用服务器进行鉴权。所述第三鉴权请求消息包括:所述应用服务器的证书、使用所述应用服务器的证书的私钥签名得到的第二签名,所述第二签名与所述第二随机数和第三随机数相关,所述第三随机数为所述应用服务器生成的。
通过所述收发模块22接收所述终端设备在对所述应用服务器鉴权通过后发送的第四鉴权请求消息。其中,所述第四鉴权请求消息用于请求所述应用服务器对所述目标账号进行鉴权。所述第四鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第三签名;所述第三签名与所述第三随机数相关。
根据所述第四鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果,并通过所述收发模块22向所述终端设备发送所述鉴权结果。例如,使用所述应用服务器的证书的根证书,对所述目标账号的证书和所述目标账号的证书的父证书进行验证。在所述目标账号的证书和所述目标账号的证书的父证书验证通过后,使用所述目标账号的证书对所述第三签名进行解密,得到所述第三随机数。从所述第四鉴权请求消息中获取所述目标账号的标识。若所述第三随机数未发生变化、且所述第四鉴权请求消息中携带的所述目标账号的标识与所述第二鉴权请求消息中携带的所述目标账号的标识相同,则确认所述终端设备鉴权通过。若所述第三随机数发生变化,和/或,所述第四鉴权请求消息中携带的所述目标账号的标识与所述第二鉴权请求消息中携带的所述目标账号的标识不同,则确认所述终端设备鉴权失败。
可选的,所述目标账号的证书的签名数据中携带有所述目标账号的标识。也可以说,目标账号的标识携带在所述目标账号的证书的声明信息中。或者,所述第四鉴权请求消息还包括:所述目标账号的标识,所述第三签名与所述第三随机数和所述目标账号的标识相关。例如,目标账号的标识未携带在所述目标账号的证书的签名数据中(或者说目标账号的标识未携带在所述目标账号的证书的声明信息中),而是放在使用所述目标账号的证书的私钥签名的数据中。
本申请实施例提供的应用服务器,可以执行上述方法实施例中应用服务器的动作,其实现原理和技术效果类似,在此不再赘述。
图13为本申请实施例提供的另一种服务器的结构示意图。如图13所示,所述服务器为安全服务器,所述安全服务器包括:处理模块31和发送模块32。其中,
处理模块31,用于使用所述安全服务器的证书生成目标账号的证书和所述目标账号的证书的私钥。
发送模块32,用于向终端设备发送所述目标账号的证书、所述目标账号的证书的私钥,以及,所述安全服务器的证书。
本申请实施例提供的安全服务器,可以执行上述方法实施例中安全服务器的动作,其实现原理和技术效果类似,在此不再赘述。
需要说明的是,应理解以上收发模块实际实现时可以为收发器或通信接口、发送模块实际实现时可以为发送器或通信接口。而处理模块可以以软件通过处理元件调用的形式实现;也可以以硬件的形式实现。例如,处理模块可以为单独设立的处理元件,也可以集成在上述装置的某一个芯片中实现,此外,也可以以程序代码的形式存储于上述装置的存储器中,由上述装置的某一个处理元件调用并执行以上处理模块的功能。此外这些模块全部或部分可以集成在一起,也可以独立实现。这里所述的处理元件可以是一种集成电路,具有信号的处理 能力。在实现过程中,上述方法的各步骤或以上各个模块可以通过处理器元件中的硬件的集成逻辑电路或者软件形式的指令完成。
例如,以上这些模块可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个专用集成电路(application specific integrated circuit,ASIC),或,一个或多个微处理器(digital signal processor,DSP),或,一个或者多个现场可编程门阵列(field programmable gate array,FPGA)等。再如,当以上某个模块通过处理元件调度程序代码的形式实现时,该处理元件可以是通用处理器,例如中央处理器(central processing unit,CPU)或其它可以调用程序代码的处理器。再如,这些模块可以集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。
图14为本申请实施例提供的一种终端设备的结构示意图。如图14所示,该终端设备可以包括:处理器41(例如CPU)、存储器42、接收器43、发送器44;接收器43和发送器44均耦合至处理器41,处理器41控制接收器43的接收动作、处理器41控制发送器44的发送动作;存储器42可能包含高速随机存取存储器(random-access memory,RAM),也可能还包括非易失性存储器(non-volatile memory,NVM),例如至少一个磁盘存储器,存储器42中可以存储各种指令,以用于完成各种处理功能以及实现本申请的方法步骤。可选的,本申请涉及的终端设备还可以包括:电源45、通信总线46以及通信端口47。接收器43和发送器44可以集成在终端设备的收发信机中,也可以为终端设备上独立的收发天线。通信总线46用于实现元件之间的通信连接。上述通信端口47用于实现终端设备与其他外设之间进行连接通信。
在本申请实施例中,上述存储器42用于存储计算机可执行程序代码,程序代码包括指令;当处理器41执行指令时,指令使终端设备的处理器41执行上述方法实施例中终端设备的处理动作,使接收器43执行上述方法实施例中终端设备的接收动作,使发送器44执行上述方法实施例中终端设备的发送动作,其实现原理和技术效果类似,在此不再赘述。
图15为本申请实施例提供的又一种服务器的结构示意图。如图15所示,该服务器可以包括:至少一个处理器51和存储器52。图15示出的是以一个处理器为例的服务器,其中,
存储器52,用于存放程序。具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。存储器52可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
作为一种可能的实现方式,处理器51用于执行所述存储器52存储的计算机执行指令,以实现上述实施例中的鉴权方法中的应用服务器的动作,其实现原理和技术效果类似,在此不再赘述。
作为另一种可能的实现方式,处理器51用于执行所述存储器52存储的计算机执行指令,以实现上述实施例中的鉴权方法中的安全服务器的动作,其实现原理和技术效果类似,在此不再赘述。
应理解,处理器51可能是一个中央处理器(Central Processing Unit,简称为CPU),或者是特定集成电路(Application Specific Integrated Circuit,简称为ASIC),或者是被配置成实施本发明实施例的一个或多个集成电路。
可选的,在具体实现上,如果通信接口、存储器52和处理器51独立实现,则通信接口、存储器52和处理器51可以通过总线相互连接并完成相互间的通信。所述总线可以是工业标准体系结构(Industry Standard Architecture,简称为ISA)总线、外部设备互连(Peripheral Component,简称为PCI)总线或扩展工业标准体系结构(Extended Industry Standard  Architecture,简称为EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等,但并不表示仅有一根总线或一种类型的总线。可选的,在具体实现上,如果通信接口、存储器52和处理器51集成在一块芯片上实现,则通信接口、存储器52和处理器51可以通过内部接口完成相同间的通信。
在本申请实施例图11-图15的设备或装置中处理模块(或者处理器)、存储模块(或者存储器)和收发模块(收发器)之间通过内部连接通路互相通信,传递控制和/或数据信号。本申请上述方法实施例可以应用于处理器中,或者由处理器实现上述方法实施例的步骤。处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP)或者CPU和NP的组合、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。虽然图中仅仅示出了一个处理器,该装置可以包括多个处理器或者处理器包括多个处理模块。具体的,处理器可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。
存储器用于存储处理器执行的计算机指令。存储器可以是存储电路也可以是存储器。存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。存储器可以独立于处理器,也可以是处理器中的存储模块,在此不做限定。虽然图中仅仅示出了一个存储器,该装置也可以包括多个存储器或者存储器包括多个存储模块。
收发器用于实现处理器与其他模块或者网元的内容交互。具体的,收发器可以是该装置的通信接口,也可以是收发电路或者通信模块,还可以是收发信机。收发器还可以是处理器的通信接口或者收发电路。可选的,收发器可以是一个收发芯片。该收发器还可以包括发送模块和/或接收模块。在一种可能的实现方式中,该收发器可以包括至少一个通信接口。在另一种可能的实现方式中,该收发器也可以是以软件形式实现的模块。在本申请的各实施例中,处理器可以通过收发器与其他模块或者网元进行交互。例如:处理器通过该收发器获取或者接收来自其他网元的内容。若处理器与收发器是物理上分离的两个部件,处理器可以不经过收发器与该装置的其他模块进行内容交互。
一种可能的实现方式中,处理器、存储器以及收发器可以通过总线相互连接。总线可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。
本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
在本申请的各实施例中,为了方面理解,进行了多种举例说明。然而,这些例子仅仅是一些举例,并不意味着是实现本申请的最佳实现方式。
在本申请的各实施例中,为了方便的描述,采用了请求消息,响应消息以及其他各种消息的名称。然而,这些消息仅仅是以举例方式说明需要携带的内容或者实现的功能,消息的具体名称并不对本申请的做出限定,例如:还可以是第一消息,第二消息,第三消息等。这些消息可以是具体的一些消息,可以是消息中的某些字段。这些消息还可以代表各种服务化操作。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。
本文中的术语“多个”是指两个或两个以上。本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系;在公式中,字符“/”,表示前后关联对象是一种“相除”的关系。
可以理解的是,在本申请的实施例中涉及的各种数字编号仅为描述方便进行的区分,并不用来限制本申请的实施例的范围。
可以理解的是,在本申请的实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请的实施例的实施过程构成任何限定。

Claims (30)

  1. 一种鉴权方法,其特征在于,所述方法包括:
    终端设备接收用户输入的初始鉴权请求消息,所述初始鉴权请求消息用于请求验证所述终端设备对应用的使用权限;
    所述终端设备使用所述终端设备登录所述应用的目标账号的证书,与所述应用服务器进行鉴权交互,所述目标账号的证书存储在所述终端设备的安全元件中。
  2. 根据权利要求1所述的方法,其特征在于,所述初始鉴权请求消息包括:所述应用服务器生成的第一随机数;
    所述终端设备使用所述终端设备登录所述应用的目标账号的证书,与所述应用服务器进行鉴权交互,包括:
    所述终端设备向所述应用服务器发送第一鉴权请求消息,所述第一鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第一签名;所述第一签名与所述第一随机数相关;
    所述终端设备接收来自所述应用服务器响应所述第一鉴权请求消息的鉴权结果。
  3. 根据权利要求2所述的方法,其特征在于,所述目标账号的证书的签名数据中携带有所述目标账号的标识;或者,
    所述第一鉴权请求消息还包括:所述目标账号的标识,所述第一签名与所述第一随机数和所述目标账号的标识相关。
  4. 根据权利要求1所述的方法,其特征在于,所述终端设备使用所述终端设备登录所述目标应用的目标账号的证书,与所述应用服务器进行鉴权交互,包括:
    所述终端设备向应用服务器发送第二鉴权请求消息,所述第二鉴权请求消息用于请求所述应用服务器验证应用服务器的证书与所述目标账号的证书是否来自同一根证书,所述第二鉴权请求消息包括:所述目标账号的证书的信息、所述目标账号的标识、所述终端设备生成的第二随机数,所述目标账号的证书的信息用于指示签发所述目标账号的证书的根证书;
    所述终端设备接收所述应用服务器在应用服务器的证书与所述目标账号的证书来自同一根证书时发送的第三鉴权请求消息,所述第三鉴权请求消息用于请求所述终端设备对所述应用服务器进行鉴权,所述第三鉴权请求消息包括:所述应用服务器的证书、使用所述应用服务器的证书的私钥签名得到的第二签名,所述第二签名与所述第二随机数和第三随机数相关,所述第三随机数为所述应用服务器生成的;
    所述终端设备根据所述第三鉴权请求消息,对所述应用服务器鉴权;
    所述终端设备在所述应用服务器鉴权通过后,向所述应用服务器发送第四鉴权请求消息,所述第四鉴权请求消息用于请求所述应用服务器对所述目标账号进行鉴权,所述第四鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第三签名;所述第三签名与所述第三随机数相关;
    所述终端设备接收来自所述应用服务器响应所述第四鉴权请求消息的鉴权结果。
  5. 根据权利要求4所述的方法,其特征在于,所述目标账号的证书的签名数据中携带有所述目标账号的标识;或者,
    所述第四鉴权请求消息还包括:所述目标账号的标识,所述第三签名与所述第三随机数和所述目标账号的标识相关。
  6. 根据权利要求4或5所述的方法,其特征在于,所述终端设备根据所述第三鉴权请求 消息,对所述应用服务器鉴权,包括:
    所述终端设备使用所述目标账号的证书的根证书,对所述应用服务器的证书进行验证;
    所述终端设备在所述应用服务器的证书验证通过后,使用所述应用服务器的证书对所述第二签名进行解密,得到所述第二随机数和所述第三随机数;
    若所述第二随机数未发生变化,则所述终端设备确认所述应用服务器鉴权通过。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述方法还包括:
    所述终端设备接收来自安全服务器的所述目标账号的证书、所述目标账号的证书的私钥和所述目标账号的证书的父证书,所述父证书为所述安全服务器的证书。
  8. 一种鉴权方法,其特征在于,所述方法包括:
    应用服务器基于终端设备登录应用的目标账号的证书,与所述终端设备进行鉴权交互,验证所述终端设备对所述应用的使用权限。
  9. 根据权利要求8所述的方法,其特征在于,所述应用服务器基于终端设备登录目标应用的目标账号的证书,与所述终端设备进行鉴权交互,包括:
    所述应用服务器接收来自所述终端设备的第一鉴权请求消息,所述第一鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第一签名;所述第一签名与第一随机数相关,所述第一随机数为所述应用服务器生成的随机数;
    所述应用服务器根据所述第一鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果;
    所述应用服务器向所述终端设备发送所述鉴权结果。
  10. 根据权利要求9所述的方法,其特征在于,所述应用服务器根据所述第一鉴权请求消息,对所述终端设备进行鉴权,包括:
    所述应用服务器对所述目标账号的证书和所述目标账号的证书的父证书进行验证;
    所述应用服务器在所述目标账号的证书和所述目标账号的证书的父证书验证通过后,使用所述目标账号的证书对所述第一签名进行解密,得到所述第一随机数;
    若所述第一随机数未发生变化,则所述应用服务器确认所述终端设备鉴权通过;
    若所述第一随机数发生变化,则所述应用服务器确认所述终端设备鉴权失败。
  11. 根据权利要求9或10所述的方法,其特征在于,所述目标账号的证书的签名数据中携带有所述目标账号的标识;或者,
    所述第一鉴权请求消息还包括:所述目标账号的标识,所述第一签名与所述第一随机数和所述目标账号的标识相关。
  12. 根据权利要求8所述的方法,其特征在于,所述应用服务器基于终端设备登录目标应用的目标账号的证书,与所述终端设备进行鉴权交互,包括:
    所述应用服务器接收来自所述终端设备的第二鉴权请求消息,所述第二鉴权请求消息用于请求验证应用服务器的证书与所述目标账号的证书是否来自同一根证书,所述第二鉴权请求消息包括:所述目标账号的证书的信息、所述目标账号的标识、所述终端设备生成的第二随机数,所述目标账号的证书的信息用于指示签发所述目标账号的证书的根证书;
    所述应用服务器根据所述第二鉴权请求消息,验证所述应用服务器的证书与所述目标账号的证书是否来自同一根证书;
    若所述应用服务器根据所述第二鉴权请求消息,确定应用服务器的证书与所述目标账号的证书来自同一根证书,则所述应用服务器向所述终端设备发送第三鉴权请求消息,所述第三鉴权请求消息用于请求所述终端设备对所述应用服务器进行鉴权,所述第三鉴权请求消息 包括:所述应用服务器的证书、使用所述应用服务器的证书的私钥签名得到的第二签名,所述第二签名与所述第二随机数和第三随机数相关,所述第三随机数为所述应用服务器生成的;
    所述应用服务器接收所述终端设备在对所述应用服务器鉴权通过后发送的第四鉴权请求消息,所述第四鉴权请求消息用于请求所述应用服务器对所述目标账号进行鉴权,所述第四鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第三签名;所述第三签名与所述第三随机数相关;
    所述应用服务器根据所述第四鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果;
    所述应用服务器向所述终端设备发送所述鉴权结果。
  13. 根据权利要求12所述的方法,其特征在于,所述目标账号的证书的签名数据中携带有所述目标账号的标识;或者,
    所述第四鉴权请求消息还包括:所述目标账号的标识,所述第三签名与所述第三随机数和所述目标账号的标识相关。
  14. 根据权利要求13所述的方法,其特征在于,所述应用服务器根据所述第四鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果,包括:
    所述应用服务器使用所述应用服务器的证书的根证书,对所述目标账号的证书和所述目标账号的证书的父证书进行验证;
    所述应用服务器在所述目标账号的证书和所述目标账号的证书的父证书验证通过后,使用所述目标账号的证书对所述第三签名进行解密,得到所述第三随机数;
    所述应用服务器从所述第四鉴权请求消息中获取所述目标账号的标识;
    若所述第三随机数未发生变化、且所述第四鉴权请求消息中携带的所述目标账号的标识与所述第二鉴权请求消息中携带的所述目标账号的标识相同,则所述应用服务器确认所述终端设备鉴权通过;
    若所述第三随机数发生变化,和/或,所述第四鉴权请求消息中携带的所述目标账号的标识与所述第二鉴权请求消息中携带的所述目标账号的标识不同,则所述应用服务器确认所述终端设备鉴权失败。
  15. 一种鉴权方法,其特征在于,所述方法包括:
    安全服务器使用所述安全服务器的证书生成目标账号的证书和所述目标账号的证书的私钥;
    所述安全服务器向终端设备发送所述目标账号的证书、所述目标账号的证书的私钥,以及,所述安全服务器的证书。
  16. 一种终端设备,其特征在于,所述终端设备包括:
    收发模块,用于接收用户输入的初始鉴权请求消息,所述初始鉴权请求消息用于请求验证所述终端设备对应用的使用权限;
    处理模块,用于使用所述终端设备登录所述应用的目标账号的证书,通过所述收发模块与所述应用服务器进行鉴权交互,所述目标账号的证书存储在所述终端设备的安全元件中。
  17. 根据权利要求16所述的设备,其特征在于,所述初始鉴权请求消息包括:所述应用服务器生成的第一随机数;
    所述处理模块,具体用于通过所述收发模块向所述应用服务器发送第一鉴权请求消息,并接收来自所述应用服务器响应所述第一鉴权请求消息的鉴权结果;
    其中,所述第一鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第一签名;所述第一签名与所述第一随机数 相关。
  18. 根据权利要求17所述的设备,其特征在于,所述目标账号的证书的签名数据中携带有所述目标账号的标识;或者,
    所述第一鉴权请求消息还包括:所述目标账号的标识,所述第一签名与所述第一随机数和所述目标账号的标识相关。
  19. 根据权利要求16所述的设备,其特征在于,所述处理模块,具体用于:
    通过所述收发模块向应用服务器发送第二鉴权请求消息,所述第二鉴权请求消息用于请求所述应用服务器验证应用服务器的证书与所述目标账号的证书是否来自同一根证书,所述第二鉴权请求消息包括:所述目标账号的证书的信息、所述目标账号的标识、所述处理模块生成的第二随机数,所述目标账号的证书的信息用于指示签发所述目标账号的证书的根证书;
    通过所述收发模块接收所述应用服务器在应用服务器的证书与所述目标账号的证书来自同一根证书时发送的第三鉴权请求消息;所述第三鉴权请求消息用于请求所述终端设备对所述应用服务器进行鉴权,所述第三鉴权请求消息包括:所述应用服务器的证书、使用所述应用服务器的证书的私钥签名得到的第二签名,所述第二签名与所述第二随机数和第三随机数相关,所述第三随机数为所述应用服务器生成的;
    根据所述第三鉴权请求消息,对所述应用服务器鉴权;
    在所述应用服务器鉴权通过后,通过所述收发模块向所述应用服务器发送第四鉴权请求消息,所述第四鉴权请求消息用于请求所述应用服务器对所述目标账号进行鉴权,所述第四鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第三签名;所述第三签名与所述第三随机数相关;
    通过所述收发模块接收来自所述应用服务器响应所述第四鉴权请求消息的鉴权结果。
  20. 根据权利要求19所述的设备,其特征在于,所述目标账号的证书的签名数据中携带有所述目标账号的标识;或者,
    所述第四鉴权请求消息还包括:所述目标账号的标识,所述第三签名与所述第三随机数和所述目标账号的标识相关。
  21. 根据权利要求19或20所述的设备,其特征在于,所述处理模块,具体用于:
    使用所述目标账号的证书的根证书,对所述应用服务器的证书进行验证;
    在所述应用服务器的证书验证通过后,使用所述应用服务器的证书对所述第二签名进行解密,得到所述第二随机数和所述第三随机数;
    若所述第二随机数未发生变化,则确认所述应用服务器鉴权通过。
  22. 根据权利要求16-21任一项所述的设备,其特征在于,
    所述收发模块,还用于接收来自安全服务器的所述目标账号的证书、所述目标账号的证书的私钥和所述目标账号的证书的父证书,所述父证书为所述安全服务器的证书。
  23. 一种服务器,其特征在于,所述服务器为应用服务器,所述应用服务器包括:
    处理模块,用于基于终端设备登录应用的目标账号的证书,与所述终端设备进行鉴权交互,验证所述终端设备对所述应用的使用权限。
  24. 根据权利要求23所述的服务器,其特征在于,所述应用服务器还包括:收发模块;
    所述处理模块,具体用于通过收发模块接收来自所述终端设备的第一鉴权请求消息;根据所述第一鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果,并通过所述收发模块向所述终端设备发送所述鉴权结果;
    其中,所述第一鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证 书、使用所述目标账号的证书的私钥签名得到的第一签名;所述第一签名与第一随机数相关,所述第一随机数为所述应用服务器生成的随机数。
  25. 根据权利要求24所述的服务器,其特征在于,
    所述处理模块,具体用于对所述目标账号的证书和所述目标账号的证书的父证书进行验证,并在所述目标账号的证书和所述目标账号的证书的父证书验证通过后,使用所述目标账号的证书对所述第一签名进行解密,得到所述第一随机数;若所述第一随机数未发生变化,则确认所述终端设备鉴权通过,若所述第一随机数发生变化,则确认所述终端设备鉴权失败。
  26. 根据权利要求24或25所述的服务器,其特征在于,所述目标账号的证书的签名数据中携带有所述目标账号的标识;或者,
    所述第一鉴权请求消息还包括:所述目标账号的标识,所述第一签名与所述第一随机数和所述目标账号的标识相关。
  27. 根据权利要求23所述的服务器,其特征在于,所述应用服务器还包括:收发模块;
    所述处理模块,具体用于:
    通过所述收发模块接收来自所述终端设备的第二鉴权请求消息,所述第二鉴权请求消息用于请求验证应用服务器的证书与所述目标账号的证书是否来自同一根证书,所述第二鉴权请求消息包括:所述目标账号的证书的信息、所述目标账号的标识、所述终端设备生成的第二随机数,所述目标账号的证书的信息用于指示签发所述目标账号的证书的根证书;
    根据所述第二鉴权请求消息,验证所述应用服务器的证书与所述目标账号的证书是否来自同一根证书;
    若根据所述第二鉴权请求消息,确定应用服务器的证书与所述目标账号的证书来自同一根证书,则通过所述收发模块向所述终端设备发送第三鉴权请求消息,所述第三鉴权请求消息用于请求所述终端设备对所述应用服务器进行鉴权,所述第三鉴权请求消息包括:所述应用服务器的证书、使用所述应用服务器的证书的私钥签名得到的第二签名,所述第二签名与所述第二随机数和第三随机数相关,所述第三随机数为所述应用服务器生成的;
    通过所述收发模块接收所述终端设备在对所述应用服务器鉴权通过后发送的第四鉴权请求消息,所述第四鉴权请求消息用于请求所述应用服务器对所述目标账号进行鉴权,所述第四鉴权请求消息包括:所述目标账号的证书、所述目标账号的证书的父证书、使用所述目标账号的证书的私钥签名得到的第三签名;所述第三签名与所述第三随机数相关;
    根据所述第四鉴权请求消息,对所述终端设备进行鉴权,得到鉴权结果;
    通过所述收发模块向所述终端设备发送所述鉴权结果。
  28. 根据权利要求27所述的服务器,其特征在于,所述目标账号的证书的签名数据中携带有所述目标账号的标识;或者,
    所述第四鉴权请求消息还包括:所述目标账号的标识,所述第三签名与所述第三随机数和所述目标账号的标识相关。
  29. 根据权利要求28所述的服务器,其特征在于,所述处理模块,具体用于:
    使用所述应用服务器的证书的根证书,对所述目标账号的证书和所述目标账号的证书的父证书进行验证;
    在所述目标账号的证书和所述目标账号的证书的父证书验证通过后,使用所述目标账号的证书对所述第三签名进行解密,得到所述第三随机数;
    从所述第四鉴权请求消息中获取所述目标账号的标识;
    若所述第三随机数未发生变化、且所述第四鉴权请求消息中携带的所述目标账号的标识 与所述第二鉴权请求消息中携带的所述目标账号的标识相同,则确认所述终端设备鉴权通过;
    若所述第三随机数发生变化,和/或,所述第四鉴权请求消息中携带的所述目标账号的标识与所述第二鉴权请求消息中携带的所述目标账号的标识不同,则确认所述终端设备鉴权失败。
  30. 一种服务器,其特征在于,所述服务器为安全服务器,所述安全服务器包括:
    处理模块,用于使用所述安全服务器的证书生成目标账号的证书和所述目标账号的证书的私钥;
    发送模块,用于向终端设备发送所述目标账号的证书、所述目标账号的证书的私钥,以及,所述安全服务器的证书。
PCT/CN2020/100107 2019-07-05 2020-07-03 鉴权方法、设备及服务器 WO2021004392A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910605556.6 2019-07-05
CN201910605556.6A CN112187709B (zh) 2019-07-05 2019-07-05 鉴权方法、设备及服务器

Publications (1)

Publication Number Publication Date
WO2021004392A1 true WO2021004392A1 (zh) 2021-01-14

Family

ID=73914698

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/100107 WO2021004392A1 (zh) 2019-07-05 2020-07-03 鉴权方法、设备及服务器

Country Status (2)

Country Link
CN (1) CN112187709B (zh)
WO (1) WO2021004392A1 (zh)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113014391A (zh) * 2021-01-22 2021-06-22 深圳市网心科技有限公司 嵌入式系统的鉴权方法、终端设备及计算机可读存储介质
CN113194090A (zh) * 2021-04-28 2021-07-30 招商证券股份有限公司 鉴权方法、鉴权装置、终端设备及计算机可读存储介质
CN113452771A (zh) * 2021-06-24 2021-09-28 北京沃东天骏信息技术有限公司 一种接口调用方法、装置和系统
CN114026820A (zh) * 2021-03-09 2022-02-08 深圳市汇顶科技股份有限公司 数据上传方法、数据下载方法及相关设备
CN114666112A (zh) * 2022-03-14 2022-06-24 亿咖通(湖北)技术有限公司 通信认证方法、装置、电子设备和存储介质
CN115278644A (zh) * 2022-06-21 2022-11-01 芯安微众(上海)微电子技术有限公司 适用于脱机生产的eUICC下载方法
CN115495716A (zh) * 2022-08-15 2022-12-20 荣耀终端有限公司 一种本地鉴权方法和电子设备

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113496024B (zh) * 2021-09-07 2021-12-10 北京芯盾时代科技有限公司 一种Web页面的登录方法、装置、存储介质及电子设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414909A (zh) * 2008-11-28 2009-04-22 中国移动通信集团公司 网络应用用户身份验证系统、方法和移动通信终端
US20170338966A1 (en) * 2016-05-18 2017-11-23 Apple Inc. eUICC SECURE TIMING AND CERTIFICATE REVOCATION
CN108834144A (zh) * 2018-06-05 2018-11-16 江苏恒宝智能系统技术有限公司 运营商码号与账号的关联管理方法与系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2860906B1 (en) * 2012-06-29 2017-09-06 Huawei Technologies Co., Ltd. Identity authentication method and device
CN103747443B (zh) * 2013-11-29 2017-03-15 厦门盛华电子科技有限公司 一种基于手机用户识别卡多安全域装置及其鉴权方法
CN109756447B (zh) * 2017-11-01 2022-03-29 华为技术有限公司 一种安全认证方法及相关设备
CN109005155B (zh) * 2018-07-04 2021-11-12 奇安信科技集团股份有限公司 身份认证方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414909A (zh) * 2008-11-28 2009-04-22 中国移动通信集团公司 网络应用用户身份验证系统、方法和移动通信终端
US20170338966A1 (en) * 2016-05-18 2017-11-23 Apple Inc. eUICC SECURE TIMING AND CERTIFICATE REVOCATION
CN108834144A (zh) * 2018-06-05 2018-11-16 江苏恒宝智能系统技术有限公司 运营商码号与账号的关联管理方法与系统

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113014391A (zh) * 2021-01-22 2021-06-22 深圳市网心科技有限公司 嵌入式系统的鉴权方法、终端设备及计算机可读存储介质
CN114026820A (zh) * 2021-03-09 2022-02-08 深圳市汇顶科技股份有限公司 数据上传方法、数据下载方法及相关设备
CN113194090A (zh) * 2021-04-28 2021-07-30 招商证券股份有限公司 鉴权方法、鉴权装置、终端设备及计算机可读存储介质
CN113452771A (zh) * 2021-06-24 2021-09-28 北京沃东天骏信息技术有限公司 一种接口调用方法、装置和系统
CN113452771B (zh) * 2021-06-24 2023-01-31 北京沃东天骏信息技术有限公司 一种接口调用方法、装置和系统
CN114666112A (zh) * 2022-03-14 2022-06-24 亿咖通(湖北)技术有限公司 通信认证方法、装置、电子设备和存储介质
CN114666112B (zh) * 2022-03-14 2023-08-15 亿咖通(湖北)技术有限公司 通信认证方法、装置、电子设备和存储介质
CN115278644A (zh) * 2022-06-21 2022-11-01 芯安微众(上海)微电子技术有限公司 适用于脱机生产的eUICC下载方法
CN115278644B (zh) * 2022-06-21 2023-09-15 芯安微众(上海)微电子技术有限公司 适用于脱机生产的eUICC下载方法
CN115495716A (zh) * 2022-08-15 2022-12-20 荣耀终端有限公司 一种本地鉴权方法和电子设备
CN115495716B (zh) * 2022-08-15 2023-10-10 荣耀终端有限公司 一种本地鉴权方法和电子设备

Also Published As

Publication number Publication date
CN112187709A (zh) 2021-01-05
CN112187709B (zh) 2022-07-05

Similar Documents

Publication Publication Date Title
WO2021004392A1 (zh) 鉴权方法、设备及服务器
US20220318390A1 (en) Secure over-the-air firmware upgrade
US9867043B2 (en) Secure device service enrollment
KR101611773B1 (ko) 멀티 네트워크 시스템에서 아이덴티티 관리를 위한 방법들, 장치들 및 컴퓨터 프로그램 제품들
CN110352605B (zh) 一种鉴权算法程序的添加方法、相关设备及系统
KR101313480B1 (ko) 인가된 디바이스 액세스를 제공하기 위한 장치 및 방법
WO2020093214A1 (zh) 一种应用程序登录方法、应用程序登录装置及移动终端
WO2018113437A1 (zh) 基于鉴权装置的电子身份证认证服务系统
RU2414086C2 (ru) Аутентификация приложения
CN108476223B (zh) 用于非sim设备的基于sim的认证的方法和装置
US20190138698A1 (en) System and method for controlled access to application programming interfaces
WO2015165325A1 (zh) 终端安全认证方法、装置及系统
CN113474774A (zh) 用于认可新验证器的系统和方法
KR20170067527A (ko) 두 개의 api 토큰을 이용한 api 인증 장치 및 방법
CN107925567A (zh) 用于使用由证书状态检查服务提供商发布的票证来优化对称密钥高速缓存的系统、装置和方法
CN111526159B (zh) 建立数据连接的方法、装置、终端设备及存储介质
CA2879910C (en) Terminal identity verification and service authentication method, system and terminal
JP2018517367A (ja) サービスプロバイダ証明書管理
KR20180067183A (ko) 사용자 생체정보와 관련된 고유번호를 생성하고 폐기하는 시스템 및 방법
TW201729562A (zh) 伺服器、行動終端機、網路實名認證系統及方法
WO2019051839A1 (zh) 一种数据处理的方法及装置
CN112640385A (zh) 非3gpp设备对核心网络的接入
KR20070038618A (ko) 이동통신 기반의 가상사설망 서비스 제공 방법 및 시스템과이를 위한 이동단말기
JP2023162296A (ja) コアネットワークへの非3gppデバイスアクセス
KR101659847B1 (ko) 모바일 단말을 이용한 2채널 사용자 인증 방법

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20836898

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20836898

Country of ref document: EP

Kind code of ref document: A1