Key exchange method, apparatus, device, and storage medium
The method of exchanging public keys through the server solves the risk exposure and unstable connection problems of key exchange between devices, realizes long-distance public key exchange, and improves communication security and user experience.
Patent Information
- Application Number
- PCT/CN2023/089943
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-04-21
- Publication Date
- 2024-10-24
AI Technical Summary
In the existing technology, key exchange between devices has problems of risk exposure and unstable connections. Especially in the symmetric key system, key leakage affects all devices, while the asymmetric key system requires local connection and cannot achieve long-distance connection. Public key exchange affects user experience and flexibility.
Public key exchange is performed through the server, an asymmetric key pair is generated between devices, and the public key is transmitted through the certificate chain to ensure communication security and stability. At the same time, long-distance public key exchange is achieved, reducing operational complexity and the need for equipment manufacturer docking.
It improves communication security and user experience, realizes long-distance public key exchange between devices, reduces operational complexity and docking requirements between devices, and enhances applicable limitations and flexibility.
Smart Images

Figure CN2023089943_24102024_PF_FP_ABST
Abstract
Description
Key exchange method, device, equipment and storage medium Technical Field
[0001] The present disclosure relates to the field of communication technologies, and in particular to a key exchange method, apparatus, device, and storage medium. Background Art
[0002] In a communication system, a communication key is usually set for each device that needs to communicate, so that the devices can perform encrypted communication based on the communication key, thereby ensuring communication security.
[0003] Summary of the Invention
[0004] The present disclosure provides a key exchange method, apparatus, device and storage medium.
[0005] In a first aspect, an embodiment of the present disclosure provides a key exchange method, including:
[0006] generating a first key pair, the first key pair comprising a first public key and a first private key;
[0007] Sending the first public key to the server;
[0008] Receive a first public key certificate sent by the server, where the first public key certificate includes a second public key in a second key pair; the second key pair is generated by a second device, which also includes a second private key, and the second device is a device that needs to communicate with the first device.
[0009] In a second aspect, an embodiment of the present disclosure provides a key exchange method, including:
[0010] Receiving a first public key sent by a first device, wherein the first public key belongs to a first key pair, the first key pair also includes a first private key, and the first key pair is generated by the first device;
[0011] receiving a second public key sent by a second device; the second public key belongs to a second key pair, the second key pair also includes a second private key, the second key pair is generated by the second device, and the second device is a device that needs to communicate with the first device;
[0012] generating at least one of a first public key certificate, a second public key certificate, and a third public key certificate; the first public key certificate including the second public key of the second key pair; the second public key certificate including the fourth public key of the fourth key pair, the fourth key pair also including a fourth private key; the third public key certificate including the first public key, and the third public key certificate being signed by the fourth private key;
[0013] At least one of the first public key certificate, the second public key certificate, and the third public key certificate is sent to the first device and / or the second device.
[0014] In a third aspect, an embodiment of the present disclosure provides a key exchange method, including:
[0015] generating a second key pair, the second key pair comprising a second public key and a second private key;
[0016] Sending the second public key to the server;
[0017] Receive a second public key certificate and a third public key certificate; the second public key certificate includes the fourth public key in a fourth key pair, the fourth key pair also includes a fourth private key, and the fourth key pair is generated by the server; the third public key certificate includes the first public key in the first key pair, the first key pair is generated by a first device, the first device is a device that needs to communicate with the second device, and the third public key certificate is obtained by signing the fourth private key.
[0018] In a fourth aspect, an embodiment of the present disclosure provides a key exchange method, including:
[0019] Receive the key request message sent by the server;
[0020] generating a sixth key pair, the sixth key pair comprising a sixth public key and a sixth private key;
[0021] Sending the sixth public key to the server;
[0022] Receive a first public key certificate sent by the server, where the first public key certificate includes the second public key in the second key pair; the second key pair is generated by a second device, which also includes a second private key, and the second device is a device that needs to communicate with the third device.
[0023] In a fifth aspect, an embodiment of the present disclosure provides a communication device, including:
[0024] A processing module, configured to generate a first key pair, the first key pair comprising a first public key and a first private key;
[0025] A transceiver module, configured to send the first public key to the server;
[0026] The transceiver module is also used to receive a first public key certificate sent by the server, where the first public key certificate includes the second public key in the second key pair; the second key pair is generated by a second device, where the second key pair also includes a second private key, and the second device is a device that needs to communicate with the first device.
[0027] In a sixth aspect, an embodiment of the present disclosure provides a communication device, including:
[0028] a transceiver module, configured to receive a first public key sent by a first device; the first public key belongs to a first key pair, the first key pair also includes a first private key, and the first key pair is generated by the first device;
[0029] The transceiver module is further configured to receive a second public key sent by a second device; the second public key belongs to a second key pair, the second key pair also includes a second private key, the second key pair is generated by the second device, and the second device is a device that needs to communicate with the first device;
[0030] a processing module, configured to generate at least one of a first public key certificate, a second public key certificate, and a third public key certificate; the first public key certificate including the second public key of the second key pair; the second public key certificate including the fourth public key of the fourth key pair, the fourth key pair also including a fourth private key; the third public key certificate including the first public key, and the third public key certificate being signed by the fourth private key;
[0031] The transceiver module is further configured to send at least one of a first public key certificate, a second public key certificate, and a third public key certificate to the first device and / or the second device.
[0032] In a seventh aspect, an embodiment of the present disclosure provides a communication device, including:
[0033] a processing module, configured to generate a second key pair, the second key pair comprising a second public key and a second private key;
[0034] A transceiver module, configured to send the second public key to the server;
[0035] The transceiver module is also used to receive a second public key certificate and a third public key certificate; the second public key certificate includes the fourth public key in a fourth key pair, the fourth key pair also includes a fourth private key, and the fourth key pair is generated by the server; the third public key certificate includes the first public key in the first key pair, the first key pair is generated by a first device, the first device is a device that needs to communicate with the second device, and the third public key certificate is obtained by signing the fourth private key.
[0036] In an eighth aspect, an embodiment of the present disclosure provides a communication device, including:
[0037] A transceiver module is used to receive a key request message sent by a server;
[0038] a processing module, configured to generate a sixth key pair, the sixth key pair comprising a sixth public key and a sixth private key;
[0039] The transceiver module is further configured to send the sixth public key to the server;
[0040] The transceiver module is also used to receive a first public key certificate sent by the server, where the first public key certificate includes the second public key in the second key pair; the second key pair is generated by a second device, where the second key pair also includes a second private key, and the second device is a device that needs to communicate with the third device.
[0041] In a ninth aspect, an embodiment of the present disclosure provides a communication device, which includes a processor. When the processor calls a computer program in a memory, the method described in any one of the first to fourth aspects above is executed.
[0042] In the tenth aspect, an embodiment of the present disclosure provides a communication device, which includes a processor and a memory, in which a computer program is stored; the processor executes the computer program stored in the memory so that the communication device executes the method described in any one of the first to fourth aspects above.
[0043] In the eleventh aspect, an embodiment of the present disclosure provides a communication device, which includes a processor and an interface circuit, wherein the interface circuit is used to receive code instructions and transmit them to the processor, and the processor is used to run the code instructions to enable the device to execute the method described in any one of the first to fourth aspects above.
[0044] In aspect 12, an embodiment of the present disclosure provides a communication system, which includes the communication device described in aspects 5 to 8, or the system includes the communication device described in aspect 9, or the system includes the communication device described in aspect 10, or the system includes the communication device described in aspect 11.
[0045] In the thirteenth aspect, an embodiment of the present disclosure provides a computer-readable storage medium for storing instructions used for the above-mentioned network device. When the instructions are executed, the terminal executes the method described in any one of the above-mentioned aspects from the first to the fourth aspects.
[0046] In a fourteenth aspect, the present disclosure further provides a computer program product comprising a computer program, which, when executed on a computer, enables the computer to execute the method described in any one of the first to fourth aspects above.
[0047] In a fifteenth aspect, the present disclosure provides a chip system comprising at least one processor and an interface for supporting a network device in implementing the functions described in any one of aspects 1 to 4, such as determining or processing at least one of the data and information involved in the above method. In one possible design, the chip system further comprises a memory for storing computer programs and data necessary for the source slave node. The chip system may be composed of a chip or may include a chip and other discrete components.
[0048] In a sixteenth aspect, the present disclosure provides a computer program, which, when executed on a computer, enables the computer to execute the method described in any one of the first to fourth aspects above. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The above and / or additional aspects and advantages of the present disclosure will become apparent and readily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0050] FIG1a is a schematic diagram of the architecture of some communication systems provided by embodiments of the present disclosure;
[0051] FIG1b is a schematic diagram of the architecture of some communication systems provided by another embodiment of the present disclosure;
[0052] FIG2 is a schematic diagram of a key exchange method according to another embodiment of the present disclosure;
[0053] FIG3 is a schematic diagram of a key exchange method according to another embodiment of the present disclosure;
[0054] FIG4 is a schematic diagram of a flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0055] FIG5 is a schematic diagram of a flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0056] FIG6 is a schematic diagram of a flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0057] FIG7 is a schematic diagram of a flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0058] FIG8 is a schematic diagram of a flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0059] FIG9 is an interactive flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0060] FIG10 is an interactive flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0061] FIG11 is an interactive flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0062] FIG12 is an interactive flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0063] FIG13 is an interactive flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0064] FIG14 is an interactive flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0065] FIG15 is an interactive flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0066] FIG16 is an interactive flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0067] FIG17 is an interactive flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0068] FIG18 is an interactive flow chart of a key exchange method provided in yet another embodiment of the present disclosure;
[0069] FIG19 is a schematic diagram showing connections between various devices provided in an embodiment of the present disclosure;
[0070] FIG20 is a schematic diagram of an interaction flow corresponding to a method for opening a safety channel between a vehicle and a device provided in an embodiment of the present disclosure;
[0071] FIG21 is a schematic diagram of an interaction flow corresponding to a method for sharing a secure channel provided in an embodiment of the present disclosure;
[0072] FIG22 is a schematic structural diagram of a communication device provided by an embodiment of the present disclosure;
[0073] FIG23 is a schematic structural diagram of a communication device provided by an embodiment of the present disclosure;
[0074] FIG24 is a schematic structural diagram of a communication device provided by an embodiment of the present disclosure;
[0075] FIG25 is a schematic structural diagram of a communication device provided by an embodiment of the present disclosure;
[0076] FIG26 is a block diagram of a communication device provided by one embodiment of the present disclosure;
[0077] FIG27 is a schematic structural diagram of a chip provided in accordance with an embodiment of the present disclosure. DETAILED DESCRIPTION
[0078] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible implementations consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0079] The terms used in the embodiments of the present disclosure are for the purpose of describing specific embodiments only and are not intended to limit the embodiments of the present disclosure. The singular forms "a," "an," and "the" used in the embodiments of the present disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0080] It should be understood that although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present disclosure, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the embodiments of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0081] The embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be understood as limiting the present disclosure.
[0082] To facilitate understanding, the terms involved in this application are first introduced.
[0083] 1. Symmetric key
[0084] Symmetric key encryption, also known as private key encryption, means that both the sender and receiver must use the same key to encrypt and decrypt plaintext. Symmetric encryption requires a strong encryption algorithm. At a minimum, the algorithm must ensure that even if an analyst knows the algorithm and has access to some or more ciphertext, they cannot decipher the ciphertext or the key. The sender and receiver must securely obtain a copy of the secret key and ensure the key remains secure.
[0085] 2. Asymmetric keys
[0086] Asymmetric encryption, also known as public key encryption, involves a unique pair of keys that each person has. The public key (also known as a public key) and the private key (also known as a private key) are publicly available, while the private key is kept secret. Encryption with one key can only be decrypted with the other. Because the public key is publicly available, anyone wishing to send information to the holder of the private key can obtain the public key, encrypt it with the public key, and then send it to the holder of the private key. Even if the information is intercepted or stolen, an attacker without the private key cannot obtain the encrypted information, thus ensuring secure transmission. Furthermore, encrypting with the private key and then decrypting with the public key authenticates the holder of the private key, as the public key can only decrypt information encrypted with the private key.
[0087] In related technologies, the communication key set for each device that needs to communicate can be a symmetric key or an asymmetric key.
[0088] Optionally, in some embodiments, taking the example of devices requiring communication including a vehicle and a terminal device, a method for setting a symmetric key for the vehicle and the terminal device may be: the server issues the same communication key to each of the vehicle and the terminal device, or the server stores a static key, obtains corresponding feature information for different terminal devices, and calculates a communication key for encrypted communication between the terminal device and the vehicle based on the feature information of each terminal device and the static key, and then issues the key to each of the terminal devices and the vehicle. Furthermore, after the vehicle and the terminal device receive the communication key issued by the server, in subsequent communication processes between the vehicle and the terminal device, the information to be transmitted may be encrypted based on the communication key, thereby achieving secure communication.
[0089] Optionally, in some embodiments, when the communication key set for each device that needs to communicate is an asymmetric key, each device itself needs to generate a key pair, which includes a public key and a private key. In addition, before communicating between devices, they need to exchange their respective public keys to complete security verification between the devices, thereby establishing a secure channel. Optionally, after establishing a secure channel, in order to reduce the complexity of communication, each device may not communicate securely based on an asymmetric key, but may use key negotiation (such as based on the Diffie-Hellman algorithm) to generate a temporary symmetric key, and then complete secure communication based on the temporary symmetric key.
[0090] However, in the related art, with regard to the above-mentioned scheme of "setting a symmetric key for each device that needs to communicate", since under a symmetric key system, the communication keys used by all devices are the same, if the communication key is leaked (for example, if the server is hacked), it will affect the communication security between all devices, resulting in a large risk exposure for the scheme of "setting a symmetric key for each device that needs to communicate".
[0091] Also, for the above-mentioned solution of “setting asymmetric keys for each device that needs to communicate with each other”, since public keys need to be exchanged between each device, local connections (such as Bluetooth connections, Near Field Communication (NFC) connections, etc.) usually need to be established between each device. The local connections established by each device are usually unstable. For example, the compatibility of NFC connections is low and Bluetooth connections are easily affected by the environment, which will cause local connections to be unstable, thereby affecting the user experience. Also, since local connections usually need to be established at a close distance and cannot be established at a long distance, the above-mentioned solution of “setting asymmetric keys” cannot achieve the exchange of public keys between devices at a long distance, and has high limitations. At the same time, the device that generates the asymmetric key in the above-mentioned solution of “setting asymmetric keys” cannot authorize other devices to communicate securely in the same way, and has poor flexibility.
[0092] To this end, the present disclosure provides a key exchange method.
[0093] In order to better understand a key exchange method disclosed in an embodiment of the present disclosure, the communication system to which the embodiment of the present disclosure is applicable is first described below.
[0094] Please refer to Figure 1a, which is a schematic diagram of the architecture of a communication system provided in an embodiment of the present disclosure. The communication system may include but is not limited to at least one first device, at least one server and at least one second device, wherein the first device may be a terminal device, the second device may be a device that needs to communicate with the first device, and optionally, the second device may be a non-network side device. In addition, the number and form of devices shown in Figure 1a are only for example and do not constitute a limitation on the embodiment of the present disclosure. The application may include one or more first devices, or one or more servers, or one or more second devices. The communication system shown in Figure 1a takes an example including a first device, which is a terminal device, a server, a second device, and the second device is a vehicle.
[0095] Please refer to Figure 1b, which is a schematic diagram of the architecture of a communication system provided by an embodiment of the present disclosure. The communication system may include but is not limited to at least one first device, at least one server, at least one second device, and at least one third device, wherein the first device may be a terminal device, the second device may be a device that needs to communicate with the first device, optionally, the second device may be a non-network-side device, the third device may be: a device that needs to be authorized by the first device to communicate with the second device, and the third device may be a terminal device. In addition, the number and form of devices shown in Figure 1b are only for example and do not constitute a limitation on the embodiment of the present disclosure. The application may include one or more first devices, or one or more servers, or one or more second devices, or one or more third devices. The communication system shown in Figure 1b takes an example including a first device, which is a terminal device, a server, a second device, which is a vehicle, a third device, and the third device is a terminal device.
[0096] It should be noted that the technical solutions of the embodiments of the present disclosure can be applied to various communication systems, such as long-term evolution (LTE) systems, fifth-generation (5G) mobile communication systems, 5G new radio (NR) systems, or other future new mobile communication systems.
[0097] The terminal device in the embodiments of the present disclosure can be an entity on the user side for receiving or transmitting signals, such as a mobile phone. The terminal device can also be called a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The terminal device can be a car with communication function, a smart car, a mobile phone, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal, an augmented reality (AR) terminal, a wireless terminal in industrial control (industrial control), a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), etc. The embodiments of the present disclosure do not limit the specific technology and specific device form adopted by the terminal device.
[0098] It can be understood that the communication system described in the embodiment of the present disclosure is for the purpose of more clearly illustrating the technical solution of the embodiment of the present disclosure, and does not constitute a limitation on the technical solution provided by the embodiment of the present disclosure. Ordinary technicians in this field can know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solution provided by the embodiment of the present disclosure is also applicable to similar technical problems.
[0099] In addition, in order to facilitate understanding of the embodiments of the present disclosure, the following points are explained.
[0100] First, in the present disclosure, unless there is any contradiction, each step in any embodiment or example can be implemented as an independent embodiment, and the steps can be arbitrarily combined. For example, a solution after removing some steps in a certain embodiment or example can also be implemented as an independent embodiment, and the order of the steps in a certain embodiment or example can be arbitrarily exchanged. In addition, the optional methods or optional examples in a certain embodiment or example can be arbitrarily combined; in addition, the various embodiments or examples can be arbitrarily combined. For example, some or all steps of different embodiments or examples can be arbitrarily combined, and a certain embodiment or example can be arbitrarily combined with the optional methods or optional examples of other embodiments or examples.
[0101] Second, regarding the description methods of the present disclosure such as "A or B", "A and / or B", "at least one of A and B", "A in one case, B in another case", "in response to one case A, in response to another case B", etc., at least one of the following schemes may be included according to the situation: executing A independently of B, that is, A in some embodiments; executing B independently of A, that is, B in some embodiments; selectively executing A and B, that is, selecting to execute from A and B in some embodiments; executing both A and B, that is, A and B in some embodiments.
[0102] Third, each element, each row, or each column in the table involved in the present disclosure can be implemented as an independent embodiment, and the combination of any elements, any rows, and any columns can also be implemented as an independent embodiment.
[0103] Fourth, in some implementation modes or examples, “including A”, “comprising A”, “used to indicate A” and “carrying A” in this disclosure can be interpreted as directly carrying A or indirectly indicating A.
[0104] Fifth, in some implementation modes or examples, "in response to...", "in the case of...", "at the time of...", "when...", "if...", "if...", etc. in the present disclosure can be replaced with each other.
[0105] FIG2 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is executed by a first device. As shown in FIG2 , the key exchange method may include the following steps:
[0106] Step 201: Generate a first key pair.
[0107] Optionally, in some embodiments, the first key pair may include a first public key and a first private key.
[0108] Optionally, in some embodiments, the method for the first device to generate a first key pair may include: in response to a first application (such as a car manufacturer application (APP)) in the first device determining that a first key pair needs to be generated, calling a first module in the first device to generate the first key pair.
[0109] Optionally, in some embodiments, the first application may determine that the first key pair needs to be generated when it detects a first preset signal. Optionally, the first preset signal may be triggered when the user performs a first preset operation on the first application. Optionally, the first preset operation may be, for example, clicking on the "Generate (or activate) key pair" option in the first application.
[0110] Optionally, in some embodiments, the first module may be, for example, a DKF module (or a DKF interface). Optionally, after receiving the call from the first application, the first module may use the secure hardware of the first device (such as a secure element (SE) or a trusted execution environment (TEE)) to generate a first key pair, store the first private key in the first key pair in the secure hardware, and return the first public key in the first key pair to the first application. Optionally, the first module may directly return the first public key to the first application, or the first module may send a second certificate signing request (CSR) to the first application, the second CSR including the first public key, and the first application may parse the second CSR to obtain the first public key.
[0111] It should be noted that, in some embodiments, before executing the key exchange method of the present disclosure, at least one of the following verifications needs to be completed between the server and the first device:
[0112] The server has completed authentication of the user of the first device;
[0113] The first application has established a secure channel with the server;
[0114] The first module has completed the legitimacy verification of the first application.
[0115] Step 202: Send the first public key to the server.
[0116] Optionally, in some embodiments, the first application in the first device may send the first public key to the server.
[0117] Optionally, in some embodiments, the first public key may be sent directly to the server, or a first CSR may be sent to the server, the first CSR including the first public key.
[0118] Optionally, in some embodiments, the first device sends the first public key to the server so that the server can subsequently send the first public key to the second device. Optionally, the second device may be a device that needs to communicate with the first device. The second device can then subsequently implement encrypted communication with the first device based on the first public key, ensuring communication security. Details on how the server sends the first public key to the second device will be described in subsequent embodiments.
[0119] Step 203: Receive the first public key certificate sent by the server.
[0120] Optionally, in some embodiments, the first public key certificate may include the second public key in the second key pair; optionally, the second key pair may be generated by the second device, and the second key pair may also include a second private key. Optionally, after the second device generates the second key pair, it may send the second public key to the server. For example, the second device may directly send the second public key to the server, or the second device may send a third CSR to the server, and the third CSR may include the second public key. And, after the server receives the second public key sent by the second device, it may generate the above-mentioned first public key certificate based on the second public key. Optionally, in some embodiments, the first public key certificate may be obtained by signing the server using the third private key in the third key pair. Optionally, the third key pair is pre-generated by the server, and the third key pair includes a third public key and a third private key. Optionally, in some embodiments, the method for the server to generate the above-mentioned first public key certificate may include: the server signs the second public key based on the third private key to obtain a first signature, and constructs the above-mentioned first public key certificate based on the first signature and the second public key, and after the server generates the first public key certificate, the first public key certificate can be sent to the first device.
[0121] Optionally, in some embodiments, after the first device receives the first public key certificate sent by the server, since the first public key certificate includes the second public key generated by the second device, the first device can obtain the second public key corresponding to the second device based on the first public key certificate. Combined with the above steps 202-203, it can be seen that in the embodiment of the present disclosure, the first device will send the first public key corresponding to the first device to the second device through the server, and the first device will receive the second public key corresponding to the second device through the server, so that the first device and the second device can realize the exchange of their public keys through the server. Therefore, when the first device needs to communicate with the second device, the first device and the second device can perform encrypted communication based on their own private keys and each other's public keys, thereby ensuring the security of communication.
[0122] Furthermore, in some embodiments, because the disclosed method establishes an asymmetric key system, each device generates its own corresponding key pair, implementing a "one device, one secret" mechanism. This provides greater security than a symmetric key system that uses the same key to achieve secure communication between all devices. Furthermore, because the disclosed method exchanges public keys through a server, rather than private keys, even if the server is compromised, only the public key is leaked, not the private key, thus maintaining communication security.
[0123] Furthermore, in some embodiments, since the first and second devices exchange their public keys through a server, the exchange of public keys between the first and second devices can be successfully achieved even if the distance between them is relatively long. This eliminates the limitation that "the application scenarios of asymmetric keys in the aforementioned related art solutions must be limited to devices in close proximity," thereby making the key exchange method disclosed herein less limited in its applicability and more flexible. Furthermore, the stability of the connection between the first and second devices and the server is also high, thus avoiding the technical issue of "user experience being affected by poor connection stability." Furthermore, since the first and second devices exchange their public keys through a server, rather than directly between the first and second devices, even if the first and second devices are of different brands or platforms, cross-platform and cross-brand public key exchange can be successfully achieved through the server, further reducing the limitations of the key exchange method, expanding its scope of application, and eliminating the need for docking between different device manufacturers, thus reducing operational complexity.
[0124] In summary, in the key exchange method provided by the embodiment of the present disclosure, the first device and the second device can exchange their public keys through the server. Then, when the first device communicates with the second device, encrypted communication can be performed based on its own private key and the other party's public key, thereby ensuring the security of communication. Moreover, the method disclosed in the present disclosure implements a "one machine, one secret" mechanism, and exchanges public keys through the server instead of exchanging private keys, which can further ensure the security of communication. At the same time, the method disclosed in the present disclosure can also realize the exchange of public keys between the first device and the second device at a long distance, with low applicability limitations and high flexibility. In addition, the stability of the method disclosed in the present disclosure is also high, which improves the user experience. At the same time, it can also realize the exchange of public keys between cross-platform and cross-brand devices, expand the scope of application, and no longer require docking between different equipment manufacturers, reducing the complexity of operation.
[0125] FIG3 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is executed by a first device. As shown in FIG3 , the key exchange method may include the following steps:
[0126] Step 301: Verify the first public key certificate.
[0127] Optionally, as described in step 203 above, the first public key certificate includes a first signature and a second public key, wherein the first signature is obtained by signing the second public key using the third private key. Thus, in some embodiments, the first device can verify the first public key certificate based on the third public key. Optionally, the third public key can be pre-configured on the first and second devices. Based on this, in some embodiments, the method for the first device to verify the first public key certificate based on the third public key can be: when the first device receives the first public key certificate sent by the server, the first device decrypts the first signature in the first public key certificate based on the preconfigured third public key to obtain a decryption result, and then compares the decryption result with the second public key of the first public key certificate to see if they are consistent. When they are consistent, it is determined that the first public key certificate is generated by the server, which means that its source is trustworthy, and thus the first public key certificate (such as the second public key in the first public key certificate) is trustworthy, and the first public key certificate is determined to have passed the verification. When they are inconsistent, it is determined that the first public key certificate is not generated by the server, which means that its source is untrustworthy, and thus the first public key certificate (such as the second public key in the first public key certificate) is untrustworthy, and then the first public key certificate is determined to have failed the verification.
[0128] Step 302: In response to the first public key certificate being verified successfully, communicate with the second device based on at least one of the first public key, the first private key, and the second public key included in the first public key certificate.
[0129] Optionally, the method for a first device to communicate with a second device based on at least one of a first public key, a first private key, and a second public key included in a first public key certificate may include: when the first device wants to send information to the second device, the first device may first use the first private key generated by the first device itself to sign the information to be sent, and then use the second public key generated by the second device itself to encrypt the information before sending it to the second device. Furthermore, after the second device receives the information sent by the first device, it may use the first public key generated by the first device itself obtained from the server to verify the signature of the received information, and use the second private key generated by the second device itself to decrypt the information, thereby achieving key-based secure communication between the first and second devices.
[0130] It should be noted that in other embodiments, after the first device verifies the first public key certificate, the first device may not communicate with the second device based on the first public key, the first private key, and at least one of the second public keys included in the first public key certificate, but may negotiate with the second device through a key (such as based on the Diffie-Hellman algorithm) to generate a temporary symmetric key, and then communicate with the second device based on the temporary symmetric key, thereby reducing the complexity of encrypted communication.
[0131] To sum up, in the key exchange method provided by the embodiment of the present disclosure, after receiving the first public key certificate, the first device will first verify the first public key certificate. When the first public key certificate is verified, it will communicate with the second device based on the first public key, the first private key, and at least one of the second public keys included in the first public key certificate, thereby ensuring the communication security between the first device and the second device.
[0132] FIG4 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is executed by a first device. As shown in FIG4 , the key exchange method may include the following steps:
[0133] Step 401: Receive the second public key certificate and the third public key certificate sent by the server.
[0134] Optionally, in some embodiments, the second public key certificate may include a fourth public key in a fourth key pair, the fourth key pair also including a fourth private key, the fourth key pair being generated by the server, and the second public key certificate being signed by the third private key in the third key pair. The third public key certificate may include the first public key, and the third public key certificate being signed by the fourth private key.
[0135] Optionally, in some embodiments, the second public key certificate and the third public key certificate are both generated by the server, wherein the reason why the server generates the second public key certificate and the third public key certificate is mainly that the server uses the second public key certificate and the third public key certificate to transmit the first public key of the first device to the second device. Specifically, it can be seen from the above content that the third public key certificate includes the first public key generated by the first device itself, and the third public key certificate is signed by the fourth private key. Therefore, it can be seen that the third public key certificate is used to transmit the first public key of the first device, and the third public key certificate needs to be verified by the fourth public key; at the same time, the above-mentioned second public key certificate includes the fourth public key, and the second public key certificate is signed by the third private key. Therefore, it can be seen that the second public key certificate is used to transmit the fourth public key, and the second public key certificate needs to be verified by the third public key. Based on this, the second public key certificate and the third public key certificate form a certificate chain and can be used to transfer the first public key of the first device. The certificate chain formed by the second public key certificate and the third public key certificate is as follows: the second public key certificate must be verified using the third public key to obtain the fourth public key, and then the third public key certificate is verified based on the fourth public key to obtain the first public key. Based on this, the server generates the second public key certificate and the third public key certificate and sends them to the second device to transfer the first public key of the first device to the second device.
[0136] Optionally, it should be noted that after the server generates the second public key certificate and the third public key certificate, the second public key certificate and the third public key certificate should be sent to the second device so that the second device knows the first public key of the first device, thereby realizing the public key exchange between the first device and the second device. However, in some embodiments, there may be a situation where the second device is offline. For example, the second device is not connected to the server, making it impossible for the server to communicate with the second device. Therefore, the server can send the second public key certificate and the third public key certificate to the first device so that the first device can first send the second public key certificate and the third public key certificate to the second device when communicating with the second device for the first time. And after the second device obtains the first public key of the first device based on the second public key certificate and the third public key certificate, it can then communicate securely.
[0137] It can be seen that in the present disclosure, the first public key is transferred by constructing a certificate chain, wherein, since the second public key certificate in the certificate chain needs to be signed by the third private key of the third key pair, and the third public key certificate in the certificate chain needs to be signed by the fourth private key of the fourth key pair, it is necessary to know the third private key and the fourth private key at the same time to construct the second public key certificate and the third public key certificate. On this basis, a security breach will only be caused when both the third private key and the fourth private key are leaked, and when either the third private key or the fourth private key is leaked, no security breach will be caused, thereby making the security and stability of the method of the present disclosure higher.
[0138] Furthermore, in some embodiments, the method for the server to generate a second public key certificate may include: the server using the third private key to sign the fourth public key in the fourth key pair to obtain a second signature, and using the second signature and the fourth public key to form the second public key certificate. Optionally, the fourth key pair may be pre-generated by the server. And, in other embodiments, the method for the server to generate a third public key certificate may include: after the server obtains the first public key sent by the first device, using the fourth private key in the fourth key pair to sign the first public key to obtain a third signature, and using the third signature and the first public key to form the second public key certificate.
[0139] To sum up, in the key exchange method provided by the embodiment of the present disclosure, the first device will receive the second public key certificate and the third public key certificate sent by the server, wherein the second public key certificate and the third public key certificate are used to transfer the first public key of the first device, so that the first device can send the second public key certificate and the third public key certificate it receives to the second device to transfer the first public key of the first device to the second device, thereby realizing the public key exchange between the first device and the second device. Subsequently, when the first device communicates with the second device, the first device and the second device can perform encrypted communication based on their own private keys and each other's public keys, thereby ensuring the security of communication.
[0140] FIG5 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is executed by a first device. As shown in FIG5 , the key exchange method may include the following steps:
[0141] Step 501: Verify the second public key certificate and the third public key certificate.
[0142] Optionally, in some embodiments, the method for the first device to verify the second public key certificate and the third public key certificate may include the following steps:
[0143] Step a: Verify the second public key certificate based on the third public key to obtain a fourth public key.
[0144] Optionally, the method for verifying the second public key certificate in step a above may be:
[0145] As described in step 401 above, the second public key certificate includes a second signature and a fourth public key, wherein the second signature is obtained by signing the fourth public key with the third private key. Therefore, in some embodiments, the first device can verify the first public key certificate based on the third public key. Optionally, the third public key can be preconfigured into the first device and the second device. Optionally, the method for the first device to verify the second public key certificate based on the third public key can be: when the first device receives the second public key certificate sent by the server, the first device decrypts the second signature in the second public key certificate based on the preconfigured third public key to obtain a decryption result, and then compares the decryption result with the fourth public key of the second public key certificate to see if they are consistent. When they are consistent, it is determined that the second public key certificate is generated by the server, which means that its source is trustworthy, and thus the second public key certificate (such as the fourth public key in the second public key certificate) is trustworthy, and then the second public key certificate verification is determined to be successful. When they are inconsistent, it is determined that the second public key certificate is not generated by the server, which means that its source is untrustworthy, and thus the second public key certificate (such as the fourth public key in the second public key certificate) is untrustworthy, and then the second public key certificate verification is determined to be unsuccessful.
[0146] Step b: Verify the third public key certificate based on the fourth public key.
[0147] Optionally, the method for verifying the third public key certificate in step a above may be:
[0148] As can be seen from the introduction of step 401 above, the third public key certificate includes a third signature and a first public key, wherein the third signature is obtained by signing the first public key with the fourth private key. Therefore, in some embodiments, the first device can verify the third public key certificate based on the fourth public key. Optionally, the method for the first device to verify the third public key certificate based on the fourth public key may include: first decrypting the third signature in the third public key certificate using the fourth public key to obtain a decryption result, then comparing the decryption result with the first public key of the third public key certificate to see if they are consistent. If they are consistent, it is determined that the third public key certificate was generated by the server, indicating that its source is trustworthy. Therefore, the third public key certificate (such as the first public key in the third public key certificate) is trustworthy, and the third public key certificate verification is determined to have passed. If they are inconsistent, it is determined that the third public key certificate was not generated by the server, indicating that its source is untrustworthy. Therefore, the third public key certificate (such as the first public key in the third public key certificate) is untrustworthy, and the third public key certificate verification is determined to have failed.
[0149] To sum up, in the key exchange method provided by the embodiment of the present disclosure, after the first device receives the second public key certificate and the third public key certificate sent by the server, it can verify the second public key certificate and the third public key certificate, thereby ensuring the security and stability of certificate transmission.
[0150] FIG6 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is executed by a first device. As shown in FIG6 , the key exchange method may include the following steps:
[0151] Step 601: Send a second public key certificate and a third public key certificate to a second device.
[0152] Optionally, in some embodiments, after the first device successfully verifies the second public key certificate and the third public key certificate, it sends the second public key certificate and the third public key certificate to the second device.
[0153] Optionally, in some embodiments, the first device sends the second public key certificate and the third public key certificate to the second device, so that the second device verifies the second public key certificate and the third public key certificate to obtain the first public key of the first device, thereby achieving public key exchange between the first device and the second device. This allows the first device and the second device to subsequently achieve secure communication based on their own private keys and each other's public keys. For details on this part, please refer to the description of the embodiment of Figure 4 above.
[0154] To sum up, in the key exchange method provided by the embodiment of the present disclosure, the first device will send the second public key certificate and the third public key certificate it receives to the second device to pass the first public key of the first device to the second device, thereby realizing the public key exchange between the first device and the second device. Subsequently, when the first device communicates with the second device, the first device and the second device can perform encrypted communication based on their own private keys and each other's public keys, ensuring the security of communication.
[0155] FIG7 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is executed by a first device. As shown in FIG7 , the key exchange method may include the following steps:
[0156] Step 701: Determine relevant information of a third device.
[0157] Optionally, in some embodiments, the third device may be a device that requires authorization from the first device to communicate with the second device, and the third device may be a terminal device. For example, the third device may be a terminal device of a friend of the user of the first device.
[0158] Optionally, in some embodiments, the relevant information of the third device may include at least one of the following:
[0159] identification information indicating a third device;
[0160] a validity period for communication between the third device and the second device, and optionally, the third device may communicate with the second device during the validity period;
[0161] The control authority of the third device over the second device, optionally, when the second device is a vehicle, the control authority may be, for example, starting the vehicle, playing audio in the vehicle, etc.
[0162] Optionally, in some embodiments, the method for the first device to determine relevant information of the third device may include: the first device determines the relevant information of the third device by detecting the third device selected by the user in the first application, and the set communication validity period and control authority.
[0163] Step 702: Send relevant information of the third device to the server.
[0164] Optionally, in some embodiments, when the first device sends relevant information of the third device to the server, it indicates that the first device has authorized the third device to communicate with the second device. At this time, the server can further perform subsequent operations so that the third device and the second device can exchange their own public keys and communicate securely based on the other party's public key and its own private key. This part of the content will be introduced in detail in subsequent embodiments.
[0165] Step 703: Receive the fifth public key sent by the server.
[0166] Optionally, in some embodiments, the fifth public key belongs to a fifth key pair, the fifth key pair also includes a fifth private key, and the fifth key pair is generated by the server.
[0167] Step 704: Use the first private key to sign the fifth public key to obtain a fourth public key certificate.
[0168] Optionally, in some embodiments, the method for the first device to generate the fourth public key certificate may include: using the first private key to sign the fifth public key to obtain a fourth signature, and constructing a fourth public key certificate based on the fourth signature and the fifth public key.
[0169] Step 705: Send the fourth public key certificate to the server.
[0170] Optionally, in some embodiments, the main reason why the first device generates a fourth public key certificate and sends it to the server is to use the fourth public key certificate as an intermediate certificate to pass the sixth public key of the third device to the second device. Optionally, the sixth public key belongs to a sixth key pair, which also includes a sixth private key, and the sixth key will be generated by the third device.
[0171] The above-mentioned “using the fourth public key certificate as an intermediate certificate to transmit the sixth public key of the third device to the second device” is described in detail below.
[0172] Optionally, after the server determines that the first device has authorized the third device to communicate with the second device, the server will send a key request message to the third device to request the sixth public key of the third device, and after the server receives the sixth public key of the third device, the server will determine the certificate for transmitting the sixth public key of the third device and the certificate for transmitting the second public key of the second device. Optionally, the above-mentioned "certificate for transmitting the second public key of the second device" is the above-mentioned first public key certificate. For this part of the content, please refer to the description of the above-mentioned embodiment. The above-mentioned "certificate for transmitting the sixth public key of the third device" may include a fourth public key certificate and a fifth public key certificate. Optionally, the fourth public key certificate is generated by the first device. The specific generation method is described in step 704 above. The fifth public key certificate is generated by the server. The fifth public key certificate includes the sixth public key. The fifth public key certificate is signed by the fifth private key. Therefore, it can be seen that the fifth public key certificate is used to transmit the sixth public key of the third device, and the fifth public key certificate needs to be verified by the fifth public key; at the same time, the fourth public key certificate is used to transmit the fifth public key, and the fourth public key certificate needs to be verified by the third public key. Based on this, the fourth public key certificate and the fifth public key certificate will form a certificate chain, and can be used to transmit the sixth public key of the third device. The certificate chain formed by the fourth public key certificate and the fifth public key certificate is: first, the fourth public key certificate must be verified using the first public key to obtain the fifth public key, and then the fifth public key certificate is verified based on the fifth public key to obtain the sixth public key of the third device.
[0173] And, optionally, after the server generates a certificate for transmitting the sixth public key of the third device (i.e., the fourth public key certificate and the fifth public key certificate mentioned above) and a certificate for transmitting the second public key of the second device (i.e., the first public key certificate mentioned above), it can send the fourth public key certificate and the fifth public key certificate to the second device and send the first public key certificate to the third device, thereby realizing the public key exchange between the second device and the third device, so that the second device and the third device can realize secure communication based on their own private keys and each other's public keys.
[0174] It can be seen from the above content that in the present disclosure, the sixth public key is transferred by constructing a certificate chain, wherein, since the fourth public key certificate in the certificate chain needs to be signed by the first private key of the first key pair, and the fifth public key certificate in the certificate chain needs to be signed by the fifth private key of the fifth key pair, it is necessary to know the first private key and the fifth private key at the same time to construct the fourth public key certificate and the fifth public key certificate. On this basis, only when both the first private key and the fifth private key are leaked will a security breach be caused, and when either the first private key or the fifth private key is leaked, no security breach will be caused, thereby making the security and stability of the method of the present disclosure higher.
[0175] In summary, in the key exchange method provided by the embodiment of the present disclosure, the first device will authorize the third device to communicate with the second device by sending relevant information of the third device to the server. That is, the present disclosure provides a "secure channel sharing method" for a device that has established a secure channel to share the secure channel with other devices that have not established a secure channel, thereby improving the flexibility of secure communication. In addition, in the method of the present disclosure, the first device will generate a fourth public key certificate, and the server will generate a fifth public key certificate. By sending the fourth public key certificate and the fifth public key certificate to the second device, the sixth public key of the third device is transmitted to the second device. By sending the first public key certificate to the third device, the second public key of the second device is transmitted to the third device, thereby realizing the public key exchange between the third device and the second device, and ensuring secure communication between the second device and the third device.
[0176] FIG8 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is executed by a server. As shown in FIG8 , the key exchange method may include the following steps:
[0177] Step 801: Receive a first public key sent by a first device.
[0178] Optionally, the first public key belongs to a first key pair, the first key pair also includes a first private key, and the first key pair is generated by the first device.
[0179] Step 802: Receive a second public key sent by a second device.
[0180] Optionally, the second public key belongs to a second key pair, the second key pair also includes a second private key, and the second key pair is generated by a second device, which is a device that needs to communicate with the first device.
[0181] Step 803: Generate at least one of the first public key certificate, the second public key certificate, and the third public key certificate.
[0182] Optionally, the first public key certificate may include the second public key in the second key pair;
[0183] Optionally, the second public key certificate may include the fourth public key in the fourth key pair, and the fourth key pair also includes a fourth private key; the second public key certificate is obtained by signing the third private key in the third key pair.
[0184] Optionally, the third public key certificate may include the first public key, and the third public key certificate is signed by the fourth private key.
[0185] Optionally, in some embodiments, the server may generate a third key pair and a fourth key pair, and then generate a second public key certificate based on the third private key signature in the third key pair, and generate a third public key certificate based on the fourth private key signature in the fourth key pair.
[0186] The specific method of how the server generates the first public key certificate, the second public key certificate, and the third public key certificate may be described in the above embodiment.
[0187] Step 804: Send at least one of the first public key certificate, the second public key certificate, and the third public key certificate to the first device and / or the second device.
[0188] Optionally, in some embodiments, in response to the server being able to communicate with the second device (i.e., the second device is online), the server may send the second public key certificate and the third public key certificate to the second device, and send at least one of the first public key certificate, the second public key certificate, and the third public key certificate to the first device (such as sending the first public key certificate to the first device, or sending the first public key certificate, the second public key certificate, and the third public key certificate to the first device); thereby, the second device can obtain the first public key of the first device by verifying the second public key certificate and the third public key certificate, and the first device can obtain the second public key of the second device by verifying the first public key certificate, thereby realizing the exchange of the first device and the second device's own public keys, so that the first device and the second device can subsequently communicate securely based on their own private keys and each other's public keys.
[0189] Optionally, in other embodiments, in response to the server being unable to communicate with the second device (i.e., the second device is offline), the server may send the first public key certificate, the second public key certificate, and the third public key certificate to the first device, and the first device may subsequently forward the second public key certificate and the third public key certificate to the second device, thereby also enabling the exchange of the first device's own public keys with the second device, so that the first device and the second device may subsequently communicate securely based on their own private keys and each other's public keys.
[0190] In addition, for a detailed description of steps 801 - 804 , reference may be made to the description of the aforementioned embodiment.
[0191] In summary, in the key exchange method provided by the embodiment of the present disclosure, the first device and the second device can exchange their public keys through the server. Then, when the first device communicates with the second device, encrypted communication can be performed based on its own private key and the other party's public key, thereby ensuring the security of communication. Moreover, the method disclosed in the present disclosure implements a "one machine, one secret" mechanism, and exchanges public keys through the server instead of exchanging private keys, which can further ensure the security of communication. At the same time, the method disclosed in the present disclosure can also realize the exchange of public keys between the first device and the second device at a long distance, with low applicability limitations and high flexibility. In addition, the stability of the method disclosed in the present disclosure is also high, which improves the user experience. At the same time, it can also realize the exchange of public keys between cross-platform and cross-brand devices, expand the scope of application, and no longer require docking between different equipment manufacturers, reducing the complexity of operation.
[0192] FIG9 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is executed by a server. As shown in FIG9 , the key exchange method may include the following steps:
[0193] Step 901: Receive relevant information of a third device sent by a first device.
[0194] Optionally, the third device may be: a device that needs to be authorized by the first device to communicate with the second device;
[0195] Step 902: Generate a fifth key pair.
[0196] Optionally, the fifth key pair may include a fifth public key and a fifth private key;
[0197] Step 903: Send the fifth public key to the first device;
[0198] Step 904: Receive the fourth public key certificate sent by the first device.
[0199] Optionally, the fourth public key certificate includes a fifth public key, and the fourth public key certificate is signed by the first private key in the first key pair.
[0200] For a detailed description of steps 901-904, please refer to the above embodiment description.
[0201] In summary, in the key exchange method provided by the embodiment of the present disclosure, the first device will authorize the third device to communicate with the second device by sending relevant information of the third device to the server. That is, the present disclosure provides a "secure channel sharing method" for a device that has established a secure channel to share the secure channel with other devices that have not established a secure channel, thereby improving the flexibility of secure communication. In addition, in the method of the present disclosure, the first device will generate a fourth public key certificate, and the server will generate a fifth public key certificate. By sending the fourth public key certificate and the fifth public key certificate to the second device, the sixth public key of the third device is transmitted to the second device. By sending the first public key certificate to the third device, the second public key of the second device is transmitted to the third device, thereby realizing the public key exchange between the third device and the second device, and ensuring secure communication between the second device and the third device.
[0202] FIG10 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is executed by a server. As shown in FIG10 , the key exchange method may include the following steps:
[0203] Step 1001: Send a key request message to a third device;
[0204] Step 1002: Receive a sixth public key sent by a third device.
[0205] Optionally, the sixth public key belongs to a sixth key pair, the sixth key pair also includes a sixth private key, and the sixth key pair is generated by the third device;
[0206] Step 1003: Use the fifth private key to sign the sixth public key to obtain a fifth public key certificate;
[0207] For the relevant introduction of the fifth public key certificate, please refer to the description of the above embodiment.
[0208] Optionally, in some embodiments, the method for the server to generate the fifth public key certificate may include: signing the sixth public key using the fifth private key to obtain a fifth signature, and constructing a fifth public key certificate based on the fifth signature and the sixth public key.
[0209] Step 1004: Send at least one of the first public key certificate, the fourth public key certificate, and the fifth public key certificate to the third device and / or the second device.
[0210] Optionally, in some embodiments, in response to the server being able to communicate with the second device (i.e., the second device is online), the server may send a fourth public key certificate and a fifth public key certificate to the second device, and send at least one of the first public key certificate, the fourth public key certificate, and the fifth public key certificate to the third device (such as sending the first public key certificate to the first device, or sending the first public key certificate, the fourth public key certificate, and the fifth public key certificate to the first device); thereby, the second device can obtain the sixth public key of the third device by verifying the fourth public key certificate and the fifth public key certificate, and the third device can obtain the second public key of the second device by verifying the first public key certificate, thereby realizing the exchange of the third device and the second device's own public keys, so that the third device and the second device can subsequently communicate securely based on their own private keys and each other's public keys.
[0211] Optionally, in other embodiments, in response to the server being unable to communicate with the second device (i.e., the second device is offline), the server may send the first public key certificate, the fourth public key certificate, and the fifth public key certificate to the third device, and the third device may subsequently forward the fourth public key certificate and the fifth public key certificate to the second device, thereby also enabling the exchange of the third device's own public keys with the second device, so that the third device and the second device may subsequently communicate securely based on their own private keys and each other's public keys.
[0212] For a detailed description of steps 1001 - 1004 , please refer to the above embodiment description.
[0213] To sum up, in the key exchange method provided by the embodiment of the present disclosure, the server will transmit the sixth public key of the third device to the second device by sending the fourth public key certificate and the fifth public key certificate to the second device, and transmit the second public key of the second device to the third device by sending the first public key certificate to the third device, thereby realizing the public key exchange between the third device and the second device and ensuring secure communication between the second device and the third device.
[0214] FIG11 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is performed by a second device. As shown in FIG11 , the key exchange method may include the following steps:
[0215] Step 1101: Generate a second key pair.
[0216] Optionally, the second key pair may include a second public key and a second private key;
[0217] Step 1102: Send the second public key to the server;
[0218] Step 1103: Receive the second public key certificate and the third public key certificate.
[0219] Optionally, the second public key certificate includes the fourth public key in a fourth key pair, the fourth key pair also includes a fourth private key, and the fourth key pair is generated by the server; the third public key certificate includes the first public key in the first key pair, the first key pair is generated by a first device, the first device is a device that needs to communicate with the second device, and the third public key certificate is obtained by signing the fourth private key.
[0220] Optionally, in some embodiments, the second public key certificate and the third public key certificate may be sent by the server and / or the first device to the second device.
[0221] In addition, for a detailed description of steps 1101 - 1103 , reference can be made to the above embodiment description.
[0222] In summary, in the key exchange method provided by the embodiment of the present disclosure, the first device and the second device can exchange their public keys through the server. Then, when the first device communicates with the second device, encrypted communication can be performed based on its own private key and the other party's public key, thereby ensuring the security of communication. Moreover, the method disclosed in the present disclosure implements a "one machine, one secret" mechanism, and exchanges public keys through the server instead of exchanging private keys, which can further ensure the security of communication. At the same time, the method disclosed in the present disclosure can also realize the exchange of public keys between the first device and the second device at a long distance, with low applicability limitations and high flexibility. In addition, the stability of the method disclosed in the present disclosure is also high, which improves the user experience. At the same time, it can also realize the exchange of public keys between cross-platform and cross-brand devices, expand the scope of application, and no longer require docking between different equipment manufacturers, reducing the complexity of operation.
[0223] FIG12 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is performed by a second device. As shown in FIG12 , the key exchange method may include the following steps:
[0224] Step 1201: Verify the second public key certificate and the third public key certificate;
[0225] Optionally, the first public key certificate is signed by the third private key in the third key pair;
[0226] The second public key certificate is obtained by signing the third private key in the third key pair;
[0227] The third key pair further includes a third public key, the third key pair is generated by the server, and the third public key in the third key pair is pre-configured to the first device and the second device;
[0228] The verifying the second public key certificate and the third public key certificate includes:
[0229] verifying the second public key certificate based on the third public key to obtain a fourth public key;
[0230] The third public key certificate is verified based on the fourth public key.
[0231] For a detailed description of step 1201 , please refer to the above embodiment description.
[0232] Step 1202: In response to successful verification of the second public key certificate and the third public key certificate, communicate with the first device based on the second private key, the second public key, and at least one of the first public key included in the third public key certificate.
[0233] Optionally, the method for the second device to communicate with the first device based on at least one of the second private key, the second public key, and the first public key included in the third public key certificate may include: when the second device wants to send information to the first device, the second device may first use the second private key generated by the second device itself to sign the information to be sent, and then use the first public key generated by the first device itself to encrypt the information and send it to the first device. Furthermore, after the first device receives the information sent by the second device, it may use the second public key generated by the second device itself obtained from the server to verify the signature of the received information, and use the first private key generated by the first device itself to decrypt the information, thereby achieving key-based secure communication between the first and second devices.
[0234] In addition, for a detailed description of steps 1201 - 1202 , reference can be made to the above embodiment description.
[0235] It should be noted that, in other embodiments, after the second device verifies the second public key certificate and the third public key certificate, the second device may not communicate with the first device based on the second private key, the second public key, and at least one of the first public keys included in the third public key certificate, but may negotiate with the first device through a key (such as based on the Diffie-Hellman algorithm) to generate a temporary symmetric key, and then communicate with the first device based on the temporary symmetric key, thereby reducing the complexity of encrypted communication.
[0236] To sum up, in the key exchange method provided by the embodiment of the present disclosure, after receiving the second public key certificate and the third public key certificate, the second device will first verify the second public key certificate and the third public key certificate. When the second public key certificate and the third public key certificate are verified, they will communicate with the first device based on the second private key, the second public key, and at least one of the first public keys included in the third public key certificate, thereby ensuring the communication security between the first device and the second device.
[0237] FIG13 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is performed by a second device. As shown in FIG13 , the key exchange method may include the following steps:
[0238] Step 1301: Receive the fourth public key certificate and the fifth public key certificate.
[0239] Optionally, the fourth public key certificate includes a fifth public key, the fifth public key belongs to a fifth key pair, the fifth key pair also includes a fifth private key, the fifth key pair is generated by the server, and the fourth public key certificate is signed by the first private key in the first key pair; the fifth public key certificate includes a sixth public key, the sixth public key belongs to a sixth key pair, the sixth key pair also includes a sixth private key, the sixth key pair is generated by a third device, the third device is a device that needs to be authorized by the first device to communicate with the second device; the fifth public key certificate is signed by the fifth private key;
[0240] Optionally, the fourth public key certificate and the fifth public key certificate may be sent by the server and / or the third device to the second device.
[0241] For detailed description of the fourth public key certificate and the fifth public key certificate, reference may be made to the above embodiment.
[0242] Step 1302: Verify the fourth public key certificate and the fifth public key certificate;
[0243] Optionally, as can be seen from the foregoing embodiments, the fourth public key certificate includes a fourth signature and a fifth public key, the fourth signature being obtained by signing with the first private key, and the fifth public key certificate includes a fifth signature and a sixth public key, the fifth signature being obtained by signing with the fifth private key. Prior to obtaining the fourth and fifth public key certificates, the second device had already exchanged their respective public keys with the first device, meaning that the second device already knew the first public key of the first device. Based on this, the method for the server to verify the fourth and fifth public key certificates in step 1302 may include:
[0244] Step A: Verifying the fourth public key certificate based on the first public key to obtain the fifth public key;
[0245] Optionally, the first device can decrypt the fourth signature in the fourth public key certificate based on the first public key to obtain a decryption result, and then compare the decryption result with the fifth public key of the fourth public key certificate to see if they are consistent. When they are consistent, it is determined that the fourth public key certificate is generated by the first device, which means that its source is credible. Therefore, the fourth public key certificate (such as the fifth public key in the fourth public key certificate) is considered to be credible, and the fourth public key certificate verification is determined to be successful. When they are inconsistent, it is determined that the fourth public key certificate is not generated by the first device, which means that its source is untrustworthy. Therefore, the fourth public key certificate (such as the fifth public key in the fourth public key certificate) is considered to be untrustworthy. At this time, it is determined that the fourth public key certificate verification has failed.
[0246] Step B: Verify the fifth public key certificate based on the fifth public key.
[0247] Optionally, the first device can decrypt the fifth signature in the fifth public key certificate based on the fifth public key to obtain a decryption result, and then compare the decryption result with the sixth public key of the fifth public key certificate to see if they are consistent. When they are consistent, it is determined that the fifth public key certificate is generated by the server, which means that its source is credible, and thus the fifth public key certificate (such as the sixth public key in the fifth public key certificate) is credible, and the fifth public key certificate verification is determined to be successful. When they are inconsistent, it is determined that the fifth public key certificate is not generated by the server, which means that its source is untrustworthy, and thus the fifth public key certificate (such as the sixth public key in the fifth public key certificate) is untrustworthy, and now it is determined that the fifth public key certificate verification has failed.
[0248] Step 1303: In response to successful verification of the fourth public key certificate and the fifth public key certificate, communicate with the third device based on at least one of the second private key, the second public key, and the sixth public key included in the fifth public key certificate.
[0249] Optionally, the method for the second device to communicate with the third device based on at least one of the second private key, the second public key, and the sixth public key included in the fifth public key certificate may include: when the second device wants to send information to the third device, the second device may first use the second private key generated by the second device itself to sign the information to be sent, and then use the obtained sixth public key generated by the third device itself to encrypt the information before sending it to the third device. Furthermore, after receiving the information sent by the second device, the third device may use the second public key generated by the second device itself obtained from the server to verify the signature of the received information, and use the sixth private key generated by the third device itself to decrypt the information, thereby achieving key-based secure communication between the third device and the second device.
[0250] It should be noted that, in other embodiments, after the second device verifies the fourth public key certificate and the fifth public key certificate, the second device may not communicate with the third device based on the second private key, the second public key, and at least one of the sixth public keys included in the fifth public key certificate, but may negotiate with the third device through a key (such as based on the Diffie-Hellman algorithm) to generate a temporary symmetric key, and then communicate with the third device based on the temporary symmetric key, thereby reducing the complexity of encrypted communication.
[0251] To sum up, in the key exchange method provided by the embodiment of the present disclosure, after receiving the fourth public key certificate and the fifth public key certificate, the second device will first verify the fourth public key certificate and the fifth public key certificate. When the fourth public key certificate and the fifth public key certificate are verified, they will communicate with the third device based on the second private key, the second public key, and at least one of the sixth public keys included in the fifth public key certificate, thereby ensuring the communication security between the third device and the second device.
[0252] FIG14 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is performed by a third device. As shown in FIG14 , the key exchange method may include the following steps:
[0253] Step 1401: Receive a key request message sent by a server;
[0254] Step 1402: Generate a sixth key pair.
[0255] Optionally, the sixth key pair includes a sixth public key and a sixth private key;
[0256] Optionally, the third device may use a DKF application programming interface (API) to generate the sixth key pair.
[0257] Step 1403: Send the sixth public key to the server;
[0258] Step 1404: Receive the first public key certificate sent by the server.
[0259] Optionally, the first public key certificate includes the second public key in the second key pair; the second key pair is generated by the second device, the second key pair also includes a second private key, and the second device is a device that needs to communicate with the third device.
[0260] For a detailed description of steps 1401 - 1404 , please refer to the description of the aforementioned embodiment.
[0261] In summary, in the key exchange method provided by the embodiment of the present disclosure, the third device and the second device can exchange their public keys through the server. Then, when the third device communicates with the second device, it can perform encrypted communication based on its own private key and the other party's public key, thereby ensuring the security of communication. Moreover, the method disclosed in the present disclosure implements a "one machine, one secret" mechanism, and exchanges public keys through the server instead of exchanging private keys, which can further ensure the security of communication. At the same time, the method disclosed in the present disclosure can also realize the exchange of public keys between the third device and the second device at a long distance, with low applicability limitations and high flexibility. In addition, the stability of the method disclosed in the present disclosure is also high, which improves the user experience. At the same time, it can also realize the exchange of public keys between cross-platform and cross-brand devices, expand the scope of application, and no longer require docking between different equipment manufacturers, reducing the complexity of operation.
[0262] FIG15 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is performed by a third device. As shown in FIG15 , the key exchange method may include the following steps:
[0263] Step 1501: Verify the first public key certificate;
[0264] Optionally, the first public key certificate is signed by a third private key in a third key pair, the third key pair also includes a third public key, the third key pair is generated by the server, and the third public key in the third key pair is pre-configured to the third device and the second device;
[0265] The verifying the first public key certificate includes:
[0266] The first public key certificate is verified based on the third public key.
[0267] Step 1502: In response to successful verification of the first public key certificate, communicate with the second device based on at least one of the sixth public key, the sixth private key, and the second public key included in the first public key certificate.
[0268] Optionally, the method for communicating with the second device using at least one of the third device's sixth public key, sixth private key, and the second public key included in the first public key certificate may include: when the third device wants to send information to the second device, the third device may first use the sixth private key generated by the third device itself to sign the information to be sent, and then use the obtained second public key generated by the second device itself to encrypt the information before sending it to the second device. Furthermore, after the second device receives the information sent by the third device, it may use the sixth public key generated by the third device itself obtained from the server to verify the signature of the received information, and use the second private key generated by the second device itself to decrypt the information, thereby achieving key-based secure communication between the third device and the second device.
[0269] It should be noted that in other embodiments, after the third device verifies the first public key certificate, the first device may not communicate with the second device based on the sixth public key, the sixth private key, and at least one of the second public keys included in the first public key certificate, but may negotiate with the second device through a key (such as based on the Diffie-Hellman algorithm) to generate a temporary symmetric key, and then communicate with the second device based on the temporary symmetric key, thereby reducing the complexity of encrypted communication.
[0270] For a detailed description of steps 1501 - 1502 , please refer to the description of the aforementioned embodiment.
[0271] To sum up, in the key exchange method provided by the embodiment of the present disclosure, after receiving the first public key certificate, the third device will first verify the first public key certificate. When the first public key certificate is verified, it will communicate with the second device based on the sixth public key, the sixth private key, and at least one of the second public keys included in the first public key certificate, thereby ensuring the communication security between the third device and the second device.
[0272] FIG16 is a flow chart of a key exchange method provided in an embodiment of the present disclosure. The method is performed by a third device. As shown in FIG16 , the key exchange method may include the following steps:
[0273] Step 1601: Receive the fourth public key certificate and the fifth public key certificate sent by the server;
[0274] Optionally, the fourth public key certificate includes a fifth public key, the fifth public key belongs to a fifth key pair, the fifth key pair also includes a fifth private key, the fifth key pair is generated by the server, and the fourth public key certificate is signed by the first private key in the first key pair; the fifth public key certificate includes a sixth public key; and the fifth public key certificate is signed by the fifth private key;
[0275] For a detailed description of step 1601 , please refer to the description of the aforementioned embodiment.
[0276] To sum up, in the key exchange method provided by the embodiment of the present disclosure, the first device will receive the fourth public key certificate and the fifth public key certificate sent by the server, wherein the fourth public key certificate and the fifth public key certificate are used to transfer the sixth public key of the third device, so that the third device can send the fourth public key certificate and the fifth public key certificate it receives to the second device to transfer the sixth public key of the third device to the second device, thereby realizing the public key exchange between the third device and the second device. Subsequently, when the third device communicates with the second device, the third device and the second device can perform encrypted communication based on their own private keys and each other's public keys, thereby ensuring the security of communication.
[0277] FIG17 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is performed by a third device. As shown in FIG17 , the key exchange method may include the following steps:
[0278] Step 1701: Verify the fourth public key certificate and the fifth public key certificate;
[0279] Optionally, the method for the third device to verify the fourth public key certificate and the fifth public key certificate may include: verifying the fourth public key certificate based on the pre-acquired first public key to obtain the fifth public key; verifying the fifth public key certificate based on the fifth public key;
[0280] For a detailed description of step 1701 , please refer to the description of the aforementioned embodiment.
[0281] To sum up, in the key exchange method provided by the embodiment of the present disclosure, after the third device receives the fourth public key certificate and the fifth public key certificate sent by the server, it can verify the fourth public key certificate and the fifth public key certificate, thereby ensuring the security and stability of certificate transmission.
[0282] FIG18 is a flow chart of a key exchange method provided by an embodiment of the present disclosure. The method is performed by a third device. As shown in FIG18 , the key exchange method may include the following steps:
[0283] Step 1801: Send a fourth public key certificate and a fifth public key certificate to a second device;
[0284] For a detailed description of step 1801 , please refer to the description of the aforementioned embodiment.
[0285] To sum up, in the key exchange method provided by the embodiment of the present disclosure, the first device will send the fourth public key certificate and the fifth public key certificate it has received to the second device to pass the sixth public key of the third device to the second device, thereby realizing the public key exchange between the third device and the second device. Subsequently, when the third device communicates with the second device, the third device and the second device can perform encrypted communication based on their own private keys and each other's public keys, ensuring the security of communication.
[0286] In addition, it should be noted that in the embodiments of the present disclosure, when the server and each device (such as the first device, the second device, and the third device) receive any of the above-mentioned public keys (such as the first public key, the second public key, etc.) and / or any of the above-mentioned public key certificates (such as the first public key certificate, the second public key certificate, etc.), they can store any public key and / or any public key certificate received. Optionally, each device can store any public key and / or any public key certificate received in its secure hardware. In addition, each device can also store its own private key in its secure hardware. At the same time, the server can also store the private key in the key pair generated by itself (such as the fourth private key in the fourth key pair, the fifth key in the fifth key pair, etc.).
[0287] Optionally, in an embodiment of the present disclosure, any of the above-mentioned methods for transmitting the public key may include: directly transmitting the public key, or transmitting a CSR, where the CSR includes the public key to be transmitted.
[0288] The following is an example introduction to the method of the present disclosure;
[0289] Optionally, in some embodiments, when the vehicle (i.e., the aforementioned second device) and the device (i.e., the aforementioned first device) open a secure channel (i.e., when exchanging their public keys), the following certificates are required:
[0290] Car company server certificate (A): The certificate corresponding to the car company server key pair (the car company server is the aforementioned server, and the car company server key pair is the aforementioned third key pair), generated by the car company server, is the root certificate of the digital key system.
[0291] The vehicle manufacturer's intermediate pairing certificate (B) (the second public key certificate mentioned above) is generated by the vehicle manufacturer's server and signed with the private key corresponding to the vehicle manufacturer's server certificate (A) (the third private key mentioned above). It is stored on the vehicle manufacturer's server.
[0292] The owner's digital key certificate (C) (the third public key certificate mentioned above) is generated by the device (mobile phone or wearable) and signed by the private key (the fourth private key) corresponding to the car manufacturer's intermediate pairing certificate (B). This certificate must be delivered to the vehicle when the key is activated.
[0293] Vehicle Public Key Certificate (D) (the first public key certificate mentioned above): A key pair is generated by the vehicle and signed by the private key corresponding to the vehicle company's server certificate (A) (the third private key mentioned above) and the public key (the second public key mentioned above). This certificate is then passed to the device when the key is activated.
[0294] Optionally, FIG19 is a schematic diagram of the connection between the various devices provided in the embodiment of the present disclosure, and FIG19 shows a standard interface and a private interface, wherein devices of the same manufacturer, devices and applications of the same manufacturer, and devices of the same type can be connected through a private interface, and devices of different manufacturers, devices and applications of different manufacturers, and devices of different types can be connected through a standard interface. For example, if the DKF in a mobile phone and the Bluetooth Low Energy (BLE) module in a vehicle belong to different manufacturers, the two are connected through a standard interface. For example, if the car company APP in a mobile phone and the vehicle server belong to the same manufacturer, the two are connected through a private interface.
[0295] FIG20 is a flow chart showing the interaction between the vehicle and the device for opening a secure channel according to an embodiment of the present disclosure. Referring to FIG20 , the following operations must be completed before opening the secure channel:
[0296] Vehicle: Pre-installed vehicle certificate, vehicle manufacturer intermediate pairing certificate, and vehicle manufacturer server certificate.
[0297] Vehicle server: pre-installed vehicle certificate, vehicle manufacturer intermediate pairing certificate and public and private keys, vehicle manufacturer server certificate and public and private keys.
[0298] The car manufacturer's server completes user identity authentication (i.e., the aforementioned "the server has completed identity authentication for the user of the first device");
[0299] The car company app (i.e., the aforementioned first application) completes a secure channel with the car company's server (i.e., the aforementioned "the first application has established a secure channel with the server");
[0300] DKF (i.e. the aforementioned first module) completes the legality verification of the car company's app (i.e. the aforementioned "the first module has completed the legality verification of the first application").
[0301] And, referring to Figure 20, the main process of opening a safe channel between the vehicle and the device is as follows:
[0302] Users choose to activate the digital key in the car manufacturer's app.
[0303] The car manufacturer's App calls the DKF interface to create a digital key (the first key pair mentioned above).
[0304] DKF uses device security hardware (such as SE or TEE) to generate a digital key pair (the aforementioned first key pair). The private key (the aforementioned first private key) is stored in the security hardware, and the public key (the aforementioned first public key) or CSR is returned to the car company App.
[0305] The car manufacturer's app sends the digital key public key or CSR to the car manufacturer's server. The car manufacturer's server uses the private key corresponding to the car manufacturer's intermediate pairing certificate (B) (that is, the fourth private key mentioned above) to issue the digital key public key certificate (C).
[0306] The car manufacturer's server sends the car manufacturer's intermediate pairing certificate (B), digital key public key certificate (C), and vehicle public key certificate (D) to the mobile phone through the car manufacturer's app, and the mobile phone stores them in the secure hardware.
[0307] If the vehicle is online, the car manufacturer's server will simultaneously send the car manufacturer's intermediate pairing certificate (B) and the digital key public key certificate (C) to the vehicle. At this point, the device and vehicle have completed the public key certificate exchange, and the key is ready for use.
[0308] If the vehicle has been offline before the user uses it, when the user uses it for the first time, the vehicle reads the car manufacturer's intermediate pairing certificate (B) and the digital key public key certificate (C) from the mobile phone, checks the legitimacy of the certificate chain, and then stores the digital key public key certificate (C). After completion, the digital key can be used.
[0309] Optionally, Figure 21 is a schematic diagram of the interaction process corresponding to the method for sharing a secure channel provided in an embodiment of the present disclosure (i.e., the method when the first device authorizes the third device to communicate with the second device). Referring to Figure 21, when sharing a secure channel, the following certificates are required:
[0310] Car manufacturer server certificate (A): Generated by the car manufacturer's server, it is the root certificate of the digital key system.
[0311] The vehicle manufacturer's intermediate shared certificate (E) (the fourth public key certificate mentioned above) is generated by the vehicle manufacturer's server and signed with the private key corresponding to the vehicle owner's digital key certificate (C) (the first public key mentioned above). This is a one-time certificate used only for the current sharing session.
[0312] Shared Digital Key Certificate (F) (the aforementioned fifth public key certificate): A key pair (the aforementioned sixth key pair) is generated by the device (mobile phone or wearable) and signed by the private key (the fifth private key) corresponding to the car company's intermediate sharing certificate (E). When sharing keys, they must be delivered to the vehicle.
[0313] Vehicle Public Key Certificate (D): A key pair is generated by the vehicle and signed with the public key corresponding to the private key of the vehicle manufacturer's server certificate (A). This certificate is then passed to the device when the key is shared.
[0314] And, referring to Figure 20, the main process of sharing a secure channel on the device side is as follows:
[0315] The car owner selects the object to be shared (i.e., the aforementioned third device) on the car manufacturer app, sets the validity period (i.e., the aforementioned communication validity period), permissions (i.e., the aforementioned control permissions), etc. The car manufacturer app sends the information (i.e., the relevant information of the aforementioned third device) to the car manufacturer server.
[0316] The car company server generates a key pair (i.e. the aforementioned fifth key pair) for the car company's intermediate sharing book (E), and the private key (i.e. the aforementioned fifth private key) is stored on the car company server. The public key (i.e. the aforementioned fifth public key) or CSR is sent to the car owner's mobile phone (i.e. the aforementioned first device) through the car company App.
[0317] The car owner's mobile phone uses the private key corresponding to the car owner's digital key certificate (C) (that is, the first private key mentioned above) to issue the car company's intermediate sharing book (E), and sends it to the car company's server through the car company's app.
[0318] The car company server sends the sharing (i.e. the aforementioned key request message) and pushes it to the friend's car company app. The car company app uses the DKF API of the friend's mobile phone (i.e. the aforementioned third device) to generate the friend's digital key key pair (i.e. the aforementioned sixth key pair). The private key (i.e. the aforementioned sixth private key) is stored in the security hardware of the friend's mobile phone. The public key (i.e. the aforementioned sixth public key) or CSR is sent to the car company server and signed by the private key corresponding to the car company's intermediate shared certificate (E) to generate a shared digital key certificate (F).
[0319] The car company's server sends the vehicle public key certificate (D), shared digital key certificate (F) and the car company's intermediate shared certificate (E) to the friend's mobile phone through the car company's app and stores them in the secure hardware.
[0320] If the vehicle is online, the car manufacturer's server will send the shared digital key certificate (F) and the car manufacturer's intermediate shared certificate (E) to the vehicle. At this point, the device and the vehicle have completed the public key certificate exchange, and the key can be used.
[0321] If the vehicle has been offline before the user uses it, the first time the user uses it, the vehicle reads the shared digital key certificate (F) and the car manufacturer's intermediate shared certificate (E) from the mobile phone, and uses the owner's digital key certificate (C) to verify the car manufacturer's intermediate shared certificate (E). The car manufacturer's intermediate shared certificate (E) verifies the shared digital key certificate (F). After verification is complete, the shared digital key certificate (F) is stored. At this point, the device and vehicle have completed the public key certificate exchange, and the key is ready for use.
[0322] FIG22 is a schematic diagram of the structure of a communication device provided by an embodiment of the present disclosure. As shown in FIG22 , the device may include:
[0323] A processing module, configured to generate a first key pair, the first key pair comprising a first public key and a first private key;
[0324] A transceiver module, configured to send the first public key to the server;
[0325] The transceiver module is also used to receive a first public key certificate sent by the server, where the first public key certificate includes the second public key in the second key pair; the second key pair is generated by a second device, where the second key pair also includes a second private key, and the second device is a device that needs to communicate with the first device.
[0326] In summary, in the communication device provided by the embodiment of the present disclosure, the first device and the second device can exchange their public keys through the server. Then, when the first device communicates with the second device, encrypted communication can be performed based on its own private key and the other party's public key, thereby ensuring the security of communication. Moreover, the method disclosed in the present disclosure implements a "one machine, one secret" mechanism, and exchanges public keys through the server instead of exchanging private keys, which can further ensure the security of communication. At the same time, the method disclosed in the present disclosure can also realize the exchange of public keys between the first device and the second device at a long distance, with low applicability limitations and high flexibility. In addition, the stability of the method disclosed in the present disclosure is also high, which improves the user experience. At the same time, it can also realize the exchange of public keys between cross-platform and cross-brand devices, expand the scope of application, and no longer require docking between different equipment manufacturers, reducing the complexity of operation.
[0327] Optionally, in one embodiment of the present disclosure, the transceiver module is further configured to:
[0328] A first certificate signing request (CSR) is sent to the server, where the first CSR includes the first public key.
[0329] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0330] verifying the first public key certificate;
[0331] In response to the first public key certificate being verified successfully, communicating with the second device based on at least one of the first public key, the first private key, and the second public key included in the first public key certificate.
[0332] Optionally, in one embodiment of the present disclosure, the first public key certificate is obtained by signing a third private key in a third key pair, the third key pair also includes a third public key, the third key pair is generated by the server, and the third public key in the third key pair is pre-configured in the first device and the second device;
[0333] The processing module is further configured to:
[0334] The first public key certificate is verified based on the third public key.
[0335] Optionally, in one embodiment of the present disclosure, the transceiver module is further configured to:
[0336] Receive a second public key certificate and a third public key certificate sent by the server; wherein, the second public key certificate includes the fourth public key in a fourth key pair, the fourth key pair also includes a fourth private key, the fourth key pair is generated by the server, and the second public key certificate is signed by the third private key in the third key pair; the third public key certificate includes the first public key, and the third public key certificate is signed by the fourth private key.
[0337] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0338] verifying the second public key certificate based on the third public key to obtain the fourth public key;
[0339] The third public key certificate is verified based on the fourth public key.
[0340] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0341] The second public key certificate and the third public key certificate are sent to the second device.
[0342] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0343] Determining relevant information of a third device, where the third device is a device that needs to be authorized by the first device to communicate with the second device;
[0344] Sending relevant information of the third device to the server;
[0345] receiving a fifth public key sent by the server, where the fifth public key belongs to a fifth key pair, the fifth key pair also includes a fifth private key, and the fifth key pair is generated by the server;
[0346] Signing the fifth public key using the first private key to obtain a fourth public key certificate;
[0347] Send the fourth public key certificate to the server.
[0348] FIG23 is a schematic diagram of the structure of a communication device provided by an embodiment of the present disclosure. As shown in FIG23 , the device may include:
[0349] a transceiver module, configured to receive a first public key sent by a first device; the first public key belongs to a first key pair, the first key pair also includes a first private key, and the first key pair is generated by the first device;
[0350] The transceiver module is further configured to receive a second public key sent by a second device; the second public key belongs to a second key pair, the second key pair also includes a second private key, the second key pair is generated by the second device, and the second device is a device that needs to communicate with the first device;
[0351] a processing module, configured to generate at least one of a first public key certificate, a second public key certificate, and a third public key certificate; the first public key certificate including the second public key of the second key pair; the second public key certificate including the fourth public key of the fourth key pair, the fourth key pair also including a fourth private key; the third public key certificate including the first public key, and the third public key certificate being signed by the fourth private key;
[0352] The transceiver module is further configured to send at least one of a first public key certificate, a second public key certificate, and a third public key certificate to the first device and / or the second device.
[0353] In summary, in the communication device provided by the embodiment of the present disclosure, the first device and the second device can exchange their public keys through the server. Then, when the first device communicates with the second device, encrypted communication can be performed based on its own private key and the other party's public key, thereby ensuring the security of communication. Moreover, the method disclosed in the present disclosure implements a "one machine, one secret" mechanism, and exchanges public keys through the server instead of exchanging private keys, which can further ensure the security of communication. At the same time, the method disclosed in the present disclosure can also realize the exchange of public keys between the first device and the second device at a long distance, with low applicability limitations and high flexibility. In addition, the stability of the method disclosed in the present disclosure is also high, which improves the user experience. At the same time, it can also realize the exchange of public keys between cross-platform and cross-brand devices, expand the scope of application, and no longer require docking between different equipment manufacturers, reducing the complexity of operation.
[0354] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0355] A third key pair and the fourth key pair are generated; wherein the third public key in the third key pair is pre-configured to the first device and the second device.
[0356] Optionally, in an embodiment of the present disclosure, the first public key certificate is obtained by signing with the third private key in the third key pair;
[0357] The second public key certificate is obtained by signing the third private key in the third key pair.
[0358] Optionally, in one embodiment of the present disclosure, the transceiver module is further configured to:
[0359] In response to the server being able to communicate with the second device, sending a second public key certificate and a third public key certificate to the second device, and sending a first public key certificate, a second public key certificate, and a third public key certificate to the first device;
[0360] In response to the server being unable to communicate with the second device, a first public key certificate, a second public key certificate, and a third public key certificate are sent to the first device.
[0361] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0362] receiving relevant information of a third device sent by the first device, where the third device is a device that needs to be authorized by the first device to communicate with the second device;
[0363] generating a fifth key pair, the fifth key pair comprising a fifth public key and a fifth private key;
[0364] Sending the fifth public key to the first device;
[0365] Receive a fourth public key certificate sent by the first device, where the fourth public key certificate includes the fifth public key, and the fourth public key certificate is signed by the first private key in the first key pair.
[0366] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0367] Sending a key request message to the third device;
[0368] receiving a sixth public key sent by the third device, where the sixth public key belongs to a sixth key pair, the sixth key pair also includes a sixth private key, and the sixth key pair is generated by the third device;
[0369] Signing the sixth public key using the fifth private key to obtain a fifth public key certificate;
[0370] At least one of the first public key certificate, the fourth public key certificate, and the fifth public key certificate is sent to the third device and / or the second device.
[0371] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0372] In response to the server being able to communicate with the second device, sending a fourth public key certificate and a fifth public key certificate to the second device, and sending the first public key certificate, the fourth public key certificate, and the fifth public key certificate to the third device;
[0373] In response to the server being unable to communicate with the second device, a first public key certificate, a fourth public key certificate, and a fifth public key certificate are sent to the third device.
[0374] FIG24 is a schematic diagram of the structure of a communication device provided by an embodiment of the present disclosure. As shown in FIG24 , the device may include:
[0375] a processing module, configured to generate a second key pair, the second key pair comprising a second public key and a second private key;
[0376] A transceiver module, configured to send the second public key to the server;
[0377] The transceiver module is also used to receive a second public key certificate and a third public key certificate; the second public key certificate includes the fourth public key in a fourth key pair, the fourth key pair also includes a fourth private key, and the fourth key pair is generated by the server; the third public key certificate includes the first public key in the first key pair, the first key pair is generated by a first device, the first device is a device that needs to communicate with the second device, and the third public key certificate is obtained by signing the fourth private key.
[0378] In summary, in the communication device provided by the embodiment of the present disclosure, the first device and the second device can exchange their public keys through the server. Then, when the first device communicates with the second device, encrypted communication can be performed based on its own private key and the other party's public key, thereby ensuring the security of communication. Moreover, the method disclosed in the present disclosure implements a "one machine, one secret" mechanism, and exchanges public keys through the server instead of exchanging private keys, which can further ensure the security of communication. At the same time, the method disclosed in the present disclosure can also realize the exchange of public keys between the first device and the second device at a long distance, with low applicability limitations and high flexibility. In addition, the stability of the method disclosed in the present disclosure is also high, which improves the user experience. At the same time, it can also realize the exchange of public keys between cross-platform and cross-brand devices, expand the scope of application, and no longer require docking between different equipment manufacturers, reducing the complexity of operation.
[0379] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0380] verifying the second public key certificate and the third public key certificate;
[0381] In response to verification of the second public key certificate and the third public key certificate being successful, communication is performed with the first device based on at least one of the second private key, the second public key, and the first public key included in the third public key certificate.
[0382] Optionally, in an embodiment of the present disclosure, the second public key certificate is obtained by signing the third private key in the third key pair;
[0383] The third key pair further includes a third public key, the third key pair is generated by the server, and the third public key in the third key pair is pre-configured to the first device and the second device;
[0384] The processing module is further configured to:
[0385] verifying the second public key certificate based on the third public key to obtain a fourth public key;
[0386] The third public key certificate is verified based on the fourth public key.
[0387] Optionally, in one embodiment of the present disclosure, the transceiver module is further configured to:
[0388] Receive the second public key certificate and the third public key certificate sent by the first device and / or the server.
[0389] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0390] receiving a fourth public key certificate and a fifth public key certificate, wherein the fourth public key certificate includes a fifth public key, the fifth public key belongs to a fifth key pair, the fifth key pair also includes a fifth private key, the fifth key pair is generated by the server, and the fourth public key certificate is signed by the first private key in the first key pair; the fifth public key certificate includes a sixth public key, the sixth public key belongs to a sixth key pair, the sixth key pair also includes a sixth private key, the sixth key pair is generated by a third device, the third device is a device that needs to be authorized by the first device to communicate with the second device; and the fifth public key certificate is signed by the fifth private key;
[0391] Verifying the fourth public key certificate and the fifth public key certificate;
[0392] In response to successful verification of the fourth public key certificate and the fifth public key certificate, communication is performed with the third device based on at least one of the second private key, the second public key, and the sixth public key included in the fifth public key certificate.
[0393] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0394] verifying the fourth public key certificate based on the first public key to obtain the fifth public key;
[0395] The fifth public key certificate is verified based on the fifth public key.
[0396] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0397] Receive a fourth public key certificate and a fifth public key certificate sent by a third device and / or server.
[0398] FIG25 is a schematic diagram of the structure of a communication device provided by an embodiment of the present disclosure. As shown in FIG25 , the device may include:
[0399] A transceiver module is used to receive a key request message sent by a server;
[0400] a processing module, configured to generate a sixth key pair, the sixth key pair comprising a sixth public key and a sixth private key;
[0401] The transceiver module is further configured to send the sixth public key to the server;
[0402] The transceiver module is also used to receive a first public key certificate sent by the server, where the first public key certificate includes the second public key in the second key pair; the second key pair is generated by a second device, where the second key pair also includes a second private key, and the second device is a device that needs to communicate with the third device.
[0403] In summary, in the communication device provided by the embodiment of the present disclosure, the third device and the second device can exchange their public keys through the server. Then, when the third device communicates with the second device, it can perform encrypted communication based on its own private key and the other party's public key, thereby ensuring the security of communication. Moreover, the method disclosed in the present disclosure implements a "one machine, one secret" mechanism, and exchanges public keys through the server instead of exchanging private keys, which can further ensure the security of communication. At the same time, the method disclosed in the present disclosure can also realize the exchange of public keys between the third device and the second device at a long distance, with low applicability limitations and high flexibility. In addition, the stability of the method disclosed in the present disclosure is also high, which improves the user experience. At the same time, it can also realize the exchange of public keys between cross-platform and cross-brand devices, expand the scope of application, and no longer require docking between different equipment manufacturers, reducing the complexity of operation.
[0404] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0405] verifying the first public key certificate;
[0406] In response to the first public key certificate being verified successfully, communication is performed with the second device based on at least one of the sixth public key, the sixth private key, and the second public key included in the first public key certificate.
[0407] Optionally, in one embodiment of the present disclosure, the first public key certificate is obtained by signing a third private key in a third key pair, the third key pair also includes a third public key, the third key pair is generated by the server, and the third public key in the third key pair is pre-configured to the third device and the second device;
[0408] The processing module is further configured to:
[0409] The first public key certificate is verified based on the third public key.
[0410] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0411] Receive the fourth public key certificate and fifth public key certificate sent by the server, where the fourth public key certificate includes the fifth public key, the fifth public key belongs to the fifth key pair, the fifth key pair also includes the fifth private key, the fifth key pair is generated by the server, and the fourth public key certificate is signed by the first private key in the first key pair; the fifth public key certificate includes the sixth public key; and the fifth public key certificate is signed by the fifth private key.
[0412] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0413] Verifying the fourth public key certificate based on the pre-acquired first public key to obtain the fifth public key;
[0414] The fifth public key certificate is verified based on the fifth public key.
[0415] Optionally, in one embodiment of the present disclosure, the apparatus is further configured to:
[0416] The fourth public key certificate and the fifth public key certificate are sent to the second device.
[0417] Please refer to Figure 26, which is a schematic diagram of the structure of a communication device 2600 provided in an embodiment of the present disclosure. Communication device 2600 can be a base station or a terminal, or a chip, chip system, or processor that supports a base station in implementing the above-mentioned method. It can also be a chip, chip system, or processor that supports a terminal in implementing the above-mentioned method. This device can be used to implement the method described in the above-mentioned method embodiment. For details, please refer to the description of the above-mentioned method embodiment.
[0418] The communication device 2600 may include one or more processors 2601. The processor 2601 may be a general-purpose processor or a dedicated processor. For example, it may be a baseband processor or a central processing unit. The baseband processor may be used to process communication protocols and communication data, and the central processing unit may be used to control the communication device (e.g., a base station, a baseband chip, a terminal, a terminal chip, a DU or a CU, etc.), execute computer programs, and process computer program data.
[0419] Optionally, the communication device 2600 may further include one or more memories 2602, on which a computer program 2604 may be stored. The processor 2601 executes the computer program 2604 to cause the communication device 2600 to perform the method described in the above method embodiment. Optionally, the memory 2602 may also store data. The communication device 2600 and the memory 2602 may be provided separately or integrated together.
[0420] Optionally, the communication device 2600 may further include a transceiver 2605 and an antenna 2606. The transceiver 2605 may be referred to as a transceiver unit, a transceiver, or a transceiver circuit, etc., and is used to implement transceiver functions. The transceiver 2605 may include a receiver and a transmitter. The receiver may be referred to as a receiver or a receiving circuit, etc., and is used to implement the receiving function; the transmitter may be referred to as a transmitter or a transmitting circuit, etc., and is used to implement the transmitting function.
[0421] Optionally, the communication device 2600 may further include one or more interface circuits 2607. The interface circuit 2607 is configured to receive code instructions and transmit the instructions to the processor 2601. The processor 2601 executes the code instructions to enable the communication device 2600 to perform the method described in the above method embodiment.
[0422] In one implementation, processor 2601 may include a transceiver for implementing receiving and transmitting functions. For example, the transceiver may be a transceiver circuit, an interface, or an interface circuit. The transceiver circuit, interface, or interface circuit for implementing the receiving and transmitting functions may be separate or integrated. The transceiver circuit, interface, or interface circuit may be used for reading and writing code / data, or may be used for transmitting or delivering signals.
[0423] In one implementation, processor 2601 may store a computer program 2603. Computer program 2603, when executed on processor 2601, enables communication device 2600 to perform the method described in the above method embodiment. Computer program 2603 may be embedded in processor 2601, in which case processor 2601 may be implemented by hardware.
[0424] In one implementation, the communication device 2600 may include a circuit that can implement the functions of sending, receiving, or communicating in the aforementioned method embodiments. The processor and transceiver described in the present disclosure can be implemented on an integrated circuit (IC), an analog IC, a radio frequency integrated circuit RFIC, a mixed signal IC, an application specific integrated circuit (ASIC), a printed circuit board (PCB), an electronic device, etc. The processor and transceiver can also be manufactured using various IC process technologies, such as complementary metal oxide semiconductor (CMOS), N-type metal oxide semiconductor (nMetal-oxide-semiconductor, NMOS), P-type metal oxide semiconductor (positive channel metal oxide semiconductor, PMOS), bipolar junction transistor (bipolar junction transistor, BJT), bipolar CMOS (BiCMOS), silicon germanium (SiGe), gallium arsenide (GaAs), etc.
[0425] The communication device described in the above embodiments may be a base station or a terminal, but the scope of the communication device described in this disclosure is not limited thereto, and the structure of the communication device may not be limited to FIG. 26 . The communication device may be an independent device or may be part of a larger device. For example, the communication device may be:
[0426] (1) An independent integrated circuit (IC), or chip, or chip system or subsystem;
[0427] (2) a collection of one or more ICs, optionally including a storage component for storing data and computer programs;
[0428] (3) ASIC, such as modem;
[0429] (4) Modules that can be embedded in other devices;
[0430] (5) Receivers, terminals, smart terminals, cellular phones, wireless devices, handheld devices, mobile units, vehicle-mounted devices, base stations, cloud devices, artificial intelligence devices, etc.;
[0431] (6)Others, etc.
[0432] If the communication device can be a chip or a chip system, please refer to the structural diagram of the chip shown in Figure 27. The chip shown in Figure 27 includes a processor 2701 and an interface 2702. The number of processors 2701 can be one or more, and the number of interfaces 2702 can be multiple.
[0433] Optionally, the chip further includes a memory 2703, which is used to store necessary computer programs and data.
[0434] Those skilled in the art will also appreciate that the various illustrative logical blocks and steps listed in the embodiments of the present disclosure may be implemented by electronic hardware, computer software, or a combination of both. Whether such functionality is implemented by hardware or software depends on the specific application and the design requirements of the entire system. Those skilled in the art may use various methods to implement the described functionality for each specific application, but such implementation should not be construed as exceeding the scope of protection of the embodiments of the present disclosure.
[0435] The present disclosure also provides a readable storage medium having instructions stored thereon, which implement the functions of any of the above method embodiments when executed by a computer.
[0436] The present disclosure also provides a computer program product, which implements the functions of any of the above method embodiments when executed by a computer.
[0437] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer programs. When the computer program is loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present disclosure are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer program can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer program can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a high-density digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0438] Those skilled in the art will understand that the various numerical numbers such as first and second involved in the present disclosure are only for the convenience of description and are not used to limit the scope of the embodiments of the present disclosure, and also indicate the order of precedence.
[0439] The at least one in the present disclosure can also be described as one or more, and the multiple can be two, three, four or more, which is not limited in the present disclosure. In the embodiments of the present disclosure, for a technical feature, the technical features in the technical feature are distinguished by "first", "second", "third", "A", "B", "C" and "D", and there is no order of precedence or size between the technical features described by "first", "second", "third", "A", "B", "C" and "D".
[0440] The correspondences shown in the tables of the present disclosure can be configured or predefined. The values of the information in each table are merely examples and can be configured to other values, which are not limited by the present disclosure. When configuring the correspondences between information and parameters, it is not necessarily required to configure all the correspondences shown in each table. For example, in the tables of the present disclosure, the correspondences shown in certain rows may not be configured. For another example, appropriate deformation adjustments can be made based on the above tables, such as splitting, merging, etc. The names of the parameters shown in the titles of the above tables may also adopt other names that can be understood by the communication device, and the values or representations of the parameters may also adopt other values or representations that can be understood by the communication device. When implementing the above tables, other data structures may also be used, such as arrays, queues, containers, stacks, linear lists, pointers, linked lists, trees, graphs, structures, classes, heaps, hash tables or hash tables, etc.
[0441] The predefined in the present disclosure may be understood as defined, predefined, stored, pre-stored, pre-negotiated, pre-configured, solidified, or pre-burned.
[0442] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0443] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0444] The above description is merely a specific embodiment of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this disclosure should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.
Claims
1. A key exchange method, characterized in that: The method is performed by a first device, and includes: Generate a first key pair, the first key pair comprising a first public key and a first private key; Sending the first public key to the server; A first public key certificate sent by a server is received, where the first public key certificate includes a second public key in a second key pair; the second key pair is generated by a second device, where the second key pair also includes a second private key, and the second device is a device that needs to communicate with the first device.
2. The method according to claim 1, characterized in that The sending the first public key to the server includes: A first certificate signing request (CSR) is sent to the server, where the first CSR includes the first public key.
3. The method according to claim 1 or 2, characterized in that The method further comprises: verifying the first public key certificate; In response to successful verification of the first public key certificate, communication is performed with the second device based on at least one of the first public key, the first private key, and the second public key included in the first public key certificate.
4. The method according to claim 3, characterized in that The first public key certificate is obtained by signing a third private key in a third key pair, the third key pair also includes a third public key, the third key pair is generated by the server, and the third public key in the third key pair is pre-configured to the first device and the second device; The verifying the first public key certificate comprises: The first public key certificate is verified based on the third public key.
5. The method according to claim 1 or 2, characterized in that: The method further comprises: Receive a second public key certificate and a third public key certificate sent by a server; wherein the second public key certificate includes a fourth public key in a fourth key pair, the fourth key pair also includes a fourth private key, the fourth key pair is generated by the server, and the second public key certificate is signed by the third private key in the third key pair; the third public key certificate includes the first public key, and the third public key certificate is signed by the fourth private key.
6. The method according to claim 5, characterized in that The method further comprises: Verifying the second public key certificate based on the third public key to obtain the fourth public key; The third public key certificate is verified based on the fourth public key.
7. The method according to claim 5, characterized in that The method further comprises: The second public key certificate and the third public key certificate are sent to the second device.
8. The method according to claim 1, characterized in that The method further comprises: Determine relevant information of a third device, where the third device is: a device that needs to be authorized by the first device to communicate with the second device; Sending relevant information of the third device to the server; receiving a fifth public key sent by the server, where the fifth public key belongs to a fifth key pair, the fifth key pair also includes a fifth private key, and the fifth key pair is generated by the server; Using the first private key to sign the fifth public key to obtain a fourth public key certificate; The fourth public key certificate is sent to the server.
9. A key exchange method, characterized in that: The method is executed by a server, and comprises: Receive a first public key sent by a first device; the first public key belongs to a first key pair, the first key pair also includes a first private key, and the first key pair is generated by the first device; receiving a second public key sent by a second device; the second public key belongs to a second key pair, the second key pair also includes a second private key, the second key pair is generated by the second device, and the second device is a device that needs to communicate with the first device; Generate at least one of a first public key certificate, a second public key certificate, and a third public key certificate; the first public key certificate includes the second public key in the second key pair; the second public key certificate includes the fourth public key in the fourth key pair, and the fourth key pair also includes a fourth private key; the third public key certificate includes the first public key, and the third public key certificate is obtained by signing the fourth private key; At least one of the first public key certificate, the second public key certificate, and the third public key certificate is sent to the first device and / or the second device.
10. The method according to claim 9, characterized in that The method further comprises: A third key pair and the fourth key pair are generated; wherein a third public key in the third key pair is preconfigured in the first device and the second device.
11. The method according to claim 9 or 10, characterized in that The first public key certificate is obtained by signing the third private key in the third key pair; The second public key certificate is obtained by signing with the third private key in the third key pair.
12. The method according to claim 9, characterized in that The sending at least one of the first public key certificate, the second public key certificate, and the third public key certificate to the first device and / or the second device includes: In response to the server being able to communicate with the second device, sending a second public key certificate and a third public key certificate to the second device, and sending a first public key certificate, a second public key certificate, and a third public key certificate to the first device; In response to the server being unable to communicate with the second device, a first public key certificate, a second public key certificate, and a third public key certificate are sent to the first device.
13. The method according to claim 9, characterized in that The method further comprises: receiving relevant information of a third device sent by the first device, where the third device is: a device that needs to be authorized by the first device to communicate with the second device; generating a fifth key pair, the fifth key pair comprising a fifth public key and a fifth private key; Sending the fifth public key to the first device; A fourth public key certificate sent by the first device is received, where the fourth public key certificate includes the fifth public key, and the fourth public key certificate is signed by the first private key in the first key pair.
14. The method according to claim 13, characterized in that The method further comprises: Sending a key request message to the third device; receiving a sixth public key sent by the third device, where the sixth public key belongs to a sixth key pair, the sixth key pair also includes a sixth private key, and the sixth key pair is generated by the third device; Using the fifth private key to sign the sixth public key to obtain a fifth public key certificate; At least one of the first public key certificate, the fourth public key certificate, and the fifth public key certificate is sent to the third device and / or the second device.
15. The method according to claim 14, characterized in that The sending at least one of the first public key certificate, the fourth public key certificate, and the fifth public key certificate to the third device and / or the second device comprises: In response to the server being able to communicate with the second device, sending a fourth public key certificate and a fifth public key certificate to the second device, and sending a first public key certificate, a fourth public key certificate, and a fifth public key certificate to the third device; In response to the server being unable to communicate with the second device, sending a first public key certificate, a fourth public key certificate, and a fifth public key certificate to the third device.
16. A key exchange method, characterized in that: The method is performed by a second device, and the method includes: generating a second key pair, the second key pair comprising a second public key and a second private key; Sending the second public key to the server; Receive a second public key certificate and a third public key certificate; the second public key certificate includes a fourth public key in a fourth key pair, the fourth key pair also includes a fourth private key, and the fourth key pair is generated by the server; the third public key certificate includes a first public key in a first key pair, the first key pair is generated by a first device, the first device is a device that needs to communicate with the second device, and the third public key certificate is obtained by signing the fourth private key.
17. The method according to claim 16, characterized in that The method further comprises: Verifying the second public key certificate and the third public key certificate; In response to successful verification of the second public key certificate and the third public key certificate, communication is performed with the first device based on at least one of a second private key, a second public key, and a first public key included in the third public key certificate.
18. The method according to claim 17, characterized in that The second public key certificate is obtained by signing the third private key in the third key pair; The third key pair further includes a third public key, the third key pair is generated by the server, and the third public key in the third key pair is preconfigured in the first device and the second device; The verifying the second public key certificate and the third public key certificate comprises: Verifying the second public key certificate based on the third public key to obtain a fourth public key; The third public key certificate is verified based on the fourth public key.
19. The method according to claim 16, characterized in that The receiving the second public key certificate and the third public key certificate comprises: Receive the second public key certificate and the third public key certificate sent by the first device and / or the server.
20. The method of claim 16, wherein: The method further comprises: receiving a fourth public key certificate and a fifth public key certificate, wherein the fourth public key certificate includes a fifth public key, the fifth public key belongs to a fifth key pair, the fifth key pair also includes a fifth private key, the fifth key pair is generated by a server, and the fourth public key certificate is signed by the first private key in the first key pair; the fifth public key certificate includes a sixth public key, the sixth public key belongs to a sixth key pair, the sixth key pair also includes a sixth private key, the sixth key pair is generated by a third device, the third device is a device that needs to be authorized by the first device to communicate with the second device; the fifth public key certificate is signed by the fifth private key; Verifying the fourth public key certificate and the fifth public key certificate; In response to successful verification of the fourth public key certificate and the fifth public key certificate, communication is performed with the third device based on at least one of the second private key, the second public key, and the sixth public key included in the fifth public key certificate.
21. The method of claim 20, wherein: The verifying the fourth public key certificate and the fifth public key certificate comprises: Verifying the fourth public key certificate based on the first public key to obtain the fifth public key; The fifth public key certificate is verified based on the fifth public key.
22. The method of claim 20, wherein: The receiving the fourth public key certificate and the fifth public key certificate comprises: Receive a fourth public key certificate and a fifth public key certificate sent by a third device and / or a server.
23. A key exchange method, characterized in that: The method is performed by a third device, and includes: Receive the key request message sent by the server; generating a sixth key pair, the sixth key pair comprising a sixth public key and a sixth private key; Sending the sixth public key to the server; A first public key certificate sent by a server is received, where the first public key certificate includes a second public key in a second key pair; the second key pair is generated by a second device, where the second key pair also includes a second private key, and the second device is a device that needs to communicate with the third device.
24. The method of claim 23, wherein: The method further comprises: verifying the first public key certificate; In response to successful verification of the first public key certificate, communication is performed with the second device based on at least one of the sixth public key, the sixth private key, and the second public key included in the first public key certificate.
25. The method of claim 24, wherein: The first public key certificate is obtained by signing a third private key in a third key pair, the third key pair also includes a third public key, the third key pair is generated by the server, and the third public key in the third key pair is pre-configured to the third device and the second device; The verifying the first public key certificate comprises: The first public key certificate is verified based on the third public key.
26. The method of claim 23, wherein: The method further comprises: Receive the fourth public key certificate and the fifth public key certificate sent by the server, the fourth public key certificate includes the fifth public key, the fifth public key belongs to the fifth key pair, the fifth key pair also includes the fifth private key, the fifth key pair is generated by the server, the fourth public key certificate is signed by the first private key in the first key pair; the fifth public key certificate includes the sixth public key; the fifth public key certificate is signed by the fifth private key.
27. The method of claim 26, wherein: The method further comprises: Verifying the fourth public key certificate based on the pre-acquired first public key to obtain the fifth public key; The fifth public key certificate is verified based on the fifth public key.
28. The method of claim 26, wherein: The method further comprises: The fourth public key certificate and the fifth public key certificate are sent to the second device.
29. A communication device, comprising: A processing module, configured to generate a first key pair, wherein the first key pair includes a first public key and a first private key; A transceiver module, used for sending the first public key to the server; The transceiver module is also used to receive a first public key certificate sent by the server, the first public key certificate includes the second public key in the second key pair; the second key pair is generated by a second device, the second key pair also includes a second private key, and the second device is a device that needs to communicate with the first device.
30. A communication device, comprising: A transceiver module, used for receiving a first public key sent by a first device; The first public key belongs to a first key pair, the first key pair also includes a first private key, and the first key pair is generated by the first device; The transceiver module is further used to receive a second public key sent by a second device; the second public key belongs to a second key pair, the second key pair also includes a second private key, the second key pair is generated by the second device, and the second device is a device that needs to communicate with the first device; a processing module, configured to generate at least one of a first public key certificate, a second public key certificate, and a third public key certificate; the first public key certificate includes the second public key in the second key pair; the second public key certificate includes the fourth public key in the fourth key pair, the fourth key pair also includes a fourth private key; the third public key certificate includes the first public key, and the third public key certificate is obtained by signing the fourth private key; The transceiver module is further used to send at least one of the first public key certificate, the second public key certificate, and the third public key certificate to the first device and / or the second device.
31. A communication device, comprising: A processing module, configured to generate a second key pair, wherein the second key pair includes a second public key and a second private key; A transceiver module, used for sending the second public key to the server; The transceiver module is also used to receive a second public key certificate and a third public key certificate; the second public key certificate includes a fourth public key in a fourth key pair, the fourth key pair also includes a fourth private key, and the fourth key pair is generated by the server; the third public key certificate includes a first public key in a first key pair, the first key pair is generated by a first device, the first device is a device that needs to communicate with the second device, and the third public key certificate is obtained by signing the fourth private key.
32. A communication device, comprising: A transceiver module, used for receiving a key request message sent by a server; A processing module, configured to generate a sixth key pair, wherein the sixth key pair includes a sixth public key and a sixth private key; The transceiver module is further used to send the sixth public key to the server; The transceiver module is also used to receive a first public key certificate sent by the server, the first public key certificate includes the second public key in the second key pair; the second key pair is generated by the second device, the second key pair also includes a second private key, and the second device is a device that needs to communicate with the third device.
33. A communication device, characterized in that: The device includes a processor and a memory, wherein a computer program is stored in the memory, and the processor executes the computer program stored in the memory so that the device performs the method as described in any one of claims 1 to 8, or the processor executes the computer program stored in the memory so that the device performs the method as described in any one of claims 9 to 15, or the processor executes the computer program stored in the memory so that the device performs the method as described in any one of claims 16 to 22, or the processor executes the computer program stored in the memory so that the device performs the method as described in any one of claims 23 to 28.
34. A communication device, characterized in that: include: processor and interface circuitry, wherein The interface circuit is used to receive code instructions and transmit them to the processor; The processor is used to run the code instructions to execute the method as described in any one of claims 1 to 8, or run the code instructions to execute the method as described in any one of claims 9 to 15, or run the code instructions to execute the method as described in any one of claims 16 to 22, or run the code instructions to execute the method as described in any one of claims 23 to 28.
35. A computer-readable storage medium storing instructions, which, when executed, implement the method according to any one of claims 1 to 8, or implement the method according to any one of claims 9 to 15, or implement the method according to any one of claims 16 to 22, or implement the method according to any one of claims 23 to 28.
Citation Information
Patent Citations
Communication methods and systems, electronic equipment and storage medium
CN109639412A
Key deployment method and system, data communication method and system, key exchange method and system and security reinforcement method and system
CN113411190A
Key distribution method, system and device, readable storage medium and chip
CN113645024A
Monitoring content transmitted through secured communication channels
US8843750B1
Handshake protocols for identity-based key material and certificates
WO2017167771A1
