Certificate downloading method and system

The public key, private key and certificate signing request are generated through the terminal, and the certificate is signed and delivered in the background, which solves the problems of cumbersome certificate download process and insufficient security, and realizes simple and efficient certificate download and private key protection.

CN118764207APending Publication Date: 2024-10-11FUJIAN WISBO DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410807150.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

The existing certificate download process is cumbersome, requires a large amount of maintenance code, and the terminal's performance efficiency is low, making it difficult to ensure the security of the certificate and the privacy of the private key.

Method used

The terminal generates a public key, private key and certificate signing request, signs the public key in the background, generates a certificate, and sends the certificate back to the terminal. The private key is stored in the terminal throughout the process and does not participate in the transmission process to avoid leakage of the private key and directly deliver the certificate. , no need to build a separate secure channel.

Benefits of technology

It simplifies the certificate download process, reduces the identity verification process on the terminal and backend, improves the security of certificate download, avoids the risk of private key leakage, and reduces development costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764207A_ABST
    Figure CN118764207A_ABST
Patent Text Reader

Abstract

The invention discloses a certificate downloading method and system, and the method comprises the steps: a terminal generates a public key, a private key and a certificate signature request, and stores the private key; the terminal sends the public key and the certificate signature request to a background; and the background signs the public key according to the certificate signature request to obtain a certificate, and sends the certificate to the terminal. A terminal generates a public key, a private key and a certificate signature request, and a background encrypts the public key to obtain a certificate; the private key is stored in the terminal in the whole process and does not participate in the transmission process, so that the risk of private key leakage is avoided, and the public key is public, so that the certificate is directly transmitted, a secure channel does not need to be independently constructed, and the content of the private key cannot be obtained even if the certificate is obtained; therefore, the identity verification process of the terminal and the background before certificate transmission is reduced, and meanwhile, the security of the certificate downloading process can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data security, and in particular to a certificate downloading method and system. Background Art

[0002] When implementing certain functions in terminal products, certain non-financial certificates will be required. These certificates need to be issued in the background and then downloaded to the terminal for storage. In order to ensure the safe use of terminal products, especially financial terminals, certificates cannot be pre-installed on the terminal directly.

[0003] The existing solution is that the terminal and the background need to generate a symmetric key for transmission. The background generates a key pair and generates a certificate request to the certificate issuing service to issue a certificate. The transmission key is used to encrypt the private key. The encrypted data and the certificate data are sent to the terminal together through a specific secure channel. In this process, the terminal and the background need to establish a secure channel, involving handshakes, identity authentication, key exchange and other processes. At the same time, the terminal also needs to generate a transmission key for the background. The process is cumbersome and requires a lot of code to maintain. After the terminal receives the private key data from the background, it also needs to perform a decryption operation, and this operation is performed in the TEE (Trusted Execution Environment). Considering the performance of some TEEs, the execution efficiency may not be very high. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a certificate downloading method and system to realize a certificate downloading solution with simple process and high efficiency.

[0005] In order to solve the above technical problems, a technical solution adopted by the present invention is:

[0006] A certificate downloading method comprises the steps of:

[0007] The terminal generates a public key, a private key and a certificate signing request, and saves the private key;

[0008] The terminal sends the public key and the certificate signing request to the backend;

[0009] The backend signs the public key according to the certificate signing request to obtain a certificate, and sends the certificate to the terminal.

[0010] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0011] A certificate download system includes a terminal and a background, wherein the terminal includes a first memory, a first processor, and a first computer program stored in the first memory and executable on the first processor; the background includes a second memory, a second processor, and a second computer program stored in the second memory and executable on the second processor; the first processor implements the following steps when executing the first computer program:

[0012] Generate a public key, a private key and a certificate signing request, and save the private key;

[0013] Send the public key and the certificate signing request to the backend;

[0014] When the second processor executes the second computer program, the following steps are implemented:

[0015] The public key is signed according to the certificate signing request to obtain a certificate, and the certificate is sent to the terminal.

[0016] The beneficial effects of the present invention are as follows: the terminal itself generates a public key, a private key and a certificate signing request, and the background encrypts the public key to obtain the certificate; the private key is stored in the terminal throughout the whole process and does not participate in the transmission process, thereby avoiding the risk of private key leakage, and the public key itself can be made public, so the certificate is directly transmitted without the need to build a separate security channel, and even if the certificate is obtained, the content of the private key cannot be obtained, thereby reducing the identity authentication process of the terminal and the background before the certificate is transmitted, and at the same time can ensure the security of the certificate download process. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A flow chart of the steps of a certificate downloading method according to an embodiment of the present invention;

[0018] Figure 2 Another step flow chart of a certificate downloading method according to an embodiment of the present invention;

[0019] Figure 3 A schematic diagram of the structure of a certificate downloading system according to an embodiment of the present invention;

[0020] Description of labels:

[0021] 1. Terminal; 11. First processor; 12. First memory; 2. Background; 21. Second processor; 22. Second memory; 3. A certificate downloading system. DETAILED DESCRIPTION

[0022] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0023] Please refer to Figure 1 , a certificate downloading method, comprising the steps of:

[0024] The terminal generates a public key, a private key and a certificate signing request, and saves the private key;

[0025] The terminal sends the public key and the certificate signing request to the backend;

[0026] The backend signs the public key according to the certificate signing request to obtain a certificate, and sends the certificate to the terminal.

[0027] From the above description, it can be seen that the beneficial effects of the present invention are: the terminal itself generates a public key, a private key and a certificate signing request, and the background encrypts the public key to obtain the certificate; the private key is stored in the terminal throughout the process and does not participate in the transmission process, thereby avoiding the risk of private key leakage, and the public key itself can be made public, so the certificate is directly transmitted without the need to build a separate security channel. Even if the certificate is obtained, the content of the private key cannot be obtained, thereby reducing the identity authentication process of the terminal and the background before the certificate is transmitted, and at the same time can ensure the security of the certificate download process.

[0028] Furthermore, the terminal generates a public key, a private key and a certificate signing request including:

[0029] The terminal receives an instruction for obtaining a certificate signing request, wherein the instruction includes a certificate generation type;

[0030] The terminal determines whether the certificate generation type is the same as a preset type, and if so, generates a public key and a private key according to the certificate generation type.

[0031] From the above description, it can be seen that the public-private key pair is generated by the terminal, and the key generation algorithm supported by the terminal may not match the key type that the background can issue. Therefore, before the terminal generates a public-private key pair, the background first sends an instruction to obtain a certificate signing request, which includes the certificate generation type, that is, the type supported by the background. If the terminal also supports this type, the public-private key pair is generated through the certificate generation type. This avoids the problem of the terminal process being unable to issue the corresponding certificate after the terminal sends the certificate signing request to the background, and can interrupt the unexecutable process as soon as possible.

[0032] Furthermore, the terminal generates a public key, a private key and a certificate signing request through a trusted application in the TEE, and stores the private key in the trusted application.

[0033] From the above description, we can see that the process of generating public and private keys is executed in the trusted application in TEE. TEE itself is a confidential environment, and the trusted application usually also provides a layer of confidentiality protection. The built-in security mechanism in TEE and trusted applications can avoid the public and private key pairs from being cracked during the generation process and after the generation is completed, saving the cost of developing additional security programs.

[0034] Furthermore, after sending the certificate to the terminal, the method further includes:

[0035] After receiving the certificate, the terminal stores the certificate in a trusted application.

[0036] From the above description, it can be seen that after receiving the issued certificate, the certificate is also saved in the trusted application in the TEE. When the certificate needs to be used, it needs to be verified by the TEE and the trusted application, which further ensures security.

[0037] Furthermore, the certificate generation types include RSA and ECC.

[0038] As can be seen from the above description, RSA and ECC are relatively common algorithms. Usually, applications that can generate public-private key pairs can support these two algorithms, which can ensure the usability of the solution and avoid the terminal being unable to generate the corresponding public-private key pairs.

[0039] A certificate download system includes a terminal and a background, wherein the terminal includes a first memory, a first processor, and a first computer program stored in the first memory and executable on the first processor; the background includes a second memory, a second processor, and a second computer program stored in the second memory and executable on the second processor; when the first processor executes the first computer program, the following steps are implemented:

[0040] Generate a public key, a private key and a certificate signing request, and save the private key;

[0041] Send the public key and the certificate signing request to the backend;

[0042] When the second processor executes the second computer program, the following steps are implemented:

[0043] The public key is signed according to the certificate signing request to obtain a certificate, and the certificate is sent to the terminal.

[0044] The beneficial effects of the present invention are as follows: the terminal itself generates a public key, a private key and a certificate signing request, and the background encrypts the public key to obtain the certificate; the private key is stored in the terminal throughout the whole process and does not participate in the transmission process, thereby avoiding the risk of private key leakage, and the public key itself can be made public, so the certificate is directly transmitted without the need to build a separate security channel, and even if the certificate is obtained, the content of the private key cannot be obtained, thereby reducing the identity authentication process of the terminal and the background before the certificate is transmitted, and at the same time can ensure the security of the certificate download process.

[0045] Furthermore, when the first processor executes the first computer program, generating a public key, a private key, and a certificate signing request includes:

[0046] When the first processor executes the first computer program, it implements receiving an instruction for obtaining a certificate signing request, wherein the instruction includes a certificate generation type;

[0047] When the first processor executes the first computer program, it determines whether the certificate generation type is the same as a preset type, and if so, generates a public key and a private key according to the certificate generation type.

[0048] From the above description, it can be seen that the public-private key pair is generated by the terminal, and the key generation algorithm supported by the terminal may not match the key type that the background can issue. Therefore, before the terminal generates a public-private key pair, the background first sends an instruction to obtain a certificate signing request, which includes the certificate generation type, that is, the type supported by the background. If the terminal also supports this type, the public-private key pair is generated through the certificate generation type. This avoids the problem of the terminal process being unable to issue the corresponding certificate after the terminal sends the certificate signing request to the background, and can interrupt the unexecutable process as soon as possible.

[0049] Furthermore, when the first processor executes the first computer program, it generates a public key, a private key and a certificate signing request through a trusted application in the TEE, and stores the private key in the trusted application.

[0050] From the above description, we can see that the process of generating public and private keys is executed in the trusted application in TEE. TEE itself is a confidential environment, and the trusted application usually also provides a layer of confidentiality protection. The built-in security mechanism in TEE and trusted applications can avoid the public and private key pairs from being cracked during the generation process and after the generation is completed, saving the cost of developing additional security programs.

[0051] Furthermore, after sending the certificate to the terminal, the method further includes:

[0052] When the first processor executes the first computer program, after receiving the certificate, the certificate is stored in a trusted application.

[0053] From the above description, it can be seen that after receiving the issued certificate, the certificate is also saved in the trusted application in the TEE. When the certificate needs to be used, it needs to be verified by the TEE and the trusted application, which further ensures security.

[0054] Furthermore, the certificate generation types include RSA and ECC.

[0055] As can be seen from the above description, RSA and ECC are relatively common algorithms. Usually, applications that can generate public-private key pairs can support these two algorithms, which can ensure the usability of the solution and avoid the terminal being unable to generate the corresponding public-private key pairs.

[0056] The certificate downloading method and system of the present invention can be applied to scenarios where a certificate needs to be temporarily downloaded to a terminal for use, especially to scenarios where a non-financial certificate needs to be temporarily downloaded to a financial terminal for use.

[0057] Please refer to Figure 1-2 , Embodiment 1 of the present invention is:

[0058] A certificate downloading method comprises the steps of:

[0059] S1. The terminal generates a public key, a private key and a certificate signing request (CSR), and saves the private key, including:

[0060] S11, the terminal receives an instruction for obtaining a certificate signing request, the instruction including a certificate generation type;

[0061] In an optional implementation, an instruction to obtain a certificate signing request is sent to the terminal through a PC tool, and the user's authority can be verified in the PC tool. Only after the user with corresponding authority verifies his identity can the instruction to obtain a certificate signing request be sent through the PC tool, thereby further ensuring the security of the certificate generation process;

[0062] In an optional implementation, a SubCA certificate is pre-installed in the terminal, and the data sent from the background (such as instructions for obtaining a certificate signing request, certificates, etc.) includes a certificate chain. The certificate chain is verified using the SubCA certificate pre-installed in the terminal. If the verification passes, it means that the background identity is correct. If the verification fails, it means that the data may be risky and will not be processed;

[0063] S12, the terminal determines whether the certificate generation type is the same as the preset type, and if so, generates a public key and a private key according to the certificate generation type, and generates a certificate signing request;

[0064] If the certificate generation type is the same as the preset type, it means that the terminal can support the calculation of public and private key pairs through this type. If the certificate generation type is different from the preset type, it means that the terminal does not support the calculation of public and private key pairs through this type, and the requirements for background signature cannot be met. Other methods need to be used to issue certificates; for example, the traditional server generates the certificate and then issues it, or adjusts the certificate generation type, or modifies the terminal's TEE to increase the supported preset types.

[0065] In an optional implementation, the certificate generation type includes RSA (an asymmetric encryption algorithm) and ECC (elliptic curve encryption algorithm);

[0066] S13, saving the private key;

[0067] In an optional implementation, the terminal generates a public key, a private key, and a certificate signing request through a trusted application (TA) in the TEE, and stores the private key in the trusted application;

[0068] S2. The terminal sends the public key and the certificate signing request to the backend;

[0069] S3, the backend signs the public key according to the certificate signing request to obtain a certificate, and sends the certificate to the terminal;

[0070] In an optional implementation manner, the backend calls a certificate issuing service to sign the public key to obtain a certificate, including:

[0071] (1) The backend will submit the CSR certificate signing request to the certificate authority (CA), for example, you can submit the CSR file through the CA's online application page or other methods specified by the CA;

[0072] (2) The CA will verify the submitted CSR to ensure that the applicant has control over the corresponding private key and verify the applicant's identity information;

[0073] (3) After verification, the CA will use its own private key to sign the public key in the CSR and generate a digital certificate. The certificate will contain the public key, applicant information, and CA's digital signature.

[0074] (4) CA sends the digital certificate back to the backend; after receiving the certificate, the backend can send the certificate data to the terminal;

[0075] S4. After receiving the certificate, the terminal saves the certificate in a trusted application;

[0076] S5. Close the trusted application;

[0077] That is, after the certificate is downloaded, it can be used in the security scenarios required by the business in the terminal. For example, the certificate will be used to establish an AP-SE channel (a channel between the terminal's regular environment and the secure environment). During the AP-SE channel establishment process, the TA side will prepare a certificate chain with signing capabilities. Since it does not involve a financial transaction process, the method in the present invention can be used to download the certificate chain.

[0078] Please refer to Figure 3 , Embodiment 2 of the present invention is:

[0079] A certificate download system includes a terminal 1 and a background 2, wherein the terminal 1 includes a first memory 12, a first processor 11, and a first computer program stored in the first memory 12 and executable on the first processor 11; the background includes a second memory 22, a second processor 21, and a second computer program stored in the second memory 22 and executable on the second processor 21; when the first processor 11 executes the first computer program, each step implemented by the terminal in Example 1 is implemented; when the second processor 21 executes the second computer program, each step implemented by the background in Example 1 is implemented.

[0080] In summary, the present invention provides a certificate downloading method and system. The terminal determines whether it supports the certificate generation type in the instruction according to the received instruction. If it does, the TA in the terminal TEE generates a public-private key pair, and generates a certificate signing request. The public key and the certificate signing request are sent to the background, and the background directly signs the public key to obtain the certificate. Because the public key itself is public, and the private key generated by the terminal is not involved in the transmission, the hidden danger of the private key being obtained and cracked during the transmission process is avoided, and the security is improved. Moreover, the public key itself is public, so even if the certificate is intercepted, the corresponding private key cannot be obtained. At the same time, further protection is provided through the TEE and TA of the terminal, and the existing security environment is used to reduce the cost of secondary development without increasing the existing system.

[0081] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A certificate downloading method, characterized in that: Includes steps: The terminal generates a public key, a private key and a certificate signing request, and saves the private key; The terminal sends the public key and the certificate signing request to the backend; The backend signs the public key according to the certificate signing request to obtain a certificate, and sends the certificate to the terminal.

2. A certificate downloading method according to claim 1, characterized in that: The terminal generates a public key, a private key and a certificate signing request including: The terminal receives an instruction for obtaining a certificate signing request, wherein the instruction includes a certificate generation type; The terminal determines whether the certificate generation type is the same as a preset type, and if so, generates a public key and a private key according to the certificate generation type.

3. A certificate downloading method according to claim 1 or 2, characterized in that: The terminal generates a public key, a private key and a certificate signing request through a trusted application in the TEE, and stores the private key in the trusted application.

4. A certificate downloading method according to claim 1, characterized in that: After sending the certificate to the terminal, the method further includes: After receiving the certificate, the terminal stores the certificate in a trusted application.

5. A certificate downloading method according to claim 2, characterized in that: The certificate generation types include RSA and ECC.

6. A certificate download system, comprising a terminal and a background, wherein the terminal comprises a first memory, a first processor, and a first computer program stored in the first memory and executable on the first processor; the background comprises a second memory, a second processor, and a second computer program stored in the second memory and executable on the second processor; characterized in that: When the first processor executes the first computer program, the following steps are implemented: Generate a public key, a private key and a certificate signing request, and save the private key; Send the public key and the certificate signing request to the backend; When the second processor executes the second computer program, the following steps are implemented: The public key is signed according to the certificate signing request to obtain a certificate, and the certificate is sent to the terminal.

7. A certificate downloading system according to claim 6, characterized in that: The first processor executing the first computer program to generate a public key, a private key and a certificate signing request includes: When the first processor executes the first computer program, it implements receiving an instruction for obtaining a certificate signing request, wherein the instruction includes a certificate generation type; When the first processor executes the first computer program, it determines whether the certificate generation type is the same as a preset type, and if so, generates a public key and a private key according to the certificate generation type.

8. A certificate downloading system according to claim 6 or 7, characterized in that: When the first processor executes the first computer program, a public key, a private key and a certificate signing request are generated through a trusted application in the TEE, and the private key is stored in the trusted application.

9. A certificate downloading system according to claim 6, characterized in that: After sending the certificate to the terminal, the method further includes: When the first processor executes the first computer program, after receiving the certificate, the certificate is stored in a trusted application.

10. A certificate downloading system according to claim 7, characterized in that: The certificate generation types include RSA and ECC.