CN117176362B - Authentication method and device - Google Patents
Authentication method and device Download PDFInfo
- Publication number
- CN117176362B CN117176362B CN202311454820.3A CN202311454820A CN117176362B CN 117176362 B CN117176362 B CN 117176362B CN 202311454820 A CN202311454820 A CN 202311454820A CN 117176362 B CN117176362 B CN 117176362B
- Authority
- CN
- China
- Prior art keywords
- application
- electronic device
- server
- authentication
- digital certificate
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 101
- 238000012795 verification Methods 0.000 claims description 54
- 238000004590 computer program Methods 0.000 claims description 9
- 238000004891 communication Methods 0.000 abstract description 64
- 230000008569 process Effects 0.000 description 28
- 238000012545 processing Methods 0.000 description 22
- 230000006870 function Effects 0.000 description 21
- 238000007726 management method Methods 0.000 description 21
- 238000010586 diagram Methods 0.000 description 16
- 238000013461 design Methods 0.000 description 13
- 238000010295 mobile communication Methods 0.000 description 10
- 238000005516 engineering process Methods 0.000 description 9
- 230000004044 response Effects 0.000 description 8
- 238000004422 calculation algorithm Methods 0.000 description 6
- 230000001960 triggered effect Effects 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 5
- 230000005236 sound signal Effects 0.000 description 5
- 229920001621 AMOLED Polymers 0.000 description 4
- 230000036541 health Effects 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 238000013528 artificial neural network Methods 0.000 description 3
- 238000012790 confirmation Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000005855 radiation Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000001133 acceleration Effects 0.000 description 1
- 230000003321 amplification Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 238000013529 biological neural network Methods 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000001149 cognitive effect Effects 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000003862 health status Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 238000003199 nucleic acid amplification method Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000012805 post-processing Methods 0.000 description 1
- 239000002096 quantum dot Substances 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Landscapes
- Mobile Radio Communication Systems (AREA)
Abstract
Description
技术领域Technical field
本申请涉及通信技术领域,尤其涉及一种认证方法和装置。The present application relates to the field of communication technology, and in particular to an authentication method and device.
背景技术Background technique
为了保证应用程序与服务器之间的安全通信,可以对电子设备和应用程序(application,APP)进行安全认证,以确保应用程序和电子设备的合法性。目前,对电子设备和应用程序进行安全认证是基于软件能力实现的。In order to ensure secure communication between the application and the server, security authentication can be performed on the electronic device and the application (APP) to ensure the legitimacy of the application and the electronic device. Currently, security authentication of electronic devices and applications is implemented based on software capabilities.
例如,进行设备认证时,可以通过本地代码(native code)实现设备唯一标识计算,进而完成设备的唯一性跟踪。进行APP认证时,可以将APP的签名信息(例如,应用ID和应用签名证书指纹)打包在APP的native code中,或者,APP的native code可以调用API获取签名信息,再将签名信息发送至服务器进行验签。然而,这种认证方式存在安全漏洞。应用程序的签名信息的安全性无法保障,存在签名信息被篡改的可能性,从而导致应用程序与服务器之间的安全通信无法保障。For example, when performing device authentication, the unique identifier of the device can be calculated through native code, thereby completing the unique tracking of the device. When performing APP authentication, the APP's signature information (for example, application ID and application signature certificate fingerprint) can be packaged in the APP's native code, or the APP's native code can call the API to obtain the signature information, and then send the signature information to the server. Carry out signature verification. However, this authentication method has security vulnerabilities. The security of the application's signature information cannot be guaranteed, and there is a possibility that the signature information may be tampered with, resulting in the inability to ensure secure communication between the application and the server.
发明内容Summary of the invention
本申请实施例提供一种认证方法和装置,能够保证应用程序与服务器之间的安全通信。The embodiment of the present application provides an authentication method and device, which can ensure secure communication between the application program and the server.
第一方面,本申请实施例提供一种认证方法,应用于电子设备,电子设备中安装有第一应用,电子设备包括可信执行环境TEE;方法包括:电子设备运行第一应用从TEE获取第一数字证书,第一数字证书包括第一应用的标识和应用签名证书指纹;电子设备向第一服务器发送第一数字证书;电子设备接收来自第一服务器的认证通过消息,认证通过消息用于指示第一数字证书认证通过,以及第一应用的标识和应用签名证书指纹认证通过;电子设备基于第一应用与第一服务器进行安全通信。In a first aspect, an embodiment of the present application provides an authentication method, which is applied to an electronic device, in which a first application is installed, and the electronic device includes a trusted execution environment TEE; the method includes: the electronic device runs the first application to obtain a first digital certificate from the TEE, and the first digital certificate includes an identifier of the first application and an application signature certificate fingerprint; the electronic device sends the first digital certificate to a first server; the electronic device receives an authentication success message from the first server, and the authentication success message is used to indicate that the first digital certificate authentication is successful, as well as the identifier of the first application and the application signature certificate fingerprint authentication is successful; the electronic device communicates securely with the first server based on the first application.
基于本申请实施例提供的方法,电子设备的第一应用可以从TEE获取第一数字证书,并向第一服务器发送该证书。在该第一数字证书认证通过,且该证书中包含的应用签名证书指纹认证通过的情况下,第一应用可以与第一服务器进行安全通信。由于第一数字证书是从TEE直接获取的,可以避免端侧(电子设备侧)的恶意程序对第一数字证书中的第一应用的标识、应用签名证书指纹进行篡改的问题。并且,通过第一数字证书携带第一应用的标识、应用签名证书指纹到第一服务器,使得第一服务器既对第一数字证书进行认证,也可以对第一应用的标识和应用签名证书指纹进行认证,都认证通过后,第一应用可以与第一服务器进行通信,确保了第一应用与第一服务器之间的通信安全。Based on the method provided in the embodiment of the present application, the first application of the electronic device can obtain the first digital certificate from the TEE and send the certificate to the first server. When the first digital certificate is authenticated and the fingerprint of the application signature certificate contained in the certificate is authenticated, the first application can communicate securely with the first server. Since the first digital certificate is obtained directly from the TEE, the problem of malicious programs on the terminal side (electronic device side) tampering with the identification of the first application and the fingerprint of the application signature certificate in the first digital certificate can be avoided. In addition, by carrying the identification of the first application and the fingerprint of the application signature certificate to the first server through the first digital certificate, the first server can authenticate both the first digital certificate and the identification and fingerprint of the application signature certificate of the first application. After all authentications are passed, the first application can communicate with the first server, ensuring the communication security between the first application and the first server.
在一种可能的实施方式中,第一应用从TEE获取第一数字证书包括:电子设备运行第一应用调用通用密钥库系统HUKS接口从TEE获取第一数字证书。其中,HUKS接口(即HUKSAPI)是HUKS组件向上层软件(例如,应用程序)开放的接口。HUKS组件在安全环境下运行,例如,TEE或者具备安全能力的芯片等。这样,可以保证第一数字证书的合法性。In a possible implementation, the first application obtaining the first digital certificate from the TEE includes: the electronic device runs the first application and calls the universal keystore system HUKS interface to obtain the first digital certificate from the TEE. Among them, the HUKS interface (HUKSAPI) is the interface that HUKS components open to upper-level software (for example, applications). HUKS components run in a secure environment, such as TEE or chips with security capabilities. In this way, the legitimacy of the first digital certificate can be guaranteed.
在一种可能的实施方式中,第一数字证书还包括电子设备的唯一标识符和公钥。安全云服务器(第一服务器)首次接收到包含电子设备的唯一标识符(例如,第一UDID)的设备证书(第一数字证书)的情况下,安全云服务器可以基于第一UDID生成device Token,并建立device Token与公钥的对应关系。后续应用程序请求的数据可以使用公钥对应的私钥进行签名,并可以将签名后的数据和device Token发送给安全云服务器。安全云服务器可以校验device Token,以确保电子设备和应用程序的合法性。安全云服务器可以基于device Token对应的公钥对应用程序请求的数据进行验签,以确保报文的完整性。In one possible implementation, the first digital certificate also includes a unique identifier and a public key of the electronic device. When the secure cloud server (first server) receives a device certificate (first digital certificate) containing a unique identifier of the electronic device (e.g., a first UDID) for the first time, the secure cloud server can generate a device Token based on the first UDID and establish a corresponding relationship between the device Token and the public key. The data requested by subsequent applications can be signed using the private key corresponding to the public key, and the signed data and the device Token can be sent to the secure cloud server. The secure cloud server can verify the device Token to ensure the legitimacy of the electronic device and the application. The secure cloud server can verify the data requested by the application based on the public key corresponding to the device Token to ensure the integrity of the message.
在一种可能的实施方式中,认证通过消息包括第一令牌,第一令牌与公钥具有对应关系,第一令牌用于校验电子设备和第一应用的合法性。这样,可以根据第一令牌校验电子设备和第一应用的合法性,确保了第一应用与第一服务器之间的通信安全。In a possible implementation, the authentication pass message includes a first token, the first token has a corresponding relationship with the public key, and the first token is used to verify the legality of the electronic device and the first application. In this way, the legality of the electronic device and the first application can be verified based on the first token, ensuring communication security between the first application and the first server.
在一种可能的实施方式中,电子设备基于第一应用与第一服务器进行安全通信包括:电子设备基于第一应用,根据公钥对应的私钥对第一应用的第一业务数据进行签名得到签名数据;电子设备基于第一应用,向第一服务器发送签名数据和第一令牌。这样,可以根据第一令牌校验电子设备和第一应用的合法性,确保了第一应用与第一服务器之间的通信安全。In a possible implementation, the electronic device performing secure communication with the first server based on the first application includes: the electronic device signing the first business data of the first application based on the private key corresponding to the public key. Signature data; the electronic device sends the signature data and the first token to the first server based on the first application. In this way, the legality of the electronic device and the first application can be verified based on the first token, ensuring communication security between the first application and the first server.
在一种可能的实施方式中,电子设备基于第一应用登录第一账号,第一账号通过双因子认证,双因子校验包括密码校验和验证码校验。若电子设备是双因子校验通过的设备(即电子设备登录的账号(应用程序登录的账号)通过双因子校验),且对电子设备或应用程序进行的应用程序认证、账号认证、设备认证中的至少一种认证通过(例如,应用程序认证、账号认证、设备认证都通过,或者,应用程序认证和设备认证通过,或者,应用程序认证通过),允许高敏感接口操作,即允许电子设备的应用程序调用高敏感接口对高敏感数据进行处理。这样,可以确保第一应用与第一服务器之间的通信安全。In a possible implementation, the electronic device logs in to the first account based on the first application, the first account passes two-factor authentication, and the two-factor verification includes password verification and verification code verification. If the electronic device is a device that passes two-factor verification (that is, the account used to log in to the electronic device (the account used to log in to the application) passes the two-factor verification), and the application authentication, account authentication, and device authentication performed on the electronic device or application At least one of the authentications passed (for example, application authentication, account authentication, device authentication all passed, or application authentication and device authentication passed, or application authentication passed), allowing highly sensitive interface operations, that is, allowing electronic devices Applications call highly sensitive interfaces to process highly sensitive data. In this way, communication security between the first application and the first server can be ensured.
第二方面,本申请实施例提供一种认证方法,应用于包括电子设备和第一服务器的认证系统,电子设备中安装有第一应用,电子设备包括可信执行环境TEE,方法包括:电子设备运行第一应用从TEE获取第一数字证书,第一数字证书包括第一应用的标识、应用签名证书指纹;电子设备向第一服务器发送第一数字证书;第一服务器接收第一数字证书,基于证书链对第一数字证书进行认证;第一服务器对第一数字证书认证通过后,对第一应用的标识和应用签名证书指纹进行认证;第一服务器对第一应用的标识和应用签名证书指纹认证通过后,向第一应用发送认证通过消息,认证通过消息用于指示第一数字证书认证通过,以及第一应用的标识和应用签名证书指纹认证通过;电子设备接收来自第一服务器的认证通过消息;电子设备基于第一应用与第一服务器进行安全通信。In a second aspect, embodiments of the present application provide an authentication method, applied to an authentication system including an electronic device and a first server. The electronic device has a first application installed, and the electronic device includes a trusted execution environment TEE. The method includes: the electronic device Run the first application to obtain the first digital certificate from the TEE. The first digital certificate includes the identification of the first application and the fingerprint of the application signature certificate; the electronic device sends the first digital certificate to the first server; the first server receives the first digital certificate, based on The certificate chain authenticates the first digital certificate; after the first server authenticates the first digital certificate, it authenticates the identity of the first application and the fingerprint of the application signature certificate; the first server authenticates the identity of the first application and the fingerprint of the application signature certificate After the authentication is passed, an authentication pass message is sent to the first application. The authentication pass message is used to indicate that the first digital certificate has passed the authentication, and that the first application's identity and application signature certificate fingerprint have passed the authentication; the electronic device receives the authentication pass from the first server. Message; the electronic device performs secure communication with the first server based on the first application.
基于本申请实施例提供的方法,电子设备的第一应用可以从TEE获取第一数字证书,并向第一服务器发送该证书。第一服务器可以对第一数字证书进行认证,并且对第一应用的标识和应用签名证书指纹进行认证。在该第一数字证书认证通过,且该证书中包含的应用签名证书指纹认证通过的情况下,第一应用可以与第一服务器进行安全通信。由于第一数字证书是从TEE直接获取的,可以避免端侧(电子设备侧)的恶意程序对第一数字证书中的第一应用的标识、应用签名证书指纹进行篡改的问题。并且,通过第一数字证书携带第一应用的标识、应用签名证书指纹到第一服务器,使得第一服务器既对第一数字证书进行认证,也可以对第一应用的标识和应用签名证书指纹进行认证,都认证通过后,第一应用可以与第一服务器进行通信,确保了第一应用与第一服务器之间的通信安全。Based on the method provided by the embodiments of this application, the first application of the electronic device can obtain the first digital certificate from the TEE and send the certificate to the first server. The first server may authenticate the first digital certificate and authenticate the identity of the first application and the application signing certificate fingerprint. If the first digital certificate passes the authentication and the application signature certificate fingerprint contained in the certificate passes the authentication, the first application can communicate securely with the first server. Since the first digital certificate is obtained directly from the TEE, the problem of malicious programs on the terminal side (electronic device side) tampering with the identity of the first application and the fingerprint of the application signature certificate in the first digital certificate can be avoided. Furthermore, the first digital certificate carries the identity of the first application and the fingerprint of the application signature certificate to the first server, so that the first server not only authenticates the first digital certificate, but also authenticates the identity of the first application and the fingerprint of the application signature certificate. After the authentication is passed, the first application can communicate with the first server, ensuring the security of communication between the first application and the first server.
在一种可能的实施方式中,电子设备运行第一应用从TEE获取第一数字证书包括:电子设备运行第一应用调用通用密钥库系统HUKS接口从TEE获取第一数字证书。In a possible implementation, the electronic device running the first application to obtain the first digital certificate from the TEE includes: the electronic device running the first application calling the universal keystore system HUKS interface to obtain the first digital certificate from the TEE.
在一种可能的实施方式中,第一数字证书还包括电子设备的唯一标识符和公钥。In a possible implementation, the first digital certificate also includes a unique identifier and a public key of the electronic device.
在一种可能的实施方式中,方法还包括:第一服务器根据电子设备的唯一标识符生成第一令牌;第一服务器建立第一令牌与公钥的对应关系,第一令牌用于校验电子设备和第一应用的合法性。In a possible implementation, the method further includes: the first server generates a first token according to the unique identifier of the electronic device; the first server establishes a correspondence between the first token and the public key, and the first token is used to Verify the legality of electronic devices and first applications.
在一种可能的实施方式中,认证通过消息包括第一令牌。In a possible implementation, the authentication pass message includes the first token.
在一种可能的实施方式中,电子设备基于第一应用与第一服务器进行安全通信包括:电子设备基于第一应用,根据公钥对应的私钥对第一应用的第一业务数据进行签名得到签名数据;电子设备基于第一应用,向第一服务器发送签名数据和第一令牌;第一服务器接收签名数据和第一令牌;第一服务器根据第一令牌对应的公钥对签名数据进行验签。In a possible implementation, the electronic device performing secure communication with the first server based on the first application includes: the electronic device signing the first business data of the first application based on the private key corresponding to the public key. Signature data; the electronic device sends the signature data and the first token to the first server based on the first application; the first server receives the signature data and the first token; the first server signs the data according to the public key corresponding to the first token Carry out signature verification.
在一种可能的实施方式中,电子设备基于第一应用登录第一账号,第一账号通过双因子认证,双因子校验包括密码校验和验证码校验。In a possible implementation, the electronic device logs in to the first account based on the first application, the first account passes two-factor authentication, and the two-factor verification includes password verification and verification code verification.
第三方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令。当计算机指令在电子设备(如手机)上运行时,使得该电子设备执行如第一方面或第二方面及其任一种可能的设计方式所述的方法。In a third aspect, the present application provides a computer-readable storage medium that includes computer instructions. When the computer instructions are run on an electronic device (such as a mobile phone), the electronic device is caused to execute the method described in the first aspect or the second aspect and any possible design manner thereof.
第四方面,本申请提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如第一方面或第二方面及其任一种可能的设计方式所述的方法。In the fourth aspect, the present application provides a computer program product. When the computer program product is run on a computer, it causes the computer to execute the method described in the first aspect or the second aspect and any possible design manner thereof. method.
第五方面,本申请实施例提供了一种认证装置,包括处理器,处理器和存储器耦合,存储器存储有程序指令,当存储器存储的程序指令被处理器执行时使得所述装置实现上述第一方面或第二方面及其任一种可能的设计方式所述的方法。所述装置可以为电子设备或第一服务器;或可以为电子设备或第一服务器中的一个组成部分,如芯片。In a fifth aspect, embodiments of the present application provide an authentication device, which includes a processor. The processor is coupled to a memory. The memory stores program instructions. When the program instructions stored in the memory are executed by the processor, the device implements the first step described above. The method described in the aspect or the second aspect and any possible design method thereof. The device may be an electronic device or the first server; or may be a component of the electronic device or the first server, such as a chip.
第六方面,本申请实施例提供了一种认证装置,所述装置可以按照功能划分为不同的逻辑单元或模块,各单元或模块执行不同的功能,以使得所述装置执行上述第一方面或第二方面及其任一种可能的设计方式所述的方法。In the sixth aspect, embodiments of the present application provide an authentication device. The device can be divided into different logical units or modules according to functions, and each unit or module performs different functions, so that the device performs the above first aspect or The method described in the second aspect and any possible design method thereof.
第七方面,本申请提供一种认证系统,包括电子设备和第一服务器,其中,电子设备可以执行如第一方面或第二方面及其任一种可能的设计方式所述的方法,第一服务器可以执行如第二方面及其任一种可能的设计方式所述的方法。In the seventh aspect, the present application provides an authentication system, including an electronic device and a first server, wherein the electronic device can execute the method described in the first aspect or the second aspect and any possible design thereof, and the first server can execute the method described in the second aspect and any possible design thereof.
第八方面,本申请提供一种芯片系统,该芯片系统包括一个或多个接口电路和一个或多个处理器。该接口电路和处理器通过线路互联。上述芯片系统可以应用于包括通信模块和存储器的电子设备或第一服务器。该接口电路用于从电子设备或第一服务器的存储器接收信号,并向处理器发送接收到的信号,该信号包括存储器中存储的计算机指令。当处理器执行该计算机指令时,电子设备或第一服务器可以执行如第一方面及其任一种可能的设计方式所述的方法。In an eighth aspect, the present application provides a chip system, which includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected through lines. The above chip system can be applied to an electronic device or a first server including a communication module and a memory. The interface circuit is configured to receive a signal from a memory of the electronic device or the first server and send the received signal to the processor, the signal including computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device or the first server can execute the method described in the first aspect and any possible design manner thereof.
可以理解地,上述提供的第三方面所述的计算机可读存储介质,第四方面所述的计算机程序产品,第五方面、第六方面所述的装置,第七方面所述的系统,以及第八方面所述的芯片系统所能达到的有益效果,可参考如第一方面及其任一种可能的设计方式中的有益效果,此处不再赘述。It can be understood that the computer-readable storage medium described in the third aspect, the computer program product described in the fourth aspect, the devices described in the fifth and sixth aspects, the system described in the seventh aspect, and The beneficial effects that can be achieved by the chip system described in the eighth aspect can be referred to the beneficial effects in the first aspect and any of its possible design methods, and will not be described again here.
附图说明Description of drawings
图1为本申请实施例提供的一种系统架构示意图;FIG1 is a schematic diagram of a system architecture provided in an embodiment of the present application;
图2为本申请实施例提供的又一种系统架构示意图;Figure 2 is a schematic diagram of another system architecture provided by an embodiment of the present application;
图3为本申请实施例提供的一种加入信任环的流程示意图;FIG3 is a schematic diagram of a process of joining a trust ring provided in an embodiment of the present application;
图4为本申请实施例提供的一种电子设备的硬件结构示意图;Figure 4 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application;
图5为本申请实施例提供的一种电子设备的软件架构示意图;Figure 5 is a schematic diagram of the software architecture of an electronic device provided by an embodiment of the present application;
图6为本申请实施例提供的一种云服务器的硬件结构示意图;FIG6 is a schematic diagram of the hardware structure of a cloud server provided in an embodiment of the present application;
图7为本申请实施例提供的一种云服务器的软件架构示意图;Figure 7 is a schematic diagram of the software architecture of a cloud server provided by an embodiment of the present application;
图8为本申请实施例提供的一种信号交互示意图;FIG8 is a schematic diagram of a signal interaction provided in an embodiment of the present application;
图9为本申请实施例提供的一种显示示意图;Figure 9 is a schematic display diagram provided by an embodiment of the present application;
图10为本申请实施例提供的又一种信号交互示意图;Figure 10 is another schematic diagram of signal interaction provided by an embodiment of the present application;
图11为本申请实施例提供的又一种信号交互示意图;Figure 11 is another schematic diagram of signal interaction provided by an embodiment of the present application;
图12为本申请实施例提供的又一种信号交互示意图;Figure 12 is another schematic diagram of signal interaction provided by an embodiment of the present application;
图13为本申请实施例提供的芯片系统的结构示意图。FIG13 is a schematic diagram of the structure of the chip system provided in an embodiment of the present application.
具体实施方式Detailed ways
为了下述各实施例的描述清楚简洁,首先给出相关概念或技术的简要介绍:In order to describe the following embodiments clearly and concisely, a brief introduction to related concepts or technologies is first given:
密钥:一种在明文转换为密文或将密文转换为明文的算法中输入的参数。密钥分为对称密钥与非对称密钥。非对称密钥可以包括一个公钥(public key,pk)和一个私钥(secret key,sk),公钥可以自由发布,私钥则由用户秘密保存。Key: A parameter entered into an algorithm that converts plaintext to ciphertext or ciphertext to plaintext. Keys are divided into symmetric keys and asymmetric keys. Asymmetric keys can include a public key (pk) and a private key (secret key, sk). The public key can be freely released, and the private key is kept secretly by the user.
签名(signatures ):采用公钥或私钥对报文(或其他信息,例如,哈希值)进行加密(encryption)的过程相当于生成签名。Signatures: The process of encrypting a message (or other information, such as a hash value) using a public key or private key is equivalent to generating a signature.
验签:采用与公钥对应的私钥,或者私钥对应的公钥进行解密的过程相当于验签(即验证签名),若采用公钥或私钥解密得到的报文与原报文一致,则验证签名成功。对报文进行签名可以保证报文的完整性,若采用公钥或私钥验签成功,则说明报文在传输过程中未被篡改。Signature verification: The process of decrypting using the private key corresponding to the public key or the public key corresponding to the private key is equivalent to signature verification (that is, verifying the signature). If the message decrypted using the public key or private key is consistent with the original message , then the signature verification is successful. Signing the message can ensure the integrity of the message. If the signature verification using the public key or private key is successful, it means that the message has not been tampered with during transmission.
RSA加密算法:是现在广泛使用的现代加密的第一代加密算法,基于大素数分解难的数学问题来保证加密算法的安全性。RSA encryption algorithm: It is the first generation encryption algorithm of modern encryption that is widely used today. It is based on the difficult mathematical problem of decomposing large prime numbers to ensure the security of the encryption algorithm.
基于椭圆曲线的加密算法(elliptic curve cryptography,ECC),也可以称为椭圆曲线密码学,是基于有限域的椭圆曲线和复杂的椭圆曲线离散对数。ECC可以实现非对称加密所需要的大部分能力,包括: 加密、签名等。ECC相对于RSA既能保证安全性又能节约计算资源。Elliptic curve cryptography (ECC), also known as elliptic curve cryptography, is based on finite field elliptic curves and complex elliptic curve discrete logarithms. ECC can realize most of the capabilities required for asymmetric encryption, including: encryption, signature, etc. Compared with RSA, ECC can ensure security and save computing resources.
数字证书:由证书授权中心(certificate authority ,CA)签发的包含公开密钥拥有者信息以及公开密钥的权威性的电子文档。例如,数字证书可以包含一个公开密钥、名称以及证书授权中心的数字签名。数字证书可以用于证明公开密钥拥有者的身份信息。Digital certificate: An authoritative electronic document containing public key owner information and the public key issued by a certificate authority (CA). For example, a digital certificate can contain a public key, name, and digital signature of the certificate authority. Digital certificates can be used to prove the identity of the owner of a public key.
通用运行环境(rich execution environment,REE):也可以称为富执行环境或普通执行环境或不可信执行环境,是指移动端的系统运行环境,其中可以运行Android、IOS和Linux等操作系统。REE的开放和扩展性好但安全性不高。Universal execution environment (rich execution environment, REE): It can also be called rich execution environment or ordinary execution environment or untrusted execution environment. It refers to the system running environment of the mobile terminal, which can run operating systems such as Android, IOS and Linux. REE has good openness and scalability but low security.
可信执行环境(trusted execution environment,TEE):也可以称安全侧或安全区,是需要授权才能访问的区域。TEE与REE共存于电子设备中的运行环境,其通过硬件的支撑,实现与REE的隔离,具有安全能力并且能够抵御常规REE侧易遭受的软件攻击。TEE有自身的运行空间,定义了严格的保护措施,因此,比REE的安全级别更高,能够保护TEE中的资产(assets),如数据,软件等,免受软件攻击,抵抗特定类型的安全威胁。Trusted execution environment (TEE): It can also be called the safe side or safe zone. It is an area that requires authorization to access. TEE and REE coexist in the operating environment of electronic devices. Through hardware support, it is isolated from REE, has security capabilities, and can resist software attacks that conventional REEs are prone to. TEE has its own operating space and defines strict protection measures. Therefore, it has a higher security level than REE and can protect assets in TEE, such as data, software, etc., from software attacks and resist specific types of security. threaten.
REE+TEE架构:是指通过TEE与REE结合共同为应用提供服务的架构。也就是说,TEE与REE共同存在于电子设备中。示例性的,TEE通过硬件的支撑,可实现与REE相隔离的运行机制。TEE有自身的运行空间,比REE的安全级别更高,能够保护TEE中的资产(如数据,软件等)免受软件攻击。只有授权的安全软件才能在TEE中执行,同时它也保护了安全软件的资源和数据的机密性。相比REE,由于其隔离和权限控制等保护机制,TEE能够更好的保护数据和资源的安全性。REE+TEE architecture: refers to an architecture that combines TEE and REE to provide services for applications. In other words, TEE and REE coexist in electronic equipment. For example, TEE can implement an operating mechanism that is isolated from REE through hardware support. TEE has its own running space, which has a higher security level than REE and can protect assets in TEE (such as data, software, etc.) from software attacks. Only authorized security software can be executed in the TEE, and it also protects the confidentiality of the resources and data of the security software. Compared with REE, TEE can better protect the security of data and resources due to its isolation and permission control and other protection mechanisms.
重放攻击(replay attacks) :又称重播攻击、回放攻击或新鲜性攻击(freshnessattacks),是指攻击者发送一个目的主机已接收过的包,来达到欺骗系统的目的,主要用于身份认证过程,破坏认证的正确性。Replay attacks: also known as replay attacks, replay attacks or freshness attacks, refer to the attacker sending a packet that has been received by the destination host to achieve the purpose of deceiving the system. It is mainly used in the identity authentication process. , destroying the correctness of the authentication.
目前,进行APP认证时,可以将APP的签名信息(例如,应用ID和应用签名证书指纹)打包在APP的本地代码(native code)中,或者,APP的native code可以调用API获取签名信息,再将签名信息发送至服务器进行验签。然而,这种认证方式存在安全漏洞。应用程序的签名信息的安全性无法保障,存在签名信息被篡改的可能性,从而导致应用程序与服务器之间的安全通信无法保障。Currently, when APP authentication is performed, the APP's signature information (for example, the application ID and the fingerprint of the application signature certificate) can be packaged in the APP's native code, or the APP's native code can call an API to obtain the signature information, and then send the signature information to the server for signature verification. However, this authentication method has security vulnerabilities. The security of the application's signature information cannot be guaranteed, and there is a possibility that the signature information has been tampered with, which makes the secure communication between the application and the server unguaranteed.
本申请实施例提供一种认证方法和装置,能够对电子设备和应用程序的合法性进行认证,从而保证应用程序与服务器之间的安全通信。The embodiments of the present application provide an authentication method and device, which can authenticate the legitimacy of electronic devices and applications, thereby ensuring secure communication between the application and the server.
本申请实施例提供的认证方法和装置可以应用于以下场景:The authentication method and device provided by the embodiments of this application can be applied to the following scenarios:
(1)云服务器(例如,安全云服务器)对应用程序的合法性进行认证的场景。(1) A cloud server (e.g., a secure cloud server) authenticates the legitimacy of an application.
(2)云服务器对应用程序的合法性和电子设备的合法性进行认证的场景。(2) Scenario where the cloud server authenticates the legality of the application and the legality of the electronic device.
(3)云服务器对应用程序的合法性,设备的合法性以及账号的可信设备(登录同一账号且通过认证的设备)进行认证的场景。(3) Scenario where the cloud server authenticates the legitimacy of the application, the legitimacy of the device, and the trusted devices of the account (devices that log in to the same account and pass authentication).
图1示例性地示出了本申请实施例适用的一种系统架构示意图。如图1所示,该系统架构包括:服务器001和电子设备002。其中,服务器001可通过通信网络与电子设备002连接。其中,服务器001可以是位于网络侧的云服务器或者服务器集群等。服务器001可以为安全云服务器。服务器001可以对电子设备002以及电子设备002上安装的应用程序进行认证,以保证电子设备002以及电子设备002上安装的应用程序的合法性。Figure 1 exemplarily shows a schematic diagram of a system architecture applicable to the embodiment of the present application. As shown in Figure 1, the system architecture includes: server 001 and electronic device 002. Among them, the server 001 can be connected to the electronic device 002 through a communication network. The server 001 may be a cloud server or a server cluster located on the network side. Server 001 can be a secure cloud server. The server 001 can authenticate the electronic device 002 and the applications installed on the electronic device 002 to ensure the legitimacy of the electronic device 002 and the applications installed on the electronic device 002 .
图2示例性地示出了本申请实施例适用的另一种系统架构示意图。如图2所示,该系统架构包括:服务器001、电子设备002、电子设备003、电子设备004以及服务器005。其中,服务器001可通过通信网络与电子设备002、电子设备003和电子设备004连接。服务器005可通过通信网络与电子设备002、电子设备003和电子设备004连接。服务器001可通过通信网络与服务器005连接。其中,服务器001和服务器005是位于网络侧的云服务器或者服务器集群等。服务器001可以为安全云服务器,服务器005可以为账号云服务器。Figure 2 exemplarily shows another system architecture schematic diagram applicable to the embodiment of the present application. As shown in Figure 2, the system architecture includes: server 001, electronic device 002, electronic device 003, electronic device 004 and server 005. Among them, the server 001 can be connected to the electronic device 002, the electronic device 003 and the electronic device 004 through the communication network. The server 005 can be connected with the electronic device 002, the electronic device 003 and the electronic device 004 through a communication network. Server 001 can be connected to server 005 through a communication network. Among them, server 001 and server 005 are cloud servers or server clusters located on the network side. Server 001 can be a secure cloud server, and server 005 can be an account cloud server.
图2中,服务器005能够与电子设备002、电子设备003和电子设备004进行信息交互。例如电子设备002、电子设备003和电子设备004可以从服务器005获取系统认证帐号信息(例如,荣耀®账号),从而电子设备002、电子设备003和电子设备004之间可以验证对端是否登录同一系统认证帐号。若电子设备002、电子设备003和电子设备004登录同一系统认证帐号,可以认为电子设备002、电子设备003和电子设备004处于同一个信任环,从而电子设备002、电子设备003和电子设备004之间可以安全地进行数据共享。In Figure 2, the server 005 can interact with the electronic device 002, the electronic device 003 and the electronic device 004. For example, electronic device 002, electronic device 003 and electronic device 004 can obtain system authentication account information (for example, Honor® account) from server 005, so that electronic device 002, electronic device 003 and electronic device 004 can verify whether the other end is logged in to the same System authentication account. If electronic device 002, electronic device 003 and electronic device 004 log in to the same system authentication account, it can be considered that electronic device 002, electronic device 003 and electronic device 004 are in the same trust ring, so that electronic device 002, electronic device 003 and electronic device 004 Data can be shared securely.
图2中,服务器001可以对电子设备002、电子设备003和电子设备004中的任一个电子设备以及该电子设备上安装的应用程序进行认证。并且,服务器001还可以对电子设备002、电子设备003和电子设备004中的任一个电子设备是否属于信任环的可信设备(登录同一账号且通过认证的设备)进行认证。In Figure 2, the server 001 can authenticate any one of the electronic devices 002, 003, and 004 as well as the application installed on the electronic device. Furthermore, the server 001 can also authenticate whether any of the electronic devices 002, 003, and 004 belongs to a trusted device in the trust ring (a device that logs in to the same account and passes the authentication).
图2中,电子设备002、电子设备003和电子设备004可以是各种不同类型的电子设备,例如,电子设备002可以是平板电脑,电子设备003可以是手机,电子设备004可以是笔记本电脑。In Figure 2, electronic device 002, electronic device 003 and electronic device 004 may be various types of electronic devices. For example, electronic device 002 may be a tablet computer, electronic device 003 may be a mobile phone, and electronic device 004 may be a laptop computer.
图2中,电子设备002、电子设备003和电子设备004之间通过有线和/或无线的方式建立连接,电子设备002、电子设备003和电子设备004与服务器001之间可以通过有线和/或无线的方式建立连接。例如,电子设备002、电子设备003和电子设备004之间可以通过无线通信网络互联。该无线通信网络可以是局域网,也可以是通过中继(relay)设备转接的广域网。当该通信网络为局域网时,示例性的,该通信网络可以是Wi-Fi热点网络、Wi-Fi P2P网络、蓝牙网络、zigbee网络或NFC网络等近距离通信网络。当该通信网络为广域网时,示例性的,该通信网络可以是第三代移动通信技术(3rd-generation wireless telephonetechnology,3G)网络、第四代移动通信技术(the 4th generation mobile communicationtechnology,4G)网络、第五代移动通信技术(5th-generation mobile communicationtechnology,5G)网络、未来演进的公共陆地移动网络(public land mobile network,PLMN)或因特网等。在图2所示的场景中,不同电子设备之间可以通过通信网络发送数据,例如发送图片、文本、视频,或者电子设备对图片、文本或视频等对象的检索结果等。In Figure 2, electronic device 002, electronic device 003 and electronic device 004 are connected through wired and/or wireless methods. Electronic device 002, electronic device 003 and electronic device 004 can be connected to server 001 through wired and/or wireless methods. Establish a connection wirelessly. For example, the electronic device 002, the electronic device 003, and the electronic device 004 may be interconnected through a wireless communication network. The wireless communication network may be a local area network or a wide area network transferred through a relay device. When the communication network is a local area network, for example, the communication network may be a short-range communication network such as a Wi-Fi hotspot network, a Wi-Fi P2P network, a Bluetooth network, a zigbee network, or an NFC network. When the communication network is a wide area network, for example, the communication network may be a 3rd-generation wireless telephone technology (3G) network or a 4th generation mobile communication technology (4G) network. , fifth-generation mobile communication technology (5th-generation mobile communication technology, 5G) network, future evolved public land mobile network (public land mobile network, PLMN) or the Internet, etc. In the scenario shown in Figure 2, different electronic devices can send data through the communication network, such as sending pictures, texts, videos, or electronic devices' retrieval results for objects such as pictures, texts, or videos, etc.
需要说明的是,上述系统中还可以包括更多的电子设备,例如还可以包括智能电视、智能手表等等。或者上述系统中可以包括少于三个电子设备,例如只包括手机和笔记本电脑,或者只包括手机和平板电脑等等,本申请实施例对此并不作限制。It should be noted that the above system may include more electronic devices, such as a smart TV, a smart watch, etc. Or the above system may include less than three electronic devices, such as only a mobile phone and a laptop, or only a mobile phone and a tablet computer, etc., and the embodiments of the present application are not limited to this.
在一种可能的设计中,电子设备(例如,电子设备002、电子设备003和电子设备004)可以采用荣耀®操作系统(MagicOS)。MagicOS 可以为登录同一账号(例如,荣耀®帐号)的设备互联提供设备认证服务。各MagicOS设备(即采用MagicOS的电子设备)在登录荣耀®帐号后可以生成公私钥对作为各自的身份标识,并向安全云服务器申请对其公钥进行认证。认证通过的同一荣耀®帐号下的电子设备可以加入同一信任环,可在设备互联业务中互相认证并交换各自的公钥,确认对端是可信设备。进一步地,基于双方的公私钥对,登录同一荣耀®帐号的电子设备间可以进行密钥协商并建立安全通信通道。仿冒设备和非本帐号下的其他设备将无法通过认证鉴权。In one possible design, the electronic devices (eg, electronic device 002, electronic device 003, and electronic device 004) may adopt the Honor® operating system (MagicOS). MagicOS can provide device authentication services for the interconnection of devices logged in to the same account (for example, Honor® account). Each MagicOS device (i.e., an electronic device using MagicOS) can generate a public and private key pair as its own identity after logging in to the Honor® account, and apply to the secure cloud server for authentication of its public key. Electronic devices under the same Honor® account that have passed the authentication can join the same trust ring, authenticate each other and exchange their respective public keys in the device interconnection business to confirm that the other end is a trusted device. Furthermore, based on the public and private key pairs of both parties, electronic devices logged into the same Honor® account can conduct key negotiation and establish a secure communication channel. Counterfeit devices and other devices not under this account will not be able to pass authentication.
如图3所示,以设备C为例,对设备C加入信任环(设备A和设备B组成的信任环)的过程进行说明。As shown in Figure 3, taking device C as an example, the process of adding device C to the trust ring (the trust ring composed of device A and device B) is explained.
1、设备C的应用程序(例如,荣耀®商城)登录荣耀®云服务器。1. The application of device C (for example, Honor® Mall) logs in to the Honor® cloud server.
2、应用程序(例如,荣耀®商城)向信任环应用发送登录通知。2. The application (for example, Honor® Mall) sends a login notification to the Trust Ring application.
其中,登录通知可以包括应用程序登录的荣耀®账号。信任环应用可以通过信任环服务与信任环TA交互。信任环TA在安全环境下运行,例如,TEE或者具备安全能力的芯片等。信任环TA中可以保存设备C登录荣耀®帐号后生成的公钥(即设备C对应的公钥)和私钥。Among them, the login notification may include the Honor® account used to log in to the application. Trust ring applications can interact with trust ring TA through trust ring services. The trust ring TA runs in a secure environment, such as TEE or a chip with security capabilities. The public key (that is, the public key corresponding to device C) and the private key generated by device C after logging into the Honor® account can be saved in the trust ring TA.
3、信任环应用向安全云服务器进行设备注册,上传设备C对应的公钥。3. The trust ring application registers the device with the secure cloud server and uploads the public key corresponding to device C.
信任环应用可以从信任环TA获取设备C对应的公钥(例如,公钥C),并将该公钥发送至安全云服务器。The trust ring application can obtain the public key corresponding to the device C (eg, public key C) from the trust ring TA, and send the public key to the secure cloud server.
4、安全云服务器向账号云服务器发送账号验证请求。4. The security cloud server sends an account verification request to the account cloud server.
5、账号云服务器向安全云服务器发送验证确认消息。5. The account cloud server sends a verification confirmation message to the security cloud server.
账号云服务器对设备C登录的账号认证通过后,可以向安全云服务器发送验证确认消息,表示设备C是加入信任环的可信设备。After the account cloud server passes the authentication of the account logged in by device C, it can send a verification confirmation message to the security cloud server, indicating that device C is a trusted device that joins the trust ring.
6、安全云服务器更新可信设备列表。6. The secure cloud server updates the trusted device list.
安全云服务器可以根据设备C登录的荣耀®账号将设备C的公钥和设备C的唯一标识符(例如,设备唯一标识符(unique device identifier,UDID))保存到该荣耀®账号对应的可信设备列表。并且,安全云服务器可以将可信设备列表同步到账号云服务器。The secure cloud server can save the public key of device C and the unique identifier of device C (for example, unique device identifier (UDID)) according to the Honor® account logged in by device C to the trusted account corresponding to the Honor® account. Device List. Moreover, the security cloud server can synchronize the trusted device list to the account cloud server.
安全云服务器可以在原有的可信设备列表中新增设备C的标识(例如,UDID)和设备C的公钥得到新的可信设备列表。即信任环服务器可以更新可信设备列表的版本,例如,原有的可信设备列表的版本为version16,新的可信设备列表的版本可以为version17。The secure cloud server can add the identifier of device C (for example, UDID) and the public key of device C to the original trusted device list to obtain a new trusted device list. That is, the trusted ring server can update the version of the trusted device list. For example, if the original trusted device list is version 16, the new trusted device list can be version 17.
示例性的,原有的可信设备列表可以如表1所示,包括设备A的UDID和公钥(公钥A),以及设备B的UDID和公钥(公钥B),设备A和设备B登录的账号相同,例如可以为alice@honor.com。For example, the original trusted device list can be as shown in Table 1, including the UDID and public key of device A (public key A), and the UDID and public key of device B (public key B). Device A and device B logs in with the same account, for example, alice@honor.com.
表1Table 1
新的可信设备列表可以如表2所示,可以包括设备A、设备B和设备C分别对应的UDID和公钥。其中,设备C对应的公钥为公钥C。The new trusted device list may be as shown in Table 2, and may include the UDIDs and public keys corresponding to device A, device B, and device C respectively. Among them, the public key corresponding to device C is public key C.
表2Table 2
7、安全云服务器向设备C发送安全云服务器签名的公钥属性凭据。7. The secure cloud server sends the public key attribute certificate signed by the secure cloud server to device C.
其中,公钥属性凭据用于指示认证通过的同一荣耀®帐号下的电子设备。Among them, the public key attribute credential is used to indicate the electronic device under the same Honor® account that has passed the authentication.
设备C保存公钥属性凭据。设备C可以在设备互联业务中,与认证通过的同一荣耀®帐号下的电子设备互相认证并交换各自的公钥,确认对端是可信设备。进一步地,基于双方的公私钥对,登录同一荣耀®帐号的电子设备间可以进行密钥协商并建立安全通信通道。Device C holds the public key attribute credentials. Device C can mutually authenticate and exchange their respective public keys with electronic devices under the same Honor® account that have passed the authentication in the device interconnection business to confirm that the other end is a trusted device. Furthermore, based on the public and private key pairs of both parties, electronic devices logged into the same Honor® account can conduct key negotiation and establish a secure communication channel.
下面以电子设备(例如,电子设备002-电子设备004中的任一个电子设备)为电子设备100的硬件结构为例进行说明。图4示出了电子设备100的硬件结构示意图。电子设备100可以是手机、平板电脑、桌面型计算机、膝上型计算机、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence, AI)设备、可穿戴式设备、车载设备、智能家居设备和/或智慧城市设备,本申请实施例对该电子设备的具体类型不作特殊限制。The following description takes the electronic device (for example, any one of the electronic device 002 - the electronic device 004 ) as the hardware structure of the electronic device 100 as an example. FIG. 4 shows a schematic diagram of the hardware structure of the electronic device 100. The electronic device 100 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (personal digital assistant) digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, artificial intelligence (AI) device, wearable device, vehicle-mounted device, smart home device and/or Smart city equipment, the embodiment of this application does not place special restrictions on the specific type of electronic equipment.
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(Universal Serial Bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,摄像头193,显示屏194,以及用户标识模块(Subscriber Identification Module,SIM)卡接口195等。The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2. , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, camera 193, display screen 194, and subscriber identification module (Subscriber Identification Module , SIM) card interface 195, etc.
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.
其中,处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(Application Processor,AP),调制解调处理器,图形处理器(Graphics Processingunit,GPU),图像信号处理器(Image Signal Processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(Digital Signal Processor,DSP),基带处理器,和/或神经网络处理器(Neural-network Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (Application Processor, AP), a modem processor, a graphics processor (Graphics Processing unit, GPU), an image signal processing unit. Image Signal Processor (ISP), controller, memory, video codec, Digital Signal Processor (DSP), baseband processor, and/or Neural-network Processing Unit (NPU) )wait. Among them, different processing units can be independent devices or integrated in one or more processors.
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 . The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像视频播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。Internal memory 121 may be used to store computer executable program code, which includes instructions. The processor 110 executes instructions stored in the internal memory 121 to execute various functional applications and data processing of the electronic device 100 . The internal memory 121 may include a program storage area and a data storage area. Among them, the stored program area can store the operating system, at least one application program required for a function (such as a sound playback function, an image video playback function, etc.), etc. The storage data area may store data created during use of the electronic device 100 (such as audio data, phone book, etc.).
在一些实施例中,处理器110可以包括一个或多个接口。USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备100,例如AR设备等。In some embodiments, processor 110 may include one or more interfaces. The USB interface 130 is an interface that complies with USB standard specifications, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through them. This interface can also be used to connect other electronic devices 100, such as AR devices, etc.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 can also be used to monitor battery capacity, battery cycle times, battery health status (leakage, impedance) and other parameters. In some other embodiments, the power management module 141 may also be provided in the processor 110 . In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(Low Noise Amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。The mobile communication module 150 can provide solutions for wireless communication including 2G/3G/4G/5G applied on the electronic device 100 . The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (Low Noise Amplifier, LNA), etc. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation.
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(WirelessLocal Area Networks,WLAN)(如Wi-Fi网络),蓝牙(Bluetooth,BT),全球导航卫星系统(Global Navigation Satellite System,GNSS),调频(Frequency Modulation,FM),NFC,红外技术(Infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide wireless local area networks (Wireless Local Area Networks, WLAN) (such as Wi-Fi network), Bluetooth (Bluetooth, BT), and global navigation satellite system (Global Navigation Satellite System, GNSS) applied on the electronic device 100. , Frequency Modulation (FM), NFC, infrared technology (Infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playback, recording, etc.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals.
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。The speaker 170A, also called a "horn", is used to convert audio electrical signals into sound signals.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。Receiver 170B, also called "earpiece", is used to convert audio electrical signals into sound signals.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。电子设备100可以设置至少一个麦克风170C。The microphone 170C, also called a "microphone" or "speaker", is used to convert a sound signal into an electrical signal. The electronic device 100 may be provided with at least one microphone 170C.
耳机接口170D用于连接有线耳机。The headphone interface 170D is used to connect wired headphones.
传感器模块180可以包括1个或多个传感器,这些传感器可以为相同类型或不同类型。传感器模块180可以包括压力传感器,陀螺仪传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,触摸传感器,环境光传感器等。The sensor module 180 may include one or more sensors, which may be of the same type or different types. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a touch sensor, an ambient light sensor, and the like.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The buttons 190 include a power button, a volume button, etc. Key 190 may be a mechanical key. It can also be a touch button. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(Liquid Crystal Display,LCD),有机发光二极管(Organic Light-EmittingDiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(Active-MatrixOrganic Light Emitting Diode的,AMOLED),柔性发光二极管(Flex Light-EmittingDiode,FLED),Mini LED,Micro LED,Micro-OLED,量子点发光二极管(Quantum Dot LightEmitting Diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos, etc. Display 194 includes a display panel. The display panel can use a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (Active-MatrixOrganic Light Emitting Diode). (AMOLED), Flexible Light-Emitting Diode (FLED), Mini LED, Micro LED, Micro-OLED, Quantum Dot LightEmitting Diodes (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
电子设备100通过GPU、显示屏194以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is an image processing microprocessor and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现获取图像的功能。The electronic device 100 can realize the function of acquiring images through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像或视频。ISP还可以对图像的噪点,亮度,皮肤进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image or video visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(Charge Coupled Device,CCD)或互补金属氧化物半导体(Complementary Metal-Oxide-Semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像或视频信号。ISP将数字图像或视频信号输出到DSP加工处理。DSP将数字图像或视频信号转换成标准的RGB,YUV等格式的图像或视频信号。Camera 193 is used to capture still images or video. The object passes through the lens to produce an optical image that is projected onto the photosensitive element. The photosensitive element can be a Charge Coupled Device (CCD) or a Complementary Metal-Oxide-Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image or video signal. ISP outputs digital images or video signals to DSP for processing. DSP converts digital images or video signals into standard RGB, YUV and other formats.
在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。例如,在一些实施例中,电子设备100可以利用N个摄像头193获取多个曝光系数的图像,进而,在视频后处理中,电子设备100可以根据多个曝光系数的图像,通过高动态范围(HighDynamic Range, HDR)技术合成HDR图像。In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1. For example, in some embodiments, the electronic device 100 can use N cameras 193 to acquire images with multiple exposure coefficients. Furthermore, in video post-processing, the electronic device 100 can use high dynamic range ( HighDynamic Range (HDR) technology synthesizes HDR images.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(Moving Picture Experts Group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
NPU为神经网络(Neural-Network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can continuously learn by itself. Intelligent cognitive applications of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, etc.
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
在一种可能的设计中,如图5所示,电子设备100可以包括应用程序和通用密钥库系统(Harmony universal keystore,HUKS)组件/模块。其中,应用程序例如可以包括荣耀®商城、运动健康、信任环等。其中,荣耀®商城、运动健康等应用程序可以登录荣耀®账号,通过信任环应用加入信任环(体系)。信任环体系是一种公开密钥体系(public keyinfrastructure,PKI)。信任环体系的说明可以参见上文的相关说明,在此不做赘述。In a possible design, as shown in FIG. 5 , the electronic device 100 may include an application program and a Harmony universal keystore (HUKS) component/module. Among them, applications may include, for example, Honor® Mall, Sports and Health, Trust Ring, etc. Among them, applications such as Honor® Mall and Sports Health can log in to the Honor® account and join the trust ring (system) through the trust ring application. The trust ring system is a public key infrastructure (PKI). The description of the trust ring system can be found in the relevant description above and will not be described in detail here.
HUKS组件用于向应用程序提供密钥库能力,包括密钥管理及密钥的密码学操作等功能。HUKS环境可以包括密钥管理组件、密钥库组件、功能服务组件和对外接口等组件。The HUKS component is used to provide keystore capabilities to applications, including key management and key cryptographic operations. The HUKS environment can include components such as key management components, key library components, functional service components, and external interfaces.
其中,密钥管理组件可以采用多级密钥管理方法(例如,根密钥、主密钥、密钥加密密钥、工作密钥)进行密钥管理。其中,根密钥是很少变化的密钥,根密钥可以保证主密钥的安全,主密钥可以派生出密钥加密密钥来保证密钥库中其他工作密钥的安全。本申请实施例中,应用程序调用HUKS接口生成的公钥和私钥属于工作密钥。Among them, the key management component can use a multi-level key management method (for example, root key, master key, key encryption key, working key) for key management. Among them, the root key is a key that rarely changes. The root key can ensure the security of the master key. The master key can derive the key encryption key to ensure the security of other working keys in the key database. In the embodiment of this application, the public key and private key generated by the application calling the HUKS interface belong to the working key.
密钥库组件用于进行工作密钥存储、工作密钥读取、工作密钥更新等。The key library component is used to store, read, and update working keys.
功能服务组件中定义了HUKS密钥管理提供的功能实现。对外接口可以提供接口函数(例如,HUKS接口)给上层(应用程序,例如,荣耀®商城、运动健康)使用。例如,应用程序(例如,荣耀®商城、运动健康)可以调用HUKS接口生成密钥(例如,公钥和私钥)。The functional service component defines the functional implementation provided by HUKS key management. The external interface can provide interface functions (for example, HUKS interface) for use by the upper layer (applications, such as Honor® Mall, Sports and Health). For example, applications (for example, Honor® Mall, Sports and Health) can call the HUKS interface to generate keys (for example, public keys and private keys).
本申请实施例中的云服务器(例如,安全云服务器或账号云服务器)可以通过图6中的通信设备来实现。其中,通信设备600包括至少一个处理器(例如,处理器601和处理器605),通信线路602,存储器603以及至少一个通信接口604。The cloud server (for example, a security cloud server or an account cloud server) in the embodiment of the present application can be implemented by the communication device in Figure 6. The communication device 600 includes at least one processor (for example, processor 601 and processor 605), a communication line 602, a memory 603 and at least one communication interface 604.
处理器601可以是一个CPU,微处理器,ASIC,或一个或多个用于控制本申请方案程序执行的集成电路。The processor 601 may be a CPU, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the program of the present application.
通信线路602可包括一通路,在上述组件之间传送信息。Communication line 602 may include a path that carries information between the above-mentioned components.
通信接口604,使用任何收发器一类的装置,用于与其他设备或通信网络通信,如以太网,RAN,WLAN等。The communication interface 604 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, RAN, WLAN, etc.
存储器603可以是ROM或可存储静态信息和指令的其他类型的静态存储设备,RAM或者可存储信息和指令的其他类型的动态存储设备,也可以是EEPROM、CD-ROM或其他光盘存储、光碟存储、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过通信线路602与处理器相连接。存储器也可以和处理器集成在一起。The memory 603 can be ROM or other types of static storage devices that can store static information and instructions, RAM or other types of dynamic storage devices that can store information and instructions, or it can be EEPROM, CD-ROM or other optical disk storage, optical disk storage , disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor through a communication line 602 . Memory can also be integrated with the processor.
其中,存储器603用于存储执行本申请方案的计算机执行指令,并由处理器601来控制执行。处理器601用于执行存储器603中存储的计算机执行指令,从而实现本申请下述实施例提供的方法。The memory 603 is used to store computer-executable instructions for executing the solution of the present application, and the execution is controlled by the processor 601. The processor 601 is used to execute the computer-executable instructions stored in the memory 603, thereby implementing the method provided in the following embodiments of the present application.
可选的,本申请实施例中的计算机执行指令也可以称之为应用程序代码,本申请实施例对此不作具体限定。Optionally, the computer-executed instructions in the embodiments of the present application may also be called application codes, which are not specifically limited in the embodiments of the present application.
在具体实现中,作为一种实施例,处理器601可以包括一个或多个CPU,例如图6中的CPU0和CPU1。In specific implementation, as an embodiment, the processor 601 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 6 .
在具体实现中,作为一种实施例,通信设备600可以包括多个处理器,例如图6中的处理器601和处理器605。这些处理器中的每一个可以是一个单核处理器,也可以是一个多核处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In specific implementation, as an embodiment, the communication device 600 may include multiple processors, such as the processor 601 and the processor 605 in FIG. 6 . Each of these processors can be a single-core processor or a multi-core processor. A processor here may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
本申请实施例并未对本申请实施例提供的方法的执行主体的具体结构特别限定,只要能够通过运行记录有本申请实施例的提供的方法的代码的程序,以根据本申请实施例提供的方法进行通信即可。例如,本申请实施例提供的方法的执行主体可以是电子设备或云服务器,或者,是电子设备或云服务器中能够调用程序并执行程序的功能模块。The embodiments of the present application do not particularly limit the specific structure of the execution subject of the method provided in the embodiments of the present application, as long as it can communicate according to the method provided in the embodiments of the present application by running a program that records the code of the method provided in the embodiments of the present application. For example, the execution subject of the method provided in the embodiments of the present application may be an electronic device or a cloud server, or a functional module in the electronic device or cloud server that can call and execute a program.
在一种可能的设计中,如图7所示,云服务器(例如,安全云服务器)可以包括证书认证模块,防重放模块,APP签名指纹获取模块,账号认证模块以及信任环模块。其中,证书认证模块也可以称为云证书服务(cloud certificate service,CCS)模块。In a possible design, as shown in Figure 7, the cloud server (for example, a secure cloud server) can include a certificate authentication module, an anti-replay module, an APP signature fingerprint acquisition module, an account authentication module, and a trust ring module. Among them, the certificate authentication module can also be called a cloud certificate service (cloud certificate service, CCS) module.
其中,CCS证书认证模块用于基于证书链校验设备证书以及中间证书等证书的合法性。Among them, the CCS certificate authentication module is used to verify the legitimacy of certificates such as device certificates and intermediate certificates based on the certificate chain.
防重放模块用于判断安全云服务器接收到的请求在特定时间内(例如,5分钟、10分钟等)触发的次数,以防止重放攻击。The anti-replay module is used to determine the number of times a request received by the secure cloud server is triggered within a specific period of time (for example, 5 minutes, 10 minutes, etc.) to prevent replay attacks.
APP签名指纹获取模块用于对应用签名证书指纹进行认证,以判断应用程序的合法性。The APP signature fingerprint acquisition module is used to authenticate the application signature certificate fingerprint to determine the legitimacy of the application.
账号认证模块用于对设备登录的账号(例如,荣耀®账号)进行认证。The account authentication module is used to authenticate the account used to log in to the device (for example, a Honor® account).
信任环模块用于对设备是否是信任环的可信设备(登录同一账号且通过认证的设备)进行认证。The trust ring module is used to authenticate whether the device is a trusted device in the trust ring (a device that logs in with the same account and has passed the authentication).
本申请实施例描述的网络架构以及业务场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着网络架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。The network architecture and business scenarios described in the embodiments of this application are for the purpose of explaining the technical solutions of the embodiments of this application more clearly, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those of ordinary skill in the art will know that with the network With the evolution of architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请的描述中,除非另有说明,“至少一个”是指一个或多个, “多个”是指两个或多于两个。另外,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Among them, in the description of this application, unless otherwise specified, "at least one" refers to one or more, and "plurality" refers to two or more than two. In addition, in order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as “first” and “second” are used to distinguish identical or similar items with basically the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the number and execution order, and words such as "first" and "second" do not limit the number and execution order.
为了便于理解,以下结合附图对本申请实施例提供的认证方法进行具体介绍。For ease of understanding, the authentication method provided by the embodiment of the present application will be introduced in detail below with reference to the accompanying drawings.
如图8所示,本申请实施例提供一种认证方法,包括账号认证过程、应用程序认证过程和设备认证过程。其中,账号认证过程包括如下步骤801-步骤803。As shown in Figure 8, this embodiment of the present application provides an authentication method, including an account authentication process, an application authentication process, and a device authentication process. Among them, the account authentication process includes the following steps 801 to 803.
801、应用程序向安全云服务器发送用户认证请求。801. The application sends a user authentication request to the secure cloud server.
响应于用户登录应用程序(例如,荣耀®商城)的操作,应用程序可以向安全云服务器发送用户认证请求。用户认证请求用于请求安全云服务器校验用户身份。其中,用户登录应用程序的操作例如可以是用户点击登录按钮进行登录的操作,也可以用户触发自动登录的操作,本申请不做限定。In response to the user's operation to log in to the application (for example, Honor® Mall), the application can send a user authentication request to the secure cloud server. The user authentication request is used to request the secure cloud server to verify the user's identity. The operation for the user to log in to the application may be, for example, the user clicking the login button to log in, or the user triggering the automatic login operation, which is not limited in this application.
其中,用户认证请求可以携带登录令牌(Token)。其中,登录Token是应用程序第一次登录成功时,安全云服务器下发至应用程序的。登录Token可以用于校验用户身份。若用户是第一次登录,用户认证请求中可以携带账号和密码,以便安全云服务器校验用户的账号(例如,荣耀®账号)和密码是否正确。Among them, the user authentication request can carry the login token (Token). Among them, the login token is issued to the application by the security cloud server when the application logs in successfully for the first time. Login Token can be used to verify user identity. If the user logs in for the first time, the user authentication request can carry the account number and password so that the secure cloud server can verify whether the user's account (for example, Honor® account) and password are correct.
其中,应用程序可以是第一应用。安全云服务器可以是第一服务器。Among them, the application program may be the first application. The secure cloud server can be the first server.
802、安全云服务器进行账户认证,认证通过生成随机数。802. The secure cloud server performs account authentication, and generates a random number if the authentication passes.
安全云服务器接收到应用程序发送的用户认证请求后,解析得到登录Token,对登录Token进行校验。若校验通过,可以生成随机数作为Challenge,并向应用程序下发该随机数。After receiving the user authentication request sent by the application, the security cloud server parses the login token and verifies the login token. If the verification passes, a random number can be generated as a Challenge and delivered to the application.
803、安全云服务器向应用程序发送账号认证成功消息和随机数。803. The secure cloud server sends an account authentication success message and a random number to the application.
应用程序从安全云服务器接收账号认证成功消息和随机数,并保存该随机数。The application receives the account authentication success message and a random number from the secure cloud server, and saves the random number.
需要说明的是,步骤801-步骤803是可选的步骤。步骤801-步骤803可以在应用程序认证和设备认证的步骤(步骤804-步骤810)之前执行,也可以在步骤804-步骤810之后执行,也可以不执行,本实施例不作具体限定。It should be noted that steps 801 to 803 are optional steps. Steps 801 to 803 may be executed before the steps of application authentication and device authentication (steps 804 to 810), may be executed after steps 804 to 810, or may not be executed. This embodiment does not make specific limitations.
应用程序认证过程和设备认证过程包括如下步骤804-步骤810。The application authentication process and the device authentication process include the following steps 804 to 810.
804、应用程序调用HUKS接口生成一对公私钥。804. The application calls the HUKS interface to generate a pair of public and private keys.
用户完成应用程序的安装后,第一次打开应用程序时,响应于用户第一次打开应用程序的操作,应用程序可以调用HUKS接口生成一对公私钥。After the user completes the installation of the application, when the user opens the application for the first time, in response to the user's operation of opening the application for the first time, the application can call the HUKS interface to generate a pair of public and private keys.
其中,HUKS接口(即HUKS API)是HUKS组件向上层软件(例如,应用程序)开放的接口。HUKS组件在安全环境下运行,例如,TEE或者具备安全能力的芯片等。HUKS接口可以是荣耀®MagicOS提供的HUKS应用层接口。Among them, the HUKS interface (HUKS API) is the interface that HUKS components open to upper-level software (for example, applications). HUKS components run in a secure environment, such as TEE or chips with security capabilities. The HUKS interface can be the HUKS application layer interface provided by Honor® MagicOS.
其中,公钥和私钥分别用于对应用程序的业务数据进行加密和验签。公钥和私钥可以是根据ECC或RSA算法生成的。Among them, the public key and private key are used to encrypt and verify the business data of the application respectively. Public and private keys can be generated according to ECC or RSA algorithms.
805a、应用程序调用HUKS接口生成设备证书。805a. The application calls the HUKS interface to generate a device certificate.
应用程序可以基于步骤804生成的公钥和私钥调用HUKS接口,获取设备证书(第一数字证书的一种示例)。可以通过私钥对设备证书进行签名。其中,设备证书用于对电子设备(例如,手机)的合法性进行认证。The application can call the HUKS interface based on the public key and private key generated in step 804 to obtain the device certificate (an example of the first digital certificate). Device certificates can be signed with a private key. Among them, the device certificate is used to authenticate the legality of electronic devices (for example, mobile phones).
本申请实施例中,设备证书可以包括应用标识(identifier,ID),应用签名证书指纹,电子设备的唯一标识符(例如,UDID)以及公钥(步骤804中生成的公钥)。其中,电子设备的唯一标识符还可以是其他可以唯一标识电子设备的标识,本申请不做限定。In the embodiment of the present application, the device certificate may include an application identifier (ID), an application signature certificate fingerprint, a unique identifier of the electronic device (e.g., UDID), and a public key (the public key generated in step 804). The unique identifier of the electronic device may also be other identifiers that can uniquely identify the electronic device, which is not limited in the present application.
其中,应用签名证书指纹用于对应用程序的合法性进行校验。应用签名证书指纹用于确保应用程序与服务器(例如,安全云服务器)之间的通信是安全且受信任的,避免中间人攻击和恶意劫持的风险。应用签名证书指纹可以是根据应用程序的APK包的签名文件得到的。APK包的签名文件例如可以包括CERT.RSA和CERT.SF。CERT.RSA 和CERT.SF可以存储在META-INF目录下。其中,CERT.RSA中可以包含应用签名证书的公钥信息和发布机构信息。示例性的,应用签名证书指纹可以是一个哈希值,用于验证应用程序的合法性。Among them, the application signing certificate fingerprint is used to verify the legitimacy of the application. The application signing certificate fingerprint is used to ensure that the communication between the application and the server (for example, a secure cloud server) is secure and trusted, avoiding the risk of man-in-the-middle attacks and malicious hijacking. The application signing certificate fingerprint can be obtained based on the signature file of the APK package of the application. The signature file of the APK package may include CERT.RSA and CERT.SF, for example. CERT.RSA and CERT.SF can be stored in the META-INF directory. Among them, CERT.RSA may contain the public key information and issuing agency information of the application signing certificate. Exemplarily, the application signing certificate fingerprint may be a hash value used to verify the legitimacy of the application.
本申请实施例中,步骤804中生成的私钥和步骤805a中生成的设备证书可以保存在TEE中,避免私钥和设备证书被盗用或篡改。In an embodiment of the present application, the private key generated in step 804 and the device certificate generated in step 805a can be stored in the TEE to prevent the private key and the device certificate from being stolen or tampered with.
可选的,应用程序还可以将随机数填入设备证书,即设备证书还可以包括随机数。Optionally, the application may also fill a random number into the device certificate, that is, the device certificate may also include a random number.
805b、应用程序上传设备证书到安全云服务器。805b. The application uploads the device certificate to the secure cloud server.
即应用程序将设备证书发送至安全云服务器。That is, the application sends the device certificate to the secure cloud server.
806、安全云服务器校验设备证书的合法性。806. The secure cloud server verifies the legality of the device certificate.
安全云服务器接收到设备证书后,可以解析设备证书,提取应用ID,应用签名证书指纹,UDID,公钥等信息。可选的,安全云服务器还可以解析得到随机数等信息。After receiving the device certificate, the secure cloud server can parse the device certificate to extract information such as application ID, application signature certificate fingerprint, UDID, public key, etc. Optionally, the secure cloud server can also parse to obtain information such as random numbers.
安全云服务器可以基于证书链校验设备证书的合法性。其中,证书链可以包括设备证书、一个或多个中间证书(例如,intermediate_cert_1, ..., intermediate_cert_n),以及根证书(例如,honor_root_cert)。其中,根证书可以是自签名证书,可以存储在安全云服务器中。The secure cloud server can verify the legitimacy of the device certificate based on the certificate chain. Among them, the certificate chain can include the device certificate, one or more intermediate certificates (for example, intermediate_cert_1, ..., intermediate_cert_n), and the root certificate (for example, honor_root_cert). Among them, the root certificate can be a self-signed certificate and can be stored in a secure cloud server.
对于设备证书和所有中间证书中的每个证书,安全云服务器可以验证该证书的有效期是否在合法日期内,并验证该证书的签名是否由其颁发机构签发,即是否使用颁发机构的公钥签名。如果对设备证书和所有中间证书验证都成功,即证书链验证通过,确定设备证书合法。在设备证书合法的情况下,认为电子设备合法,即设备认证通过。For each certificate in the device certificate and all intermediate certificates, the secure cloud server can verify whether the validity period of the certificate is within the legal date, and verify whether the signature of the certificate is issued by its issuing authority, that is, whether it is signed with the issuing authority's public key. If the verification of the device certificate and all intermediate certificates is successful, that is, the certificate chain verification passes, the device certificate is determined to be legal. If the device certificate is legal, the electronic device is considered legal, that is, the device authentication passes.
在设备证书合法的情况下,安全云服务器可以继续执行步骤807-810。若设备证书不合法,安全云服务器可以不做进一步的处理(即不再执行步骤808-810)。If the device certificate is valid, the secure cloud server can continue to perform steps 807-810. If the device certificate is illegal, the secure cloud server may not perform further processing (that is, steps 808-810 will not be performed).
807、安全云服务器判断随机数在特定时间内触发的次数,以防止重放攻击。807. The secure cloud server determines the number of times the random number is triggered within a specific period of time to prevent replay attacks.
可选的,安全云服务器还可以判断随机数在特定时间内(例如,5分钟、10分钟等)触发的次数,以防止重放攻击。若随机数在特定时间内只触发了一次,确定未发生重放攻击,可以正常执行下述步骤(步骤808、步骤809等)。若随机数在特定时间内触发多次,可能发生重放攻击,安全云服务器可以不做进一步的处理(即不再执行步骤808、步骤809等)。Optionally, the secure cloud server can also determine the number of times the random number is triggered within a specific period of time (for example, 5 minutes, 10 minutes, etc.) to prevent replay attacks. If the random number is triggered only once within a specific period of time, it is determined that a replay attack has not occurred, and the following steps (step 808, step 809, etc.) can be performed normally. If the random number is triggered multiple times within a specific period of time, a replay attack may occur, and the secure cloud server does not need to perform further processing (that is, steps 808, 809, etc. will no longer be performed).
808、安全云服务器校验应用程序的合法性。808. The secure cloud server verifies the legality of the application.
安全云服务器可以根据解析得到的应用ID和应用签名证书指纹校验应用程序的合法性。The secure cloud server can verify the legitimacy of the application based on the parsed application ID and application signature certificate fingerprint.
在一种可能的设计中,安全云服务器可以将解析得到的应用ID和应用签名证书指纹与白名单做对比(匹配)。其中,白名单可以预置在安全云服务器上。白名单中可以记录多个合法应用的应用ID和应用签名证书指纹。若解析得到的应用ID和应用签名证书指纹存在于白名单内部,确定应用程序是合法应用(可信应用)。In one possible design, the secure cloud server can compare (match) the parsed application ID and application signature certificate fingerprint with the whitelist. Among them, the whitelist can be preset on the secure cloud server. The whitelist can record the application IDs and application signature certificate fingerprints of multiple legitimate applications. If the parsed application ID and application signature certificate fingerprint are present in the whitelist, the application is determined to be a legitimate application (trusted application).
809、安全云服务器生成设备令牌(device Token)。809. The secure cloud server generates a device token.
需要说明的是,在设备证书中携带的UDID(例如,第一UDID)是首次注册的情况下,即安全云服务器首次接收到包含第一UDID的设备证书的情况下,安全云服务器可以基于UDID(例如,第一UDID)生成device Token,并建立device Token与公钥(步骤804生成的公钥)的对应关系。后续应用程序请求的数据可以使用公钥(步骤804生成的公钥)对应的私钥(步骤804生成的私钥)进行签名,并可以将签名后的数据和device Token发送给安全云服务器。安全云服务器可以校验device Token,以确保电子设备和应用程序的合法性。安全云服务器可以基于device Token对应的公钥对应用程序请求的数据进行验签,以确保报文的完整性。It should be noted that when the UDID (for example, the first UDID) carried in the device certificate is registered for the first time, that is, when the security cloud server receives the device certificate containing the first UDID for the first time, the security cloud server can be based on the UDID. (for example, the first UDID) generates a device Token, and establishes a corresponding relationship between the device Token and the public key (the public key generated in step 804). Subsequent data requested by the application can be signed using the private key (the private key generated in step 804) corresponding to the public key (the public key generated in step 804), and the signed data and device Token can be sent to the secure cloud server. The secure cloud server can verify the device Token to ensure the legitimacy of electronic devices and applications. The secure cloud server can verify the data requested by the application based on the public key corresponding to the device Token to ensure the integrity of the message.
其中,device Token是第一令牌的一种示例。Among them, device Token is an example of the first token.
810、安全云服务器向应用程序下发device Token。810. The secure cloud server issues device Token to the application.
本申请实施例中,device Token可以用于校验电子设备和应用程序是否合法。校验通过,表示电子设备和应用程序是合法的。In the embodiment of this application, the device Token can be used to verify whether the electronic device and application program are legal. If the verification passes, it means that the electronic device and application are legal.
本申请实施例中,应用程序可以将device Token保存在TEE中,避免device Token被盗用或篡改。In the embodiment of this application, the application can save the device Token in the TEE to prevent the device Token from being stolen or tampered with.
至此,应用程序认证和设备认证完成,安全云服务器可以与应用程序进行业务数据的交互。即本申请提供的方法还可以包括以下步骤:At this point, application authentication and device authentication are completed, and the secure cloud server can interact with the application for business data. That is, the method provided in this application may also include the following steps:
811、应用程序向安全云服务器发送业务数据请求。811. The application sends a business data request to the secure cloud server.
其中,业务数据请求可以包括device Token和根据私钥签名的业务数据。应用程序可以基于步骤804生成的私钥对预设的高敏感接口的业务数据进行签名。The service data request may include the device Token and the service data signed by the private key. The application may sign the service data of the preset highly sensitive interface based on the private key generated in step 804.
其中,高敏感接口可以是应用程序的开发商预先设置的。高敏感接口涉及高敏感数据(例如,支付信息,生物特征信息等)的处理。高敏感数据在端侧(电子设备侧)需要进行加密和签名处理,在云侧(安全云服务器侧)需要进行验签,以保证高敏感数据的安全性。Among them, the highly sensitive interface can be pre-set by the developer of the application. The highly sensitive interface involves the processing of highly sensitive data (for example, payment information, biometric information, etc.). Highly sensitive data needs to be encrypted and signed on the end side (electronic device side), and the signature needs to be verified on the cloud side (security cloud server side) to ensure the security of highly sensitive data.
812、安全云服务器基于device Token查询对应公钥进行验签。812. The secure cloud server queries the corresponding public key based on the device Token for signature verification.
安全云服务器接收到业务数据请求后,解析得到device Token,基于自身建立的device Token与公钥的对应关系,查询device Token对应的公钥。若查询到device Token对应的公钥,根据查询到的公钥对私钥签名的业务数据进行验签。After receiving the business data request, the secure cloud server parses the device Token and queries the public key corresponding to the device Token based on the correspondence between the device Token and the public key established by itself. If the public key corresponding to the device Token is queried, the business data signed by the private key is verified based on the queried public key.
813、若验签通过,向应用程序发送业务数据响应。813. If the signature verification is successful, a business data response is sent to the application.
若安全云服务器对签名的业务数据验签通过,确定电子设备和应用程序是合法的,即确定是合法设备的合法应用程序发起的业务数据请求,可以向应用程序发送业务数据响应,允许电子设备的应用程序调用高敏感接口对高敏感数据进行处理。If the secure cloud server verifies the signed business data and determines that the electronic device and application are legitimate, that is, it determines that the business data request is initiated by a legitimate application of a legitimate device, it can send a business data response to the application, allowing the application of the electronic device to call the highly sensitive interface to process the highly sensitive data.
814、若验签未通过,向应用程序发送接口报错。814. If the signature verification fails, an interface error will be sent to the application.
若安全云服务器对签名的业务数据验签未通过,无法确定发起业务数据请求的电子设备和应用程序是否合法,可以向应用程序发送接口报错,不允许电子设备的应用程序调用高敏感接口对高敏感数据进行处理。If the secure cloud server fails to verify the signed business data and cannot determine whether the electronic device and application that initiated the business data request are legal, it can send an interface error to the application and do not allow the application of the electronic device to call highly sensitive interfaces. Sensitive data is processed.
示例性的,以应用程序为荣耀®商城为例,如图9中的(a)所示,用户在手机A打开荣耀®商城后,可以进入购物车界面901,响应于用户在购物车界面901点击结算按钮902的操作,手机可以向安全云服务器发送结算请求,结算请求中可以携带device Token和根据私钥签名的业务数据(例如,结算商品信息、结算金额等),安全云服务器可以基于deviceToken查询该device Toke对应公钥进行验签。若验签通过,允许电子设备的应用程序进行结算处理。例如,如图9中的(b)所示,手机可以显示支付订单界面903。支付订单界面903可以包括多种支付方式和确认支付按钮904。用户可以选择相应的支付方式并点击确认支付按钮904以进行支付。若验签未通过,向应用程序发送接口报错,不允许电子设备的应用程序进行结算处理。例如,如图9中的(c)所示,手机可以显示弹框905,弹框905用于提示用户结算失败。可选的,手机还可以向用户提示结算失败的原因,例如,电子设备和当前应用程序未通过认证。For example, taking the application as the Honor® Mall, as shown in (a) in Figure 9, after the user opens the Honor® Mall on mobile phone A, he can enter the shopping cart interface 901. In response to the user entering the shopping cart interface 901 By clicking the settlement button 902, the mobile phone can send a settlement request to the secure cloud server. The settlement request can carry the device Token and business data signed according to the private key (for example, settlement product information, settlement amount, etc.). The secure cloud server can be based on the deviceToken. Query the public key corresponding to the device Toke for signature verification. If the signature verification is passed, the electronic device application is allowed to perform settlement processing. For example, as shown in (b) of FIG. 9 , the mobile phone may display the payment order interface 903 . The payment order interface 903 may include multiple payment methods and a payment confirmation button 904. The user can select the corresponding payment method and click the confirm payment button 904 to make the payment. If the signature verification fails, an interface error will be sent to the application, and the electronic device application will not be allowed to perform settlement processing. For example, as shown in (c) of Figure 9, the mobile phone can display a pop-up box 905, which is used to prompt the user that the settlement has failed. Optionally, the mobile phone can also prompt the user for the reason for settlement failure, for example, the electronic device and the current application have not passed authentication.
基于本申请实施例提供的方法,电子设备的应用程序(第一应用)可以从TEE获取设备证书(第一数字证书),并向安全云服务器(第一服务器)发送该证书。安全云服务器可以对设备证书进行认证,并且对应用程序的标识和应用签名证书指纹进行认证。在该设备证书认证通过,且该证书中包含的应用签名证书指纹认证通过的情况下,应用程序可以与安全云服务器进行安全通信。由于设备证书是从TEE直接获取的,可以避免端侧(电子设备侧)的恶意程序对设备证书中的应用程序的标识、应用签名证书指纹进行篡改的问题。并且,通过设备证书携带应用程序的标识、应用签名证书指纹到安全云服务器,使得安全云服务器既对设备证书进行认证,也可以对应用程序的标识和应用签名证书指纹进行认证,都认证通过后,应用程序可以与安全云服务器进行通信,确保了应用程序与安全云服务器之间的通信安全。Based on the method provided by the embodiment of this application, the application program (first application) of the electronic device can obtain the device certificate (first digital certificate) from the TEE and send the certificate to the secure cloud server (first server). The secure cloud server can certify the device certificate and certify the application's identity and application signing certificate fingerprint. If the device certificate passes the authentication and the application signature certificate fingerprint contained in the certificate passes the authentication, the application can communicate securely with the secure cloud server. Since the device certificate is obtained directly from the TEE, it can avoid the problem of malicious programs on the terminal side (electronic device side) tampering with the application identification and application signature certificate fingerprint in the device certificate. Moreover, the device certificate carries the application's identity and application signature certificate fingerprint to the secure cloud server, allowing the security cloud server to authenticate not only the device certificate, but also the application's identity and application signature certificate fingerprint. After both are authenticated, , the application can communicate with the secure cloud server, ensuring the security of communication between the application and the secure cloud server.
如图10所示,本申请实施例提供一种认证方法,包括应用程序认证过程。As shown in FIG. 10 , an embodiment of the present application provides an authentication method, including an application authentication process.
1001、应用程序调用HUKS接口生成一对公私钥。1001. The application calls the HUKS interface to generate a pair of public and private keys.
具体过程可以参考步骤804,在此不做赘述。For the specific process, please refer to step 804, which will not be described again here.
1002、应用程序调用HUKS接口生成数字证书A。1002. The application calls the HUKS interface to generate digital certificate A.
其中,数字证书A(第一数字证书的一种示例)可以包括应用ID,应用签名证书指纹以及公钥等信息。Among them, digital certificate A (an example of the first digital certificate) may include information such as application ID, application signature certificate fingerprint, and public key.
可选的,本申请实施例还可以包括账号认证过程。在账号认证过程,电子设备的应用程序可以从云服务器接收随机数。应用程序还可以将随机数填入数字证书A,即数字证书A还可以包括随机数。Optionally, the embodiment of this application may also include an account authentication process. During the account authentication process, the electronic device application can receive random numbers from the cloud server. The application can also fill in random numbers into digital certificate A, that is, digital certificate A can also include random numbers.
1003、应用程序上传数字证书A到安全云服务器。1003. The application uploads digital certificate A to the secure cloud server.
即应用程序将数字证书A发送至安全云服务器。That is, the application sends digital certificate A to the secure cloud server.
1004、安全云服务器校验数字证书A的合法性。1004. The secure cloud server verifies the legality of digital certificate A.
安全云服务器接收到数字证书A后,可以解析数字证书A,提取应用ID,应用签名证书指纹,公钥等信息。可选的,安全云服务器还可以解析得到随机数等信息。After receiving the digital certificate A, the secure cloud server can parse the digital certificate A to extract the application ID, the fingerprint of the application signature certificate, the public key and other information. Optionally, the secure cloud server can also parse to obtain information such as random numbers.
安全云服务器可以基于证书链校验设备证书的合法性。具体过程可以参考步骤806,在此不做赘述。The secure cloud server can verify the legitimacy of the device certificate based on the certificate chain. For the specific process, please refer to step 806, which will not be described again here.
在数字证书A合法的情况下,安全云服务器可以继续执行步骤1005。若数字证书A不合法,安全云服务器可以不做进一步的处理。If digital certificate A is valid, the secure cloud server can continue to perform step 1005. If digital certificate A is illegal, the secure cloud server may not perform further processing.
另外,安全云服务器还可以判断随机数在特定时间内触发的次数,以防止重放攻击。相关说明可以参考步骤807,在此不做赘述。In addition, the secure cloud server can also determine the number of times the random number is triggered within a specific period of time to prevent replay attacks. For relevant instructions, please refer to step 807, which will not be described again here.
1005、安全云服务器校验应用程序的合法性。1005. The secure cloud server verifies the legitimacy of the application.
安全云服务器可以根据解析得到的应用ID和应用签名证书指纹校验应用程序的合法性。相关说明可以参考步骤808,在此不做赘述。The secure cloud server can verify the legitimacy of the application program based on the parsed application ID and application signature certificate fingerprint. For related instructions, please refer to step 808, which will not be repeated here.
应用程序认证通过的情况下,安全云服务器可以保存数字证书A中携带的公钥。可选的,应用程序可以建立应用ID与公钥(数字证书A中携带的公钥)的对应关系。If the application authentication passes, the secure cloud server can save the public key carried in digital certificate A. Optionally, the application can establish a correspondence between the application ID and the public key (the public key carried in digital certificate A).
至此,应用程序认证完成,安全云服务器可以与应用程序进行业务数据的交互。即本申请提供的方法还可以包括以下步骤:At this point, the application authentication is completed, and the secure cloud server can interact with the application for business data. That is, the method provided in this application may also include the following steps:
1006、应用程序向安全云服务器发送业务数据请求。1006. The application sends a business data request to the secure cloud server.
其中,业务数据请求可以包括根据私钥签名的业务数据。可选的,业务数据请求还可以包括应用ID。应用程序可以基于步骤1001生成的私钥对预设的高敏感接口的业务数据进行签名。高敏感接口的相关说明可以参考步骤811,在此不做赘述。The service data request may include service data signed according to the private key. Optionally, the business data request may also include the application ID. The application can sign the business data of the preset highly sensitive interface based on the private key generated in step 1001. For relevant instructions on highly sensitive interfaces, please refer to step 811 and will not be described in detail here.
1007、安全云服务器对私钥签名的业务数据进行验签。1007. The secure cloud server verifies the business data signed by the private key.
安全云服务器接收到业务数据请求后,解析得到应用ID,基于自身建立的应用ID与公钥的对应关系,查询应用ID对应的公钥。若查询到应用ID对应的公钥,根据查询到的公钥对私钥签名的业务数据进行验签。After receiving the business data request, the secure cloud server parses the application ID and queries the public key corresponding to the application ID based on the corresponding relationship between the application ID and the public key established by itself. If the public key corresponding to the application ID is queried, the business data signed by the private key is verified based on the queried public key.
1008、若验签通过,向应用程序发送业务数据响应。1008. If the signature verification passes, send a business data response to the application.
相关说明可以参考步骤813,在此不做赘述。For relevant instructions, please refer to step 813, which will not be described again here.
1009、若验签未通过,向应用程序发送接口报错。1009. If the signature verification fails, an interface error is sent to the application.
相关说明可以参考步骤814,在此不做赘述。For relevant instructions, please refer to step 814, which will not be described again here.
基于本申请实施例提供的方法,电子设备的应用程序(第一应用)可以从TEE获取数字证书A(第一数字证书),并向安全云服务器(第一服务器)发送该证书。安全云服务器可以对数字证书A进行认证,并且对应用程序的标识和应用签名证书指纹进行认证。在该数字证书A认证通过,且该证书中包含的应用签名证书指纹认证通过的情况下,应用程序可以与安全云服务器进行安全通信。由于数字证书A是从TEE直接获取的,可以避免端侧(电子设备侧)的恶意程序对数字证书A中的应用程序的标识、应用签名证书指纹进行篡改的问题。并且,通过数字证书A携带应用程序的标识、应用签名证书指纹到安全云服务器,使得安全云服务器既对数字证书A进行认证,也可以对应用程序的标识和应用签名证书指纹进行认证,都认证通过后,应用程序可以与安全云服务器进行通信,确保了应用程序与安全云服务器之间的通信安全。Based on the method provided by the embodiment of this application, the application program (first application) of the electronic device can obtain digital certificate A (first digital certificate) from the TEE and send the certificate to the secure cloud server (first server). The secure cloud server can certify digital certificate A, and certify the application's identity and application signature certificate fingerprint. When the digital certificate A passes the authentication and the application signature certificate fingerprint contained in the certificate passes the authentication, the application can communicate securely with the secure cloud server. Since digital certificate A is obtained directly from the TEE, it can avoid the problem of malicious programs on the terminal side (electronic device side) tampering with the application identification and application signature certificate fingerprint in digital certificate A. Furthermore, digital certificate A carries the application's identity and application signature certificate fingerprint to the secure cloud server, so that the security cloud server not only authenticates digital certificate A, but also authenticates the application's identity and application signature certificate fingerprint, both of which are authenticated. After passing, the application can communicate with the secure cloud server, ensuring the security of communication between the application and the secure cloud server.
如图11所示,本申请实施例提供一种认证方法,包括设备认证过程。As shown in Figure 11, this embodiment of the present application provides an authentication method, including a device authentication process.
1101、应用程序调用HUKS接口生成一对公私钥。1101. The application calls the HUKS interface to generate a pair of public and private keys.
1102、应用程序调用HUKS接口生成数字证书B。1102. The application calls the HUKS interface to generate digital certificate B.
其中,数字证书B(第一数字证书的一种示例)可以包括UDID,公钥等信息。Among them, digital certificate B (an example of the first digital certificate) may include UDID, public key and other information.
1103、应用程序上传数字证书B到安全云服务器。1103. The application uploads digital certificate B to the secure cloud server.
即应用程序将数字证书B发送至安全云服务器。That is, the application sends digital certificate B to the secure cloud server.
可选的,本申请实施例还可以包括账号认证过程,在账号认证过程可以从云服务器接收到随机数,应用程序还可以将随机数填入数字证书B,即数字证书B还可以包括随机数。Optionally, this application embodiment can also include an account authentication process. During the account authentication process, random numbers can be received from the cloud server, and the application can also fill in the random numbers into digital certificate B, that is, digital certificate B can also include random numbers. .
1104、安全云服务器校验数字证书B的合法性。1104. The secure cloud server verifies the legality of digital certificate B.
安全云服务器接收到数字证书B后,可以解析数字证书B,提取UDID,公钥等信息。After receiving digital certificate B, the secure cloud server can parse digital certificate B and extract information such as UDID and public key.
安全云服务器可以基于证书链校验数字证书B的合法性。具体过程可以参考步骤806,在此不做赘述。The secure cloud server can verify the legitimacy of digital certificate B based on the certificate chain. For the specific process, please refer to step 806, which will not be described again here.
在数字证书B合法的情况下,安全云服务器可以继续执行步骤1105。If digital certificate B is valid, the secure cloud server can continue to perform step 1105.
1105、安全云服务器生成设备令牌(device Token)。1105. The secure cloud server generates a device token.
需要说明的是,在数字证书B中携带的UDID(例如,第一UDID)是首次注册的情况下,即安全云服务器首次接收到包含第一UDID的数字证书(例如,数字证书B)的情况下,安全云服务器可以基于UDID(例如,第一UDID)生成device Token,并建立device Token与公钥(步骤1101生成的公钥)的对应关系。后续应用程序请求的数据可以使用公钥(步骤1101生成的公钥)对应的私钥(步骤1101生成的私钥)进行签名,并可以将签名后的数据和device Token发送给安全云服务器。安全云服务器可以校验device Token,以确保电子设备和应用程序的合法性。安全云服务器可以基于device Token对应的公钥对应用程序请求的数据进行验签,以确保报文的完整性。It should be noted that when the UDID (for example, the first UDID) carried in digital certificate B is registered for the first time, that is, the secure cloud server receives the digital certificate (for example, digital certificate B) containing the first UDID for the first time. Next, the security cloud server can generate a device Token based on the UDID (for example, the first UDID), and establish a corresponding relationship between the device Token and the public key (the public key generated in step 1101). Subsequent data requested by the application can be signed using the private key (private key generated in step 1101) corresponding to the public key (public key generated in step 1101), and the signed data and device Token can be sent to the secure cloud server. The secure cloud server can verify the device Token to ensure the legitimacy of electronic devices and applications. The secure cloud server can verify the data requested by the application based on the public key corresponding to the device Token to ensure the integrity of the message.
1106、安全云服务器向应用程序下发device Token。1106. The secure cloud server issues device Token to the application.
本申请实施例中,device Token可以用于校验电子设备是否合法。In the embodiment of this application, the device Token can be used to verify whether the electronic device is legal.
本申请实施例中,应用程序可以将device Token保存在TEE中,避免device Token被盗用或篡改。In the embodiment of this application, the application can save the device Token in the TEE to prevent the device Token from being stolen or tampered with.
至此,设备认证完成,安全云服务器可以与应用程序进行业务数据的交互。即本申请提供的方法还可以包括以下步骤:At this point, the device authentication is completed, and the secure cloud server can interact with the application for business data. That is, the method provided in this application may also include the following steps:
1107、应用程序向安全云服务器发送业务数据请求。1107. The application sends a business data request to the secure cloud server.
其中,业务数据请求可以包括device Token以及根据私钥签名的业务数据。应用程序可以基于步骤1101生成的私钥对预设的高敏感接口的业务数据进行签名。高敏感接口的相关说明可以参考步骤811,在此不做赘述。Among them, the business data request may include device Token and business data signed according to the private key. The application can sign the business data of the preset highly sensitive interface based on the private key generated in step 1101. For relevant instructions on highly sensitive interfaces, please refer to step 811 and will not be described in detail here.
1108、安全云服务器对私钥签名的业务数据进行验签。1108. The secure cloud server verifies the business data signed by the private key.
相关说明可以参考步骤812,在此不做赘述。For relevant instructions, please refer to step 812, which will not be described again here.
1109、若验签通过,向应用程序发送业务数据响应。1109. If the signature verification passes, send a business data response to the application.
相关说明可以参考步骤813,在此不做赘述。For related instructions, please refer to step 813, which will not be repeated here.
1110、若验签未通过,向应用程序发送接口报错。1110. If the signature verification fails, an interface error will be sent to the application.
相关说明可以参考步骤814,在此不做赘述。For relevant instructions, please refer to step 814, which will not be described again here.
基于本申请实施例提供的方法,电子设备的应用程序(第一应用)可以从TEE获取数字证书B(第一数字证书),并向安全云服务器(第一服务器)发送该证书。安全云服务器可以对数字证书B进行认证。由于数字证书B是从TEE直接获取的,可以保证数字证书B的合法性。若该数字证书B认证通过,应用程序可以与安全云服务器进行安全通信。Based on the method provided by the embodiment of this application, the application program (first application) of the electronic device can obtain digital certificate B (first digital certificate) from the TEE and send the certificate to the secure cloud server (first server). The secure cloud server can authenticate digital certificate B. Since digital certificate B is obtained directly from TEE, the legitimacy of digital certificate B can be guaranteed. If the digital certificate B is authenticated, the application can communicate securely with the secure cloud server.
在一些实施例中,安全云服务器还可以对电子设备是否为信任环的可信设备进行认证。其中,信任环的可信设备是指登录同一帐号(例如,荣耀®帐号),且通过安全云服务器认证的多个电子设备中的任一个电子设备。在电子设备是信任环的可信设备的情况下,安全云服务器可以向应用程序发送业务数据响应,允许电子设备的应用程序调用高敏感接口对高敏感数据进行处理。否则,安全云服务器可以向应用程序发送接口报错,不允许电子设备的应用程序调用高敏感接口对高敏感数据进行处理。In some embodiments, the security cloud server can also authenticate whether the electronic device is a trusted device of the trust ring. Among them, the trusted device of the trust ring refers to any electronic device among multiple electronic devices that are logged in to the same account (for example, Honor® account) and authenticated by the secure cloud server. In the case where the electronic device is a trusted device of the trust ring, the secure cloud server can send a business data response to the application, allowing the application of the electronic device to call a highly sensitive interface to process the highly sensitive data. Otherwise, the secure cloud server can send an interface error to the application program, and the application program of the electronic device is not allowed to call the highly sensitive interface to process the highly sensitive data.
在一种可能的设计中,安全云服务器完成应用程序认证、账号认证、设备认证中的至少一种认证之后或之前,安全云服务器还可以对电子设备是否是信任环的可信设备进行认证,如图12所示,该过程包括如下步骤:In a possible design, after or before the secure cloud server completes at least one of application authentication, account authentication, and device authentication, the secure cloud server may also authenticate whether the electronic device is a trusted device in the trust ring, as shown in FIG12 . The process includes the following steps:
1201a、应用程序向安全云服务器发送帐号登录态和设备信息。1201a. The application sends account login status and device information to the secure cloud server.
其中,帐号登录态用于指示是否已登录账号(例如,荣耀®账号),设备信息包括电子设备的唯一标识(例如,UDID)。Among them, the account login status is used to indicate whether the account has been logged in (for example, Honor® account), and the device information includes the unique identifier of the electronic device (for example, UDID).
1201b、安全云服务器向账号云服务器查询电子设备的登录态合法性。1201b. The security cloud server queries the account cloud server for the legality of the login status of the electronic device.
在电子设备已登录账号的情况下,安全云服务器可以向账号云服务器提交电子设备的登录态和设备信息。When the electronic device has logged into the account, the security cloud server can submit the login status and device information of the electronic device to the account cloud server.
1202、账号云服务器向安全云服务器返回电子设备的查询结果。1202. The account cloud server returns the query result of the electronic device to the security cloud server.
账号云服务器可以根据电子设备的登录态和设备信息查询可信设备列表。若电子设备的设备信息(例如,UDID)包含于可信设备列表(即可信设备列表包括电子设备的设备信息),即电子设备登录的账号通过双因子校验(即双因子认证),确定电子设备是信任环的可信设备。若可信设备列表不包括电子设备的设备信息,即电子设备登录的账号未通过双因子校验(即双因子认证),确定电子设备不是信任环的可信设备。其中,双因子校验也可以称为二因子校验,是指基于密码和验证码进行校验。The account cloud server can query the list of trusted devices based on the login status and device information of the electronic device. If the device information (for example, UDID) of the electronic device is included in the trusted device list (i.e., the trusted device list includes the device information of the electronic device), that is, the account logged in by the electronic device passes two-factor verification (i.e., two-factor authentication), it is determined Electronic devices are trusted devices in the trust circle. If the trusted device list does not include the device information of the electronic device, that is, the account logged in by the electronic device does not pass the two-factor verification (i.e., two-factor authentication), it is determined that the electronic device is not a trusted device in the trust ring. Among them, two-factor verification can also be called two-factor verification, which refers to verification based on password and verification code.
1203、安全云服务器根据电子设备的查询结果进行相应处理。1203. The security cloud server performs corresponding processing according to the query results of the electronic device.
若电子设备是双因子校验通过的设备(即电子设备登录的账号(应用程序登录的账号)通过双因子校验),且对电子设备或应用程序进行的应用程序认证、账号认证、设备认证中的至少一种认证通过(例如,应用程序认证、账号认证、设备认证都通过,或者,应用程序认证和设备认证通过,或者,应用程序认证通过),允许高敏感接口操作,即允许电子设备的应用程序调用高敏感接口对高敏感数据进行处理。If the electronic device is a device that passes two-factor verification (that is, the account used to log in to the electronic device (the account used to log in to the application) passes the two-factor verification), and the application authentication, account authentication, and device authentication performed on the electronic device or application At least one of the authentications passed (for example, application authentication, account authentication, device authentication all passed, or application authentication and device authentication passed, or application authentication passed), allowing highly sensitive interface operations, that is, allowing electronic devices Applications call highly sensitive interfaces to process highly sensitive data.
若电子设备是非双因子校验的设备,即电子设备未通过双因子校验,可以进行高敏感接口操作报错,即可以向应用程序发送接口报错,不允许电子设备的应用程序调用高敏感接口对高敏感数据进行处理。这样,可以确保第一应用与第一服务器之间的通信安全。If the electronic device is a non-two-factor verification device, that is, the electronic device does not pass the two-factor verification, it can perform highly sensitive interface operations and report an error, that is, it can send an interface error report to the application program, and the application program of the electronic device is not allowed to call the highly sensitive interface pair. Highly sensitive data is processed. In this way, communication security between the first application and the first server can be ensured.
本申请实施例还提供一种芯片系统,如图13所示,该芯片系统包括至少一个处理器1301和至少一个接口电路1302。处理器1301和接口电路1302可通过线路互联。例如,接口电路1302可用于从其它装置(例如,存储器)接收信号。又例如,接口电路1302可用于向其它装置(例如处理器1301)发送信号。An embodiment of the present application also provides a chip system. As shown in Figure 13, the chip system includes at least one processor 1301 and at least one interface circuit 1302. The processor 1301 and the interface circuit 1302 may be interconnected by wires. For example, interface circuitry 1302 may be used to receive signals from other devices (eg, memory). As another example, interface circuit 1302 may be used to send signals to other devices (eg, processor 1301).
例如,接口电路1302可读取终端设备中存储器中存储的指令,并将该指令发送给处理器1301。当所述指令被处理器1301执行时,可使得电子设备(如图4所示的电子设备100)或云服务器(例如,如图6所示的通信设备600)执行上述实施例中的各个步骤。For example, the interface circuit 1302 can read instructions stored in the memory of the terminal device and send the instructions to the processor 1301. When the instructions are executed by the processor 1301, the electronic device (electronic device 100 as shown in Figure 4) or the cloud server (for example, the communication device 600 as shown in Figure 6) can be caused to perform various steps in the above embodiments. .
当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of this application.
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令,当所述计算机指令在电子设备(如图4所示的电子设备100)或云服务器(例如,如图6所示的通信设备600)上运行时,使得电子设备(如图4所示的电子设备100)或云服务器(例如,如图6所示的通信设备600)执行上述方法实施例中电子设备(例如,手机)或安全云服务器执行的各个功能或者步骤。Embodiments of the present application also provide a computer-readable storage medium that includes computer instructions. When the computer instructions are stored in an electronic device (electronic device 100 as shown in Figure 4) or a cloud server (for example, as When running on the communication device 600 shown in Figure 6), the electronic device (the electronic device 100 shown in Figure 4) or the cloud server (for example, the communication device 600 shown in Figure 6) executes the electronic device in the above method embodiment. Individual functions or steps performed by a device (e.g., mobile phone) or secure cloud server.
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行上述方法实施例中电子设备执行的各个功能或者步骤。The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute each function or step executed by the electronic device in the above method embodiment.
本申请实施例还提供了一种认证装置,所述认证装置可以按照功能划分为不同的逻辑单元或模块,各单元或模块执行不同的功能,以使得所述认证装置执行上述方法实施例中电子设备或云服务器执行的各个功能或者步骤。The embodiment of the present application also provides an authentication device. The authentication device can be divided into different logical units or modules according to functions. Each unit or module performs different functions, so that the authentication device performs the electronic processing in the above method embodiment. Each function or step performed by the device or cloud server.
通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can clearly understand that the above function allocation can be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete the above described All or part of the functionality.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated. The components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. . Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above contents are only specific implementation modes of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be covered by the protection scope of the present application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims (16)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311454820.3A CN117176362B (en) | 2023-11-03 | 2023-11-03 | Authentication method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311454820.3A CN117176362B (en) | 2023-11-03 | 2023-11-03 | Authentication method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117176362A CN117176362A (en) | 2023-12-05 |
CN117176362B true CN117176362B (en) | 2024-04-02 |
Family
ID=88930339
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311454820.3A Active CN117176362B (en) | 2023-11-03 | 2023-11-03 | Authentication method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117176362B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108282467A (en) * | 2017-12-29 | 2018-07-13 | 北京握奇智能科技有限公司 | The application process of digital certificate, system |
CN108769043A (en) * | 2018-06-06 | 2018-11-06 | 中国联合网络通信集团有限公司 | Trusted application Verification System and trusted application authentication method |
WO2021127575A1 (en) * | 2019-12-20 | 2021-06-24 | HYPR Corp. | Secure mobile initiated authentication |
CN114362951A (en) * | 2020-10-13 | 2022-04-15 | 华为终端有限公司 | Method and apparatus for updating certificates |
CN114465726A (en) * | 2022-04-13 | 2022-05-10 | 北京银联金卡科技有限公司 | Digital wallet security framework system based on security unit and trusted execution environment |
CN115348023A (en) * | 2021-05-14 | 2022-11-15 | 华为技术有限公司 | A data security processing method and device |
-
2023
- 2023-11-03 CN CN202311454820.3A patent/CN117176362B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108282467A (en) * | 2017-12-29 | 2018-07-13 | 北京握奇智能科技有限公司 | The application process of digital certificate, system |
CN108769043A (en) * | 2018-06-06 | 2018-11-06 | 中国联合网络通信集团有限公司 | Trusted application Verification System and trusted application authentication method |
WO2021127575A1 (en) * | 2019-12-20 | 2021-06-24 | HYPR Corp. | Secure mobile initiated authentication |
CN114362951A (en) * | 2020-10-13 | 2022-04-15 | 华为终端有限公司 | Method and apparatus for updating certificates |
CN115348023A (en) * | 2021-05-14 | 2022-11-15 | 华为技术有限公司 | A data security processing method and device |
CN114465726A (en) * | 2022-04-13 | 2022-05-10 | 北京银联金卡科技有限公司 | Digital wallet security framework system based on security unit and trusted execution environment |
Also Published As
Publication number | Publication date |
---|---|
CN117176362A (en) | 2023-12-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112765684B (en) | Block chain node terminal management method, device, equipment and storage medium | |
US9467430B2 (en) | Device, method, and system for secure trust anchor provisioning and protection using tamper-resistant hardware | |
US9659160B2 (en) | System and methods for authentication using multiple devices | |
US8112787B2 (en) | System and method for securing a credential via user and server verification | |
US20200265418A1 (en) | Electronic device and method for providing digital signature service of block chain using the same | |
US20160125180A1 (en) | Near Field Communication Authentication Mechanism | |
EP3602388A1 (en) | Blockchain node communication method and apparatus | |
TWI776404B (en) | Method of authenticating biological payment device, apparatus, electronic device, and computer-readable medium | |
CN110278084B (en) | eID establishment method, related equipment and system | |
CN111935166B (en) | Communication authentication method, system, electronic device, server, and storage medium | |
CN113821787B (en) | Security authentication method and electronic equipment | |
CN116547959A (en) | Electronic device for sharing data by using blockchain network and operation method thereof | |
JP2017525236A (en) | Ensuring communication safety with enhanced media platform | |
CN114245375B (en) | Cross-device key distribution method and electronic device | |
CN113645024A (en) | Key distribution method, system, device and readable storage medium and chip | |
CN115706993B (en) | Authentication method, readable medium and electronic device | |
CN117176362B (en) | Authentication method and device | |
CN115146253A (en) | A mobile App login method, mobile device and system | |
CN113626777B (en) | Identity authentication method, storage medium and electronic device | |
WO2025007688A1 (en) | Authentication method, apparatus and device based on pre-shared key | |
US20250097017A1 (en) | Device authorization method, electronic device, and system | |
CN117135631B (en) | Equipment authentication method and terminal equipment | |
Kanini | Secure signaling and traffic exchanges in smart cities: a critical review of the current trends | |
HK40044606A (en) | Method, device, equipment and storage medium for managing block chain node terminal | |
HK40044606B (en) | Method, device, equipment and storage medium for managing block chain node terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |
|
CP03 | Change of name, title or address |