Communication method and apparatus
By pre-storing a multi-level digital certificate chain in the device for verification, the problem of identity verification between devices from different manufacturers is solved, and efficient and secure communication between devices is achieved.
Patent Information
- Application Number
- PCT/CN2026/095964
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-05-16
- Filing Date
- 2026-05-09
- Publication Date
- 2026-11-19
AI Technical Summary
During device communication, especially between devices from different manufacturers, the inability to verify the other party's identity leads to insecure data transmission. Existing technologies suffer from low authentication efficiency, complex key management, and insufficient encryption strength.
By pre-storing a multi-level digital certificate chain in the device, the certificate of the other device can be verified using the pre-stored digital certificate chain, thereby achieving fast and reliable authentication of the device and end-to-end high-strength encryption, ensuring the security of the communication key.
It enables fast and reliable device authentication and high-strength encryption, improving the security and efficiency of communication between devices and ensuring the authenticity of device identities and the security of data transmission.
Smart Images

Figure CN2026095964_19112026_PF_FP_ABST
Abstract
Description
Communication methods and devices
[0001] Cross-reference to related applications
[0002] This application claims priority to Chinese Patent Application No. 202510635643.1, filed in China on May 16, 2025, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of communication technology, and in particular to a communication method and apparatus. Background Technology
[0004] With the rapid development of the Internet of Things (IoT) and mobile internet, the demand for interconnectivity between devices from different manufacturers is growing. Ensuring the authenticity of device identities and the security of data transmission are crucial during device communication.
[0005] However, when two devices communicate using a communication method without a link communication encryption mechanism, they cannot verify each other's identity, which leads to security risks in the data communication between the two devices. Summary of the Invention
[0006] This disclosure provides a communication method and apparatus that can improve the security of communication between devices.
[0007] In a first aspect, embodiments of this application provide a communication method applied to a first device. The method includes: receiving a first digital certificate from a second device, the first digital certificate including at least a device certificate of the second device; verifying the first digital certificate based on a pre-stored digital certificate chain, the digital certificate chain including the device certificate of the first device and a vendor certificate of a first vendor, the first vendor being the issuing authority that issued the device certificate of the first device; and, if the verification of the first digital certificate passes, determining a communication key between the first device and the second device, and using the communication key to communicate with the second device.
[0008] Secondly, embodiments of this application provide a communication method applied to a second device. The method includes: receiving a second digital certificate broadcast by a first device, the second digital certificate including at least a device certificate of the first device; verifying the second digital certificate based on a pre-stored digital certificate chain, the digital certificate chain including the device certificate of the second device and a vendor certificate of a second vendor, the second vendor being the issuing authority that issued the device certificate of the second device; and, if the verification of the second digital certificate passes, determining a communication key between the first device and the second device, and communicating with the first device using the communication key.
[0009] Thirdly, embodiments of this application provide a communication device applied to a first device. The device includes: a first receiving module, a first verification module, a first determining module, and a first communication module. The first receiving module is used to receive a first digital certificate from a second device, the first digital certificate including at least the device certificate of the second device. The first verification module is used to verify the first digital certificate based on a pre-stored digital certificate chain, the digital certificate chain including the device certificate of the first device and a vendor certificate from a first vendor, the first vendor being the issuing authority that issued the device certificate of the first device. The first determining module is used to determine a communication key between the first device and the second device if the verification of the first digital certificate passes. The first communication module is used to communicate with the second device using the communication key.
[0010] Fourthly, embodiments of this application provide a communication device applied to a second device. The device includes: a second receiving module, a second verification module, a second determining module, and a second communication module. The second receiving module is used to receive a second digital certificate broadcast by a first device. The second digital certificate includes at least the device certificate of the first device. The second verification module is used to verify the second digital certificate based on a pre-stored digital certificate chain. The digital certificate chain includes the device certificate of the second device and a vendor certificate from a second vendor, where the second vendor is the issuing authority that issued the device certificate to the second device. The second determining module is used to determine a communication key between the first device and the second device if the verification of the second digital certificate passes. The second communication module is used to communicate with the first device using the communication key.
[0011] Fifthly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing programs or instructions executable on the processor, the programs or instructions being executed by the processor to implement the steps of the communication method as described in the first or second aspect.
[0012] In a sixth aspect, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the communication method as described in the first or second aspect.
[0013] In a seventh aspect, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the steps of the communication method as described in the first or second aspect.
[0014] Eighthly, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the steps of the communication method as described in the first or second aspect.
[0015] In this embodiment, a first digital certificate is received from a second device, which includes at least the device certificate of the second device. Based on a pre-stored digital certificate chain, the first digital certificate is verified. The digital certificate chain includes the device certificate of the first device and a vendor certificate from a first vendor, who is the issuing authority that issued the device certificate to the first device. If the verification of the first digital certificate passes, a communication key between the first device and the second device is determined, and communication with the second device is initiated using the communication key. Thus, by pre-stored a digital certificate chain in the device and using this pre-stored digital certificate chain to verify the digital certificates of other devices, fast and reliable device authentication and high-strength end-to-end encryption are achieved, improving the security and efficiency of communication between the two devices. Attached Figure Description
[0016] Figure 1 is a flowchart illustrating one of the communication methods provided in an embodiment of this application;
[0017] Figure 2 is a schematic diagram of the multi-level certificate issuance system provided in the embodiments of this application;
[0018] Figure 3 is a schematic diagram of the data certificate chain provided in an embodiment of this application;
[0019] Figure 4 is a second schematic flowchart of the communication method provided in the embodiments of this application;
[0020] Figure 5 is one of the schematic diagrams of the process for digital certificate verification between devices provided in the embodiments of this application;
[0021] Figure 6 is a second schematic diagram of the process for digital certificate verification between devices provided in an embodiment of this application;
[0022] Figure 7 is a third schematic flowchart of the communication method provided in the embodiments of this application;
[0023] Figure 8 is a schematic diagram of the structure of a communication device provided in an embodiment of this application;
[0024] Figure 9 is a second schematic diagram of the communication device provided in an embodiment of this application;
[0025] Figure 10 is a schematic diagram of the structure of the electronic device provided in an embodiment of this application;
[0026] Figure 11 is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0028] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0029] The terms "at least one," "at least one of," etc., used in the specification and claims of this application refer to any one, any two, or a combination of two or more of the included items. For example, at least one of a, b, and c can mean: "a," "b," "c," "a and b," "a and c," "b and c," and "a, b, and c," where a, b, and c can be single or multiple. Similarly, "at least two" refers to two or more items, and its meaning is similar to that of "at least one."
[0030] The communication methods, apparatus, devices, and storage media provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0031] The communication method provided in this application can be applied to near-field communication scenarios without link communication encryption mechanisms.
[0032] With the rapid development of the Internet of Things (IoT) and mobile internet, the demand for interconnectivity between devices from different manufacturers is growing daily. Ensuring the authenticity of device identities and the security of data transmission is crucial during device communication. Traditional security mechanisms suffer from low authentication efficiency, complex key management, and insufficient encryption strength when facing large-scale, multi-vendor device environments. Public Key Infrastructure (PKI), as a mature security technology framework, can achieve identity authentication and key management through digital certificates. However, in mobile device scenarios, a single certificate issuance model is insufficient to meet the needs of complex device management and efficient, secure communication. For example, devices may be unable to verify each other's identities, or when two devices communicate via Bluetooth broadcast, man-in-the-middle tampering can occur, making communication insecure.
[0033] The communication method provided in this application embodiment receives a first digital certificate from a second device, the first digital certificate including at least the device certificate of the second device; verifies the first digital certificate based on a pre-stored digital certificate chain, the digital certificate chain including the device certificate of the first device and a vendor certificate of a first vendor, the first vendor being the issuing authority that issued the device certificate of the first device; if the verification of the first digital certificate passes, determines a communication key between the first device and the second device, and uses the communication key to communicate with the second device. Thus, by pre-stored a digital certificate chain in the device and using the pre-stored digital certificate chain to verify the digital certificates of other devices, fast and reliable device authentication and high-strength end-to-end encryption are achieved, improving the security and efficiency of communication between the two devices.
[0034] The communication method provided in this application can be executed by a communication device. Exemplarily, the communication device can be an electronic device, or a functional component or entity within that electronic device. The following will use a first device as an example to illustrate the communication method provided in this application.
[0035] Figure 1 is a flowchart illustrating the communication method provided in an embodiment of this application. As shown in Figure 1, the communication method provided in an embodiment of this application may include the following steps 101 to 103.
[0036] Step 101: The first device receives a first digital certificate from the second device, the first digital certificate including at least the device certificate of the second device.
[0037] In some embodiments of this application, the second device described above may be an electronic device that requires establishing a communication connection with the first device.
[0038] In some embodiments of this application, the device certificate of the second device can be a digital certificate of the second device, which can be used to uniquely identify the second device.
[0039] In some embodiments of this application, the device certificate of the second device may include the identity information of the second device, the device public key of the second device, the signature information of the issuing authority that issued the device certificate of the second device, and the validity period of the device certificate of the second device.
[0040] In some embodiments of this application, the issuing authority for the equipment certificate of the second equipment may be the manufacturer that produces the second equipment.
[0041] Step 102: The first device verifies the first digital certificate based on the pre-stored digital certificate chain.
[0042] In some embodiments of this application, a digital certificate chain is pre-stored in the first device, which may include all digital certificates from the root certificate to the device certificate of the first device.
[0043] In some embodiments of this application, a multi-level certificate issuance system is pre-built, which may include at least a root certificate authority (root CA) and a level-1 certificate authority (Level-1 CA).
[0044] In some embodiments of this application, the aforementioned root certificate authority is an authoritative organization responsible for issuing and managing root certificates, and its core role is the starting point for establishing a digital trust chain. This root certificate authority can issue digital certificates from first-level certificate authorities.
[0045] In some embodiments of this application, the aforementioned root certificate authority may also issue root certificates.
[0046] In some embodiments of this application, the aforementioned primary certificate authority can issue digital certificates for specific manufacturers or specific types of devices based on the trust of the root certificate.
[0047] For example, the primary certificate authority can be a manufacturer, the root certificate authority can issue manufacturer certificates, and the manufacturer can issue device certificates.
[0048] In some embodiments of this application, the aforementioned multi-level certificate issuance system may include a root certificate authority, a primary certificate authority, and secondary certificate authorities. The root certificate authority may issue digital certificates for primary certificate authorities, the primary certificate authorities may issue digital certificates for secondary certificate authorities, and the secondary certificate authorities may issue digital certificates for specific manufacturers or specific types of devices.
[0049] For example, the secondary certificate authority can be a manufacturer, the root certificate authority can issue digital certificates of the primary certificate authority, the primary certificate authority can issue manufacturer certificates, and the manufacturer can issue device certificates for the equipment.
[0050] In some embodiments of this application, taking a multi-level certificate issuance system including a root certificate authority and a primary certificate authority as an example, the root certificate authority can issue its own root certificate, which may include the root public key. The root certificate authority can also use its root private key to sign the public key of a primary certificate authority, obtaining the digital certificate of the primary certificate authority. The primary certificate authority can use its private key to sign the device public key, obtaining the device certificate.
[0051] For example, taking a multi-level certificate issuance system including a root certificate authority and vendors, the root certificate authority can issue its own root certificate, which may include the root public key. The root certificate authority can also use its root private key to sign a vendor's public key, obtaining a vendor certificate. A vendor can use its vendor private key to sign a device's public key, obtaining a device certificate.
[0052] In this way, the authenticity of the device certificate can be verified through the manufacturer's certificate, and the authenticity of the manufacturer's certificate can be verified through the root certificate, thus completing the hierarchical verification of the digital certificate.
[0053] In some embodiments of this application, for a digital certificate issued by any of the aforementioned issuing authorities, the digital certificate may include basic fields and public key information. The basic fields may include a version number, a serial number, the signature information of the issuing authority, issuer information, user information, and the validity period of the digital certificate, etc.
[0054] In some embodiments of this application, the aforementioned serial number can uniquely identify a digital certificate. The aforementioned issuer information can be the identification information of the issuing authority that issued the digital certificate. The aforementioned user information can be the identification information of the issuing authority or device using the digital certificate.
[0055] For example, the aforementioned digital certificate is a root certificate, the issuer information is the identification information of the root certificate authority, and the user information is the identification information of the root certificate authority.
[0056] For example, the aforementioned digital certificate is a vendor certificate, the issuer information is the identification information of the root certificate authority, and the user information is the identification information of the vendor.
[0057] For example, the aforementioned digital certificate is a device certificate, the issuer information is the manufacturer's identification information, and the user information is the device's identification information.
[0058] In some embodiments of this application, the signature information can be a signature algorithm. For example, the signature information can be a Secure Hash Algorithm (SHA)-256 with asymmetric encryption algorithm (Rivest-Shamir-Adleman, RSA).
[0059] In some embodiments of this application, the validity period of the digital certificate may include the effective date and the expiration date of the digital certificate. For example, the effective date of the digital certificate is January 1, 2020, and the expiration date is January 1, 2040, meaning the validity period of the digital certificate is 20 years. Alternatively, the effective date of the digital certificate is January 1, 2025, and the expiration date is January 1, 2026, meaning the validity period of the digital certificate is 1 year.
[0060] In some embodiments of this application, the aforementioned public key information may include the public key of the issuing authority or device using the digital certificate. This public key can be used to verify the signature information of the next-level digital certificate of the digital certificate.
[0061] For example, the above digital certificate is a root certificate, and the public key in the root certificate is the public key of the root certificate authority, also known as the root public key. Alternatively, the above digital certificate is a vendor certificate, and the public key in the vendor certificate is the vendor's public key, also known as the vendor's public key. Alternatively, the above digital certificate is a device certificate, and the public key in the device certificate is the device's public key, also known as the device public key.
[0062] In some embodiments of this application, the public key information may further include a public key algorithm. For example, the public key algorithm may be RSA 2048 or Elliptic curve cryptography (ECC).
[0063] In some embodiments of this application, the digital certificate described above may further include extended fields. These extended fields may include basic constraints and key usage, etc.
[0064] In some embodiments of this application, the above-mentioned basic constraints can be used to indicate the type of the digital certificate and whether the digital certificate can issue subordinate certificates.
[0065] For example, the above digital certificate is a root certificate, with the basic constraint of a CA certificate, and can issue subordinate certificates. Alternatively, the above digital certificate is a vendor certificate, with the basic constraint of a CA certificate, and cannot issue subordinate CA certificates, but can issue subordinate device certificates. Or, the above digital certificate is a device certificate, with the basic constraint of a device certificate, and cannot issue subordinate certificates.
[0066] In some embodiments of this application, the above key usage can be used to represent the role of the key in the digital certificate.
[0067] For example, the digital certificate described above is a root certificate, and the key is used for issuing certificates and creating revocation lists. Alternatively, the digital certificate described above is a vendor certificate, and the key is used to authorize the issuance of certificates and the creation of revocation lists. Alternatively, the digital certificate described above is a device certificate, and the key is used for digital signatures and encryption.
[0068] In some embodiments of this application, the extended fields may also include Authority Information Access (AIA), Extended Key Usage, Certificate Revocation List (CRL) distribution points, etc.
[0069] In some embodiments of this application, the various digital certificates obtained through the above-described step-by-step signing process are pre-installed in the first device. Furthermore, in the first device, the various digital certificates are represented in the form of a digital certificate chain according to the order of their step-by-step signing.
[0070] In some embodiments of this application, the device private key of the first device can be pre-stored in the first device, and the security of the device private key is ensured by hardware and TEE, etc. In this way, the root certificate, vendor certificate, device certificate and device private key are pre-set in the first device so that when the first device communicates with the second device in the future, the identity of the second device can be verified based on these pre-set digital certificates, thereby improving the communication security between the first device and the second device.
[0071] The following description, in conjunction with Figures 2 and 3, illustrates the multi-level certificate issuance system and the digital certificate chain stored in the electronic device provided in the embodiments of this application. The multi-level certificate issuance system includes a root certificate authority and a first-level certificate authority. The root certificate authority is used to issue a manufacturer certificate for a certain manufacturer, and the first-level certificate authority is used to issue a device certificate for a certain device.
[0072] For example, as shown in Figure 2, a root certificate authority issues its own root certificate. The root certificate authority uses its root private key to encrypt vendor A's public key, obtaining and issuing vendor A's certificate. The root certificate authority uses its root private key to encrypt vendor B's public key, obtaining and issuing vendor B's certificate. The root certificate authority uses its root private key to encrypt vendor C's public key, obtaining and issuing vendor C's certificate. Vendor A uses its private key to encrypt a device's public key, obtaining and issuing vendor A's device certificate. Vendor B uses its private key to encrypt a device's public key, obtaining and issuing vendor B's device certificate. Vendor C uses its private key to encrypt a device's public key, obtaining and issuing vendor C's device certificate. As can be seen from Figure 2, the root certificate - vendor A certificate - vendor A device certificate form a digital certificate chain, the root certificate - vendor B certificate - vendor B device certificate form a digital certificate chain, and the root certificate - vendor C certificate - vendor C device certificate form a digital certificate chain. In addition, when the digital certificate chain in Figure 2 is stored in a device of manufacturer A, a device of manufacturer B, or a device of manufacturer C, the private key of device A, the private key of device B, or the private key of device C can also be securely stored separately.
[0073] For example, as shown in Figure 3, taking device Q as an example, the digital certificate chain pre-stored in the first device includes a root certificate, a vendor Q certificate, and a device Q certificate. The first device also stores a device Q private key, and the device Q private key is stored securely.
[0074] In some embodiments of this application, the first device can also detect the validity period of each digital certificate in the pre-stored digital certificate chain. When a digital certificate is detected to be expired or has a security risk, the first device can obtain the latest digital certificate from the corresponding issuing authority through a secure network channel for updating.
[0075] In this way, the first device can guarantee the validity and security of the pre-stored digital certificate.
[0076] In some embodiments of this application, the digital certificate chain may include a device certificate for the first device and a vendor certificate for the first vendor, wherein the first vendor may be the issuing authority that issued the device certificate for the first device.
[0077] For example, the first manufacturer mentioned above may be a manufacturer that produces the first equipment.
[0078] In some embodiments of this application, the first digital certificate may include a device certificate of the second device, which may include the signature information of the first vendor and the device public key of the second device; step 102 may be implemented in the following steps 1021 and 1022.
[0079] Step 1021: The first device decrypts the signature information of the first vendor based on the public key in the vendor certificate of the first vendor in the digital certificate chain to obtain the first hash value, and hashes the device public key of the second device to obtain the second hash value.
[0080] In some embodiments of this application, the public key in the vendor certificate of the first vendor can be the vendor public key of the first vendor. The first hash value can be the hash value of the device public key of the second device or the hash value of the device certificate of the second device. The second hash value can be the hash value of the recalculated device public key of the second device or the hash value of the recalculated device certificate of the second device.
[0081] In some embodiments of this application, the first device may use the first vendor's vendor public key to decrypt the first vendor's signature information to obtain the hash value of the second device's device certificate, i.e., the first hash value, and use a hash algorithm to calculate the second device's device public key to obtain the hash value of the second device's device certificate, i.e., the second hash value.
[0082] Step 1022: If the first hash value and the second hash value are the same, the first device determines that the first digital certificate verification is successful.
[0083] In some embodiments of this application, if the first hash value is the same as the second hash value, it indicates that the device certificate of the second device is correct and complete, and the first device can determine that the device certificate of the second device has passed the verification.
[0084] In some embodiments of this application, when the first hash value and the second hash value are the same, it indicates that the second device is a second device of the first manufacturer, that is, the second device and the first device are electronic devices of the same manufacturer. This can be understood as the parent certificate of the second device being the same as the parent certificate of the first device, such as a manufacturer certificate from the same first manufacturer.
[0085] In some embodiments of this application, if the first hash value is different from the second hash value, the first device determines that the first digital certificate verification has failed.
[0086] Thus, for the first and second devices from the same manufacturer, after the second device transmits its device certificate to the first device, the first device uses the manufacturer's certificate in its pre-stored digital certificate chain to verify the device certificate of the second device, thereby completing the identity authentication of the second device and improving the security of communication.
[0087] In some embodiments of this application, the first digital certificate may include a device certificate of the second device and a vendor certificate of the second vendor. The second vendor may be the issuing authority that issued the device certificate for the second device. The device certificate of the second device may include the signature information of the second vendor and the device public key of the second device. The vendor certificate of the second vendor may include the signature information of the issuing authority that issued the vendor certificate for the second vendor and the vendor public key of the second vendor. The digital certificate chain may include a root certificate. Step 102 can be specifically implemented through steps 1023 to 1025.
[0088] Step 1023: The first device decrypts the signature information of the issuing authority that issued the second vendor's certificate based on the public key in the root certificate to obtain the third hash value, and hashes the vendor's public key of the second vendor to obtain the fourth hash value.
[0089] In some embodiments of this application, the issuing authority that issues the second vendor certificate may be a root certificate authority. The public key of the root certificate may be the root public key.
[0090] In some embodiments of this application, the first device can use the root public key to decrypt the signature information of the root certificate authority to obtain the hash value of the vendor certificate of the second vendor, i.e., the third hash value, and use a hash algorithm to calculate the vendor public key of the second vendor to obtain the hash value of the vendor certificate of the second vendor again, i.e., the fourth hash value.
[0091] Step 1024: If the third hash value is the same as the fourth hash value, the first device decrypts the second manufacturer's signature information based on the second manufacturer's public key to obtain the fifth hash value, and hashes the second device's public key to obtain the sixth hash value.
[0092] In some embodiments of this application, the third hash value may be the hash value of the device public key of the second device or the hash value of the device certificate of the second device. The fourth hash value may be the hash value of the recalculated device public key of the second device or the hash value of the recalculated device certificate of the second device.
[0093] In some embodiments of this application, the first device may use the vendor public key of the second vendor to decrypt the signature information of the second vendor to obtain the hash value of the device certificate of the second device, i.e., the fifth hash value, and use a hash algorithm to calculate the device public key of the second device to obtain the hash value of the device certificate of the second device again, i.e., the sixth hash value.
[0094] In some embodiments of this application, if the third hash value is the same as the fourth hash value, it indicates that the vendor certificate of the second vendor is correct and complete. Then the first device can determine that the vendor certificate of the second vendor has passed the verification, that is, the first device has completed the identity verification of the vendor certificate of the second vendor. Then the first device continues to verify the identity of the device certificate of the second device.
[0095] In some embodiments of this application, if the third hash value and the fourth hash value are the same, it indicates that the second device is an electronic device of the second manufacturer, and the second device and the first device are electronic devices of different manufacturers. This can be understood as the parent certificate of the second device's device certificate being the parent certificate of the second manufacturer, and the parent certificate of the first device's device certificate being the parent certificate of the first manufacturer, and the parent certificate of the second manufacturer being different from the parent certificate of the first manufacturer.
[0096] In some embodiments of this application, if the third hash value is different from the fourth hash value, the first device determines that the first digital certificate verification has failed.
[0097] Step 1025: If the fifth hash value is the same as the sixth hash value, the first device determines that the first digital certificate verification is successful.
[0098] In some embodiments of this application, if the fifth hash value is the same as the sixth hash value, it indicates that the device certificate of the second device is correct and complete, and the first device can determine that the device certificate of the second device has passed the verification.
[0099] In some embodiments of this application, when the fifth hash value is the same as the sixth hash value, it indicates that the second device is a second device of the second manufacturer.
[0100] In some embodiments of this application, if the fifth hash value is different from the sixth hash value, the first device determines that the first digital certificate verification has failed.
[0101] Thus, for first and second devices from different manufacturers, after the second device transmits its device certificate and the manufacturer's certificate to the first device, the first device uses the root certificate and manufacturer certificate in its pre-stored digital certificate chain to verify the manufacturer's certificate and the device certificate of the second device, thereby completing the identity authentication of the second device and improving the security of communication.
[0102] Step 103: If the first digital certificate is verified, the first device determines the communication key between the first device and the second device, and uses the communication key to communicate with the second device.
[0103] In some embodiments of this application, after the first device verifies the identity of the second device, the first device may perform end-to-end communication key negotiation with the second device to determine the communication key to be used when communicating with the second device later, and use the communication key to transmit data with the second device.
[0104] The communication method provided in this application constructs a multi-level certificate issuance system and pre-stores a digital certificate chain in the device. The pre-stored digital certificate chain is used to quickly verify the digital certificate. This not only enables fast and reliable authentication of devices from different manufacturers or the same manufacturer, i.e., completes internal brand device authentication or cross-brand device authentication, but also achieves high-strength end-to-end encryption of the device, improving the security and efficiency of communication between the two devices.
[0105] In some embodiments of this application, the step 103 above, "determining the communication key between the first device and the second device if the first digital certificate is verified successfully", can be specifically implemented through the following steps 1031 to 1035.
[0106] Step 1031: The first device uses the device public key of the second device to encrypt the first random number, thus obtaining the encrypted first random number.
[0107] In some embodiments of this application, during the digital certificate exchange and authentication process between the first device and the second device, the first device may send its device public key to the second device, and the second device may send its device public key to the first device.
[0108] In some embodiments of this application, the first random number can be a 32-bit random number.
[0109] For example, assuming the first random number is Ta_1, the first device uses the device public key of the second device to encrypt the first random number, and obtains the encrypted first random number encTa_1.
[0110] Step 1032: The first device sends the encrypted first random number to the second device.
[0111] For example, the first device sends an encrypted first random number encTa_1 to the second device.
[0112] Step 1033: The first device receives the encrypted second random number and the encrypted third random number from the second device.
[0113] In some embodiments of this application, after the first device sends an encrypted first random number to the second device, the second device can decrypt the encrypted first random number using its private key to obtain a second random number, and then encrypt the second random number using the first device's public key to obtain an encrypted second random number. Furthermore, the second device can also generate a third random number and encrypt the third random number using the first device's public key to obtain an encrypted third random number. Then, the second device sends the encrypted second random number and the encrypted third random number back to the first device, and the first device receives the encrypted second random number and the encrypted third random number from the second device.
[0114] For example, assuming the encrypted first random number is encTa_1, after the first device sends the encrypted first random number to the second device, the second device can use its private key to decrypt the encrypted first random number encTa_1 to obtain a second random number Ta_2, and then use the first device's public key to encrypt the second random number Ta_2 to obtain the encrypted second random number encTa_2; furthermore, the second device can also generate a third random number Tb_1, encrypt the third random number Tb_1 using the first device's public key to obtain the encrypted third random number encTb_1, and then the second device sends the encrypted second random number encTa_2 and the encrypted third random number encTb_1 to the first device, and the first device receives the encrypted second random number encTa_2 and the encrypted third random number encTb_1.
[0115] Step 1034: The first device uses its private key to decrypt the encrypted second random number and the encrypted third random number to obtain the second random number and the fourth random number, respectively.
[0116] For example, the first device uses its device private key to decrypt the encrypted second random number encTa_2 and the encrypted third random number encTb_1 to obtain the second random number Ta_2 and the fourth random number Tb_2, respectively.
[0117] Step 1035: If the second random number is the same as the first random number, the first device determines the communication key based on the first random number and the fourth random number.
[0118] In some embodiments of this application, the aforementioned communication key is an encryption key used when the first device communicates with the second device, and can also be referred to as an end-to-end encryption key.
[0119] In some embodiments of this application, if the second random number is the same as the first random number, it indicates that the second device is authentic, that is, the first device has verified the authenticity of the second device.
[0120] In some embodiments of this application, the first device may use a hash algorithm to process the first random number and the fourth random number to obtain the communication key between the first device and the second device.
[0121] For example, the first device can calculate the sum of the first random number and the fourth random number, and process the sum using a hash algorithm to obtain the communication key.
[0122] For example, taking the first random number as Ta_1, the second random number as Ta_2, the fourth random number as Tb_2, the hash algorithm as SHA, and the communication key as linkey, when Ta_1 == Ta_2, the first device can determine the authenticity of the second device, and the first device can calculate the communication key between the first device and the second device as linkey = SHA(Ta_1 + Tb_2).
[0123] Thus, after the digital certificate exchange and verification between the first device and the second device is completed, the first device can calculate the end-to-end encryption key between the first device and the second device, so as to perform encrypted transmission when communicating with the second device in the future. In this way, even if other devices steal the public key information during the communication process, they do not have the corresponding private key information and cannot interfere with the communication process, thereby improving the communication security between the first device and the second device.
[0124] In some embodiments of this application, the communication method provided in this application may further include the following steps 104 and 105.
[0125] Step 104: The first device uses the device public key of the second device to encrypt the fourth random number, thus obtaining the encrypted fourth random number.
[0126] In some embodiments of this application, after the first device decrypts the encrypted third random number using the device private key of the first device to obtain the fourth random number, the first device can use the device public key of the second device to encrypt the fourth random number to obtain the encrypted fourth random number.
[0127] For example, assuming the fourth random number is Tb_2, the first device can use the device key of the second device to encrypt Tb_2 to obtain the encrypted fourth random number encTb_2.
[0128] Step 105: The first device sends the encrypted fourth random number to the second device.
[0129] In some embodiments of this application, the first device sends an encrypted fourth random number to the second device. The second device decrypts the encrypted fourth random number using its own private key to obtain a fourth random number. If the fourth random number matches the third random number, the second device verifies the authenticity of the first device, completing two-way authentication. Then, the second device can calculate a communication key based on the third and second random numbers.
[0130] It should be noted that step 104 can be executed after step 1034. Specifically, step 104 can be executed in parallel with step 1035, or it can be executed before or after step 1035. This application embodiment does not limit this.
[0131] In this way, after verifying the identity of the second device, the first device can send an encrypted random number to the second device so that the second device can verify the identity of the first device, thereby achieving two-way authentication and improving communication security.
[0132] In some embodiments of this application, before step 101 above, the communication method provided in the embodiments of this application may further include the following step 100.
[0133] Step 100: The first device broadcasts a second digital certificate, which includes at least the device certificate of the first device.
[0134] In some embodiments of this application, the first digital certificate may be sent by the second device after the second digital certificate has been verified.
[0135] In some embodiments of this application, after the first device broadcasts the second digital certificate, the second device receives the second digital certificate and verifies it. After the verification is successful, the second device sends the first digital certificate to the first device, and the first device receives the first digital certificate from the second device.
[0136] For example, when conducting near-field communication via a plaintext communication method such as broadcasting, the first device can broadcast a second digital certificate. For instance, assuming the plaintext communication method is Bluetooth broadcasting, the first device can broadcast the second digital certificate via Bluetooth broadcasting.
[0137] In some embodiments of this application, the second digital certificate may include the device certificate of the first device, or the second digital certificate may include the device certificate of the first device and the digital certificate of the issuing authority that issued the device certificate of the first device.
[0138] For example, assuming the issuing authority for the device certificate of the first device is the first manufacturer, the second digital certificate includes the device certificate of the first device and the manufacturer's certificate. Alternatively, assuming the issuing authority for the device certificate of the first device is the second manufacturer, the second digital certificate includes the device certificate of the first device and the manufacturer's certificate.
[0139] Thus, when establishing communication connections between devices through communication methods without link communication encryption mechanisms, such as Bluetooth, Wi-Fi, and LAN, the first device broadcasts its own digital certificate so that other devices can exchange and verify the digital certificate with the first device, thereby improving communication security.
[0140] The following will use the second device as an example to illustrate the communication method provided in the embodiments of this application.
[0141] Figure 4 is a flowchart illustrating the communication method provided in an embodiment of this application. As shown in Figure 4, the communication method provided in an embodiment of this application may include the following steps 201 to 203.
[0142] Step 201: The second device receives a second digital certificate broadcast by the first device, the second digital certificate including at least the device certificate of the first device.
[0143] In some embodiments of this application, the first device described above may be an electronic device that requires establishing a communication connection with the second device.
[0144] In some embodiments of this application, the device certificate of the first device can be a digital certificate of the first device, which can be used to uniquely identify the first device.
[0145] In some embodiments of this application, the device certificate of the first device may include the identity information of the first device, the device public key of the first device, the signature information of the issuing authority that issued the device certificate of the first device, and the validity period of the device certificate of the first device.
[0146] In some embodiments of this application, the issuing authority for the equipment certificate of the first equipment may be the manufacturer that produces the first equipment.
[0147] Step 202: The second device verifies the second digital certificate based on the pre-stored digital certificate chain.
[0148] In some embodiments of this application, a digital certificate chain is pre-stored in the second device, which may include all digital certificates from the root certificate to the device certificate of the second device.
[0149] In some embodiments of this application, a multi-level certificate issuance system is pre-built, which may include at least a root certificate authority (root CA) and a level-1 certificate authority (Level-1 CA).
[0150] It should be noted that the specific implementation process of building a multi-level certificate issuance system can be found in the relevant description of step 102 in the above embodiments. To avoid repetition, it will not be repeated here.
[0151] In some embodiments of this application, the digital certificate chain described above may include a device certificate for the second device and a vendor certificate for the second vendor, which may be an issuing authority that issued the device certificate for the second device.
[0152] In some embodiments of this application, the second digital certificate may include the device certificate of the first device, which may include the signature information of the second vendor and the device public key of the first device. Step 202 can be specifically implemented through the following steps 2021 and 2022.
[0153] Step 2021: The second device decrypts the signature information of the second vendor based on the public key in the vendor certificate of the second vendor in the digital certificate chain to obtain the first hash value, and hashes the device public key of the first device to obtain the second hash value.
[0154] In some embodiments of this application, the public key in the vendor certificate of the second vendor can be the vendor public key of the second vendor. The first hash value can be the hash value of the device public key of the first device or the hash value of the device certificate of the first device. The second hash value can be the hash value of the recalculated device public key of the first device or the hash value of the recalculated device certificate of the first device.
[0155] In some embodiments of this application, the second device may use the vendor public key of the second vendor to decrypt the signature information of the second vendor to obtain the hash value of the device certificate of the first device, i.e., the first hash value, and use a hash algorithm to calculate the device public key of the first device to obtain the hash value of the device certificate of the first device, i.e., the second hash value.
[0156] Step 2022: If the first hash value and the second hash value are the same, the second device determines that the second digital certificate verification is successful.
[0157] In some embodiments of this application, if the first hash value and the second hash value are the same, it indicates that the device certificate of the first device is correct and complete, and the second device can determine that the device certificate of the first device has passed the verification.
[0158] In some embodiments of this application, when the first hash value and the second hash value are the same, it indicates that the first device is a first device from a second manufacturer, that is, the second device and the first device are electronic devices from the same manufacturer. This can be understood as the parent certificate of the second device's device certificate being the same as the parent certificate of the first device's device certificate, such as a manufacturer certificate from the same second manufacturer.
[0159] In some embodiments of this application, if the first hash value is different from the second hash value, the second device determines that the second digital certificate verification has failed.
[0160] Thus, for the first device and the second device from the same manufacturer, after the first device transmits its device certificate to the second device, the second device uses the manufacturer's certificate in its own pre-stored digital certificate chain to verify the first device's device certificate, thereby completing the identity authentication of the first device and improving the security of communication.
[0161] In some embodiments of this application, the second digital certificate may include a device certificate of the first device and a vendor certificate of a third vendor, wherein the third vendor is the issuing authority that issued the device certificate of the first device. The device certificate of the first device may include the signature information of the third vendor and the device public key of the first device. The vendor certificate of the third vendor may include the signature information of the issuing authority that issued the vendor certificate of the third vendor and the vendor public key of the third vendor. The digital certificate chain may include a root certificate. Step 202 may be implemented in detail through the following steps 2023 to 2025.
[0162] Step 2023: The second device decrypts the signature information of the issuing authority of the third vendor's vendor certificate based on the public key in the root certificate to obtain the third hash value, and hashes the third vendor's vendor public key to obtain the fourth hash value.
[0163] In some embodiments of this application, the issuing authority that issues the vendor certificate to the third vendor can be a root certificate authority. The public key in the root certificate can be the root public key.
[0164] In some embodiments of this application, the second device can use the root public key to decrypt the signature information of the root certificate authority to obtain the hash value of the third vendor's vendor certificate, i.e., the third hash value, and use a hash algorithm to calculate the third vendor's vendor public key to obtain the hash value of the third vendor's vendor certificate again, i.e., the fourth hash value.
[0165] Step 2024: If the third hash value and the fourth hash value are the same, the second device decrypts the third vendor's signature information based on the third vendor's public key to obtain the fifth hash value, and hashes the first device's public key to obtain the sixth hash value.
[0166] In some embodiments of this application, the third hash value may be the hash value of the device public key of the first device or the hash value of the device certificate of the first device. The fourth hash value may be the hash value of the recalculated device public key of the first device or the hash value of the recalculated device certificate of the first device.
[0167] In some embodiments of this application, the second device may use the third vendor's public key to decrypt the third vendor's signature information to obtain the hash value of the first device's device certificate, i.e., the fifth hash value, and use a hash algorithm to calculate the first device's device public key to obtain the hash value of the first device's device certificate again, i.e., the sixth hash value.
[0168] In some embodiments of this application, if the third hash value is the same as the fourth hash value, it indicates that the vendor certificate of the third vendor is correct and complete. Then the second device can determine that the vendor certificate of the third vendor has passed the verification, that is, the second device has completed the identity verification of the vendor certificate of the third vendor. Then the second device continues to verify the identity of the device certificate of the first device.
[0169] In some embodiments of this application, if the third hash value and the fourth hash value are the same, it indicates that the first device is an electronic device from a third manufacturer, and the second device and the first device are electronic devices from different manufacturers. This can be understood as the parent certificate of the second device being the manufacturer certificate of the second manufacturer, and the parent certificate of the first device being the manufacturer certificate of the third manufacturer, and the manufacturer certificates of the second and third manufacturers are different.
[0170] In some embodiments of this application, if the third hash value is different from the fourth hash value, the second device determines that the second digital certificate verification has failed.
[0171] Step 2025: If the fifth hash value is the same as the sixth hash value, the second device determines that the second digital certificate verification is successful.
[0172] In some embodiments of this application, if the fifth hash value is the same as the sixth hash value, it indicates that the device certificate of the first device is correct and complete, and the second device can determine that the device certificate of the first device has passed the verification.
[0173] In some embodiments of this application, if the fifth hash value is the same as the sixth hash value, it indicates that the first device is the first device of the third manufacturer.
[0174] In some embodiments of this application, if the fifth hash value is different from the sixth hash value, the second device determines that the second digital certificate verification has failed.
[0175] Thus, for first and second devices from different manufacturers, after the first device transmits its own device certificate and the third manufacturer's manufacturer certificate to the second device, the second device uses the root certificate and manufacturer certificate in its own pre-stored digital certificate chain to verify the third manufacturer's manufacturer certificate and the first device's device certificate, thereby completing the identity authentication of the first device and improving the security of communication.
[0176] Step 203: If the verification of the second digital certificate is successful, the second device determines the communication key between the first device and the second device, and uses the communication key to communicate with the first device.
[0177] In some embodiments of this application, after the second device verifies the identity of the first device, the second device may perform end-to-end communication key negotiation with the first device to determine the communication key to be used when communicating with the first device later, and use the communication key to transmit data with the first device.
[0178] The communication method provided in this application constructs a multi-level certificate issuance system and pre-stores a digital certificate chain in the device. The pre-stored digital certificate chain is used to quickly verify the digital certificate, realizing fast and reliable authentication of devices from different manufacturers or the same manufacturer, as well as high-strength end-to-end encryption of the devices, thereby improving the security and communication efficiency of communication between two devices.
[0179] In some embodiments of this application, the step 203 above, "determining the communication key between the first device and the second device if the second digital certificate is verified successfully", can be specifically implemented through the following steps 2031 to 2037.
[0180] Step 2031: The second device receives the encrypted first random number from the first device.
[0181] In some embodiments of this application, after the first device broadcasts the second digital certificate, the second device verifies the second digital certificate. If the verification passes, the second device sends the first digital certificate to the first device. The first device verifies the first digital certificate. If the verification passes, the first device generates a first random number and encrypts the first random number using the device's public key to obtain an encrypted first random number. Then, the first device sends the encrypted first random number to the second device, and the second device receives the encrypted first random number from the first device.
[0182] Step 2032: The second device uses its private key to decrypt the encrypted first random number to obtain the second random number.
[0183] For example, assuming the first encrypted random number is encTa_1, the second device uses the device key of the second device to decrypt encTa_1 and obtain the second random number Ta_2.
[0184] Step 2033: The second device uses the device public key of the first device to encrypt the second random number and the third random number, respectively, to obtain the encrypted second random number and the encrypted third random number.
[0185] In some embodiments of this application, the second device may generate a 32-bit third random number.
[0186] For example, assuming the second random number is Ta_2 and the third random number is Ta_2, the second device can use the device public key of the first device to encrypt the second random number Ta_2 to obtain the encrypted second random number encTa_2, and use the device public key of the first device to encrypt the third random number Tb_1 to obtain the encrypted third random number encTb_1.
[0187] Step 2034: The second device sends an encrypted second random number and an encrypted third random number to the first device.
[0188] In some embodiments of this application, after the second device sends encrypted second and third random numbers to the first device, the first device can use its private key to decrypt the encrypted second and third random numbers to obtain a second and a fourth random number. Then, if the second random number is the same as the first random number, the first device can determine the communication key based on the first and fourth random numbers.
[0189] Step 2035: The second device receives the encrypted fourth random number from the first device.
[0190] Step 2036: The second device uses its private key to decrypt the encrypted fourth random number to obtain the fourth random number.
[0191] For example, the second device uses the device private key of the second device to encrypt the encrypted fourth random number encTb_2 to obtain the fourth random number Tb_2.
[0192] Step 2037: If the fourth random number is the same as the third random number, the second device determines the communication key based on the second random number and the third random number.
[0193] In some embodiments of this application, the aforementioned communication key is an encryption key used when the first device communicates with the second device, and can also be referred to as an end-to-end encryption key.
[0194] In some embodiments of this application, if the fourth random number is the same as the third random number, it indicates that the first device is authentic, that is, the second device has verified the authenticity of the first device.
[0195] In some embodiments of this application, the second device may use a hash algorithm to process the second random number and the third random number to obtain the communication key between the first device and the second device.
[0196] For example, the second device can calculate the sum of the second random number and the third random number, and process the sum using a hash algorithm to obtain the communication key.
[0197] For example, taking the third random number as Tb_1, the fourth random number as Tb_2, the second random number as Ta_2, the hash algorithm as SHA, and the communication key as linkey, when Tb_1 == Tb_2, the second device can determine the authenticity of the first device, and the second device can calculate the communication key between the first device and the second device as linkey = SHA(Ta_2 + Tb_1).
[0198] Thus, after the digital certificate exchange and verification between the first and second devices is completed, the second device can calculate the end-to-end encryption key between the first and second devices so as to perform encrypted transmission when communicating with the second device in the future. In this way, even if other devices steal the public key information during the communication process, they do not have the corresponding private key information and cannot interfere with the communication process, thereby improving the communication security between the first and second devices.
[0199] In some embodiments of this application, the communication method provided in the embodiments of this application may further include the following step 200.
[0200] Step 200: If the verification of the second digital certificate is successful, the second device sends the first digital certificate to the first device. The first digital certificate includes at least the device certificate of the second device.
[0201] In some embodiments of this application, if the verification passes, the second device verifies the identity of the first device and can send the first digital certificate to the first device. Then the first device performs the above steps 101 to 103 and other related steps.
[0202] It should be noted that step 200 can be executed after the verification in step 202 is passed.
[0203] In this way, the second device can exchange its digital certificate with the first device after verifying the first device's identity, which can reduce invalid operations.
[0204] Next, taking the example of a root certificate authority issuing a certificate for vendor A, and a certificate for device A and a certificate for device B issued by vendor A, and referring to Figure 5, we will describe the process of near-field communication certificate exchange and authentication between device A and device B of the same vendor A.
[0205] Device B verifies Device A: Device A broadcasts Device A's certificate, Device B receives Device A's certificate, and uses Manufacturer A's certificate to verify Device A's certificate. If the verification is successful, it means that Device A is Device A of Manufacturer A.
[0206] Device A verifies Device B: After Device B successfully verifies Device A's certificate, it transmits Device B's certificate to Device A. Device A then uses Vendor A's certificate to verify Device B's certificate. If the verification is successful, it means that Device B is Vendor B's Device B.
[0207] After device A and device B authenticate and verify each other, it can be determined that device A and device B are different devices from the same manufacturer, and the exchange of digital certificates between the two devices is completed based on the above process.
[0208] Next, taking as an example that the root certificate authority issues vendor A certificate and vendor B certificate, and vendor A issues device A certificate and vendor B issues device B certificate, the process of near-field communication certificate exchange and authentication between device A and device B from different vendors will be described with reference to Figure 6.
[0209] Device B verifies Device A: Device A broadcasts Device A's certificate and Vendor A's certificate. Device B receives Device A's certificate and Vendor A's certificate. Device B first uses the root certificate to verify Vendor A's certificate. If the verification is successful, it means that Device A is Vendor A's electronic device. Then, it uses the public key in Vendor A's certificate to verify Device A's certificate. After successful verification, Device B can determine that Device A is Vendor A's Device A.
[0210] Device A verifies Device B: After Device B verifies Device A's certificate and Vendor A's certificate, it transmits Device B's certificate and Vendor B's certificate to Device A. Device A first uses its root certificate to verify Vendor B's certificate. If the verification is successful, it means that Device B is Vendor B's electronic device. Then, it uses the public key in Vendor B's certificate to verify Device B's certificate. After successful verification, Device A can determine that Device B is Vendor B's Device B.
[0211] After mutual authentication and verification between device A and device B, it can be determined that device A and device B are trusted electronic devices from different manufacturers under the same root certificate issuance system, and the certificate exchange between the two devices is completed based on the above process.
[0212] Figure 7 is a flowchart illustrating the communication method provided in an embodiment of this application. Taking device A as the first device and device B as the second device, device A and device B are devices from the same manufacturer, and device A and device B establish a communication connection, the method may include the following steps 701 to 715.
[0213] Step 701: Device A sends Device A's certificate to Device B.
[0214] Step 702: Device B receives Device A's certificate and verifies Device A's certificate using the manufacturer's certificate.
[0215] Step 703: If the certificate of device A is verified, device B sends its certificate to device A.
[0216] Step 704: Device A receives Device B's certificate and verifies Device B's certificate using the manufacturer's certificate.
[0217] Step 705: If the certificate of device B is verified, device A uses the public key of device B to encrypt a 32-bit random number Ta_1 to obtain encTa_1.
[0218] Step 706: Device A sends encTa_1 to Device B.
[0219] Step 707: Device B receives encTa_1, decrypts it using Device B's private key to obtain Ta_2, and encrypts Ta_2 using Device A's public key to obtain encTa_2.
[0220] Step 708: Device B generates a 32-bit random number Tb_1 and encrypts Tb_1 using the public key of Device A to obtain encTb_1.
[0221] Step 709: Device B sends encTa_2 and encTb_1 to Device A.
[0222] Step 710: Device A receives encTa_2 and encTb_1, and decrypts encTa_2 and encTb_1 using Device A's private key to obtain Ta_2 and Tb_2 respectively.
[0223] Step 711: If Ta_1 == Ta_2, then device A can verify the authenticity of device B. Device A uses device B's public key to encrypt Tb_2 to obtain encTb_2.
[0224] Step 712: Device A sends encTb_2 to Device B.
[0225] Step 713: Device A calculates the end-to-end encryption key between devices, linkey = SHA(Ta_1 + Tb_2).
[0226] Step 714: Device B receives encTb_2 and decrypts encTb_2 using Device B's private key to obtain Tb_2. If Tb_1 == Tb_2, then Device B can verify the authenticity of Device A.
[0227] Step 715: Device B calculates the end-to-end encryption key between devices, linkey = SHA(Ta_2 + Tb_1).
[0228] In some embodiments of this application, after device A and device B generate an end-to-end encryption key, they can transmit encrypted communication data based on the negotiated end-to-end encryption key linkey. In this way, even if other devices can steal public key information during communication, they cannot complete man-in-the-middle spoofing without the corresponding private key, and the communication security is guaranteed.
[0229] In this embodiment, by pre-installing some digital certificates in the electronic device, fast and reliable authentication between devices from different manufacturers or devices from the same manufacturer, as well as high-strength end-to-end encryption, are achieved, improving the security and efficiency of device communication. In other words, this solution effectively implements a multi-level certificate issuance structure based on the PKI public key exchange system for authentication of devices from different manufacturers or devices from the same manufacturer, and end-to-end encryption, providing efficient and secure protection for device communication.
[0230] It should be noted that the specific implementation process of steps 701 to 715 above can be found in the relevant description of the above embodiments. To avoid repetition, this embodiment will not repeat the description here.
[0231] It should be noted that each of the above method embodiments, or various possible implementations of each method embodiment, can be executed individually or in combination of any two or more. The specific implementation can be determined according to actual usage requirements, and this application embodiment does not impose any restrictions on this.
[0232] The communication method provided in this application can be executed by a communication device. This application uses the example of a communication device executing the communication method to illustrate the communication device provided in this application.
[0233] Figure 8 is a schematic diagram of the structure of a communication device provided in an embodiment of this application. The communication device includes: a first receiving module 41, a first verification module 42, a first determining module 43, and a first communication module 44.
[0234] The first receiving module 41 is configured to receive a first digital certificate from the second device, wherein the first digital certificate includes at least the device certificate of the second device.
[0235] The first verification module 42 is used to verify the first digital certificate based on the pre-stored digital certificate chain. The digital certificate chain includes the device certificate of the first device and the manufacturer certificate of the first manufacturer. The first manufacturer is the issuing authority that issued the device certificate of the first device.
[0236] The first determining module 43 is used to determine the communication key between the first device and the second device if the first digital certificate is verified to be valid.
[0237] The first communication module 44 is used to communicate with the second device using a communication key.
[0238] In some embodiments of this application, the communication device further includes a broadcast module for broadcasting a second digital certificate before receiving a first digital certificate from a second device, the second digital certificate including at least the device certificate of the first device; wherein the first digital certificate is sent by the second device after the second digital certificate has been verified.
[0239] In some embodiments of this application, the first digital certificate includes a device certificate of the second device, wherein the device certificate of the second device includes the signature information of the first vendor and the device public key of the second device.
[0240] The aforementioned first verification module 42 is specifically used to decrypt the signature information of the first vendor based on the public key in the vendor certificate of the first vendor in the digital certificate chain to obtain a first hash value, and to hash the device public key of the second device to obtain a second hash value; and, if the first hash value and the second hash value are the same, to determine that the first digital certificate verification is successful.
[0241] In some embodiments of this application, the first digital certificate includes a device certificate of the second device and a vendor certificate of the second vendor. The second vendor is the issuing authority that issued the device certificate of the second device. The device certificate of the second device includes the signature information of the second vendor and the device public key of the second device. The vendor certificate of the second vendor includes the signature information of the issuing authority that issued the vendor certificate of the second vendor and the vendor public key of the second vendor. The digital certificate chain includes a root certificate.
[0242] The aforementioned first verification module 42 is specifically used to decrypt the signature information of the issuing authority that issued the second vendor certificate based on the public key in the root certificate to obtain a third hash value, and to hash the vendor public key of the second vendor to obtain a fourth hash value; and, if the third hash value and the fourth hash value are the same, to decrypt the signature information of the second vendor based on the vendor public key to obtain a fifth hash value, and to hash the device public key of the second device to obtain a sixth hash value; and, if the fifth hash value and the sixth hash value are the same, to determine that the first digital certificate verification has passed.
[0243] In some embodiments of this application, the first determining module 43 is specifically configured to: encrypt a first random number using the device public key of the second device to obtain an encrypted first random number; send the encrypted first random number to the second device; receive an encrypted second random number and an encrypted third random number from the second device; decrypt the encrypted second random number and the encrypted third random number using the device private key of the first device to obtain a second random number and a fourth random number, respectively; and determine a communication key based on the first random number and the fourth random number if the second random number is the same as the first random number.
[0244] In some embodiments of this application, the above-described apparatus further includes an encryption module and a transmission module.
[0245] The encryption module is used to encrypt the fourth random number using the public key of the second device, resulting in the encrypted fourth random number.
[0246] The sending module is used to send an encrypted fourth random number to the second device.
[0247] The communication device provided in this application embodiment achieves fast and reliable device authentication and end-to-end high-strength encryption by pre-storing a digital certificate chain in the device and using the pre-stored digital certificate chain to verify the digital certificates of other devices, thereby improving the security and efficiency of communication between two devices.
[0248] The communication device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device, augmented reality / virtual reality device, robot, wearable device, super mobile personal computer, netbook, or personal digital assistant, etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific device.
[0249] The communication device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.
[0250] The communication device provided in this application embodiment can implement the various processes implemented in the various embodiments of the communication method executed by the first device described above. To avoid repetition, these processes will not be described again here.
[0251] Figure 9 is a schematic diagram of the structure of a communication device provided in an embodiment of this application. The communication device includes: a second receiving module 51, a second verification module 52, a second determining module 53, and a second communication module 54.
[0252] The second receiving module 51 is used to receive a second digital certificate broadcast by the first device, wherein the second digital certificate includes at least the device certificate of the first device.
[0253] The second verification module 52 is used to verify the second digital certificate based on the pre-stored digital certificate chain. The digital certificate chain includes the device certificate of the second device and the manufacturer certificate of the second manufacturer. The second manufacturer is the issuing authority that issued the device certificate of the second device.
[0254] The second determining module 53 is used to determine the communication key between the first device and the second device if the second digital certificate is verified to be valid.
[0255] The second communication module 54 is used to communicate with the first device using a communication key.
[0256] In some embodiments of this application, the above-described apparatus further includes a sending module. This sending module is configured to send a first digital certificate to the first device upon successful verification of the second digital certificate. The first digital certificate includes at least the device certificate of the second device.
[0257] In some embodiments of this application, the second digital certificate includes the device certificate of the first device, which includes the signature information of the second vendor and the device public key of the first device.
[0258] The aforementioned second verification module 52 is specifically used to decrypt the signature information of the second vendor based on the public key in the vendor certificate of the second vendor in the digital certificate chain to obtain a first hash value, and to hash the device public key of the first device to obtain a second hash value; if the first hash value and the second hash value are the same, it is determined that the second digital certificate verification is successful.
[0259] In some embodiments of this application, the second digital certificate includes a device certificate of the first device and a vendor certificate of a third vendor. The third vendor is the issuing authority that issued the device certificate of the first device. The device certificate of the first device includes the signature information of the third vendor and the device public key of the first device. The vendor certificate of the third vendor includes the signature information of the issuing authority that issued the vendor certificate of the third vendor and the vendor public key of the third vendor. The digital certificate chain includes a root certificate.
[0260] The aforementioned second verification module 52 is specifically used to decrypt the signature information of the issuing authority of the third vendor's vendor certificate based on the public key in the root certificate to obtain a third hash value, and to hash the vendor's public key of the third vendor to obtain a fourth hash value; if the third hash value and the fourth hash value are the same, the third vendor's signature information is decrypted based on the vendor's public key to obtain a fifth hash value, and the device public key of the first device is hashed to obtain a sixth hash value; if the fifth hash value and the sixth hash value are the same, the second digital certificate verification is confirmed to be successful.
[0261] In some embodiments of this application, the second determining module 53 is specifically configured to: receive an encrypted first random number from the first device; decrypt the encrypted first random number using the device private key of the second device to obtain a second random number; encrypt the second random number and a third random number using the device public key of the first device to obtain encrypted second random number and encrypted third random number, respectively; send the encrypted second random number and encrypted third random number to the first device; receive an encrypted fourth random number from the first device; decrypt the encrypted fourth random number using the device private key of the second device to obtain a fourth random number; and determine a communication key based on the second random number and the third random number if the fourth random number is the same as the third random number.
[0262] The communication device provided in this application embodiment achieves fast and reliable device authentication and end-to-end high-strength encryption by pre-storing a digital certificate chain in the device and using the pre-stored digital certificate chain to verify the digital certificates of other devices, thereby improving the security and efficiency of communication between two devices.
[0263] The communication device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device, augmented reality / virtual reality device, robot, wearable device, super mobile personal computer, netbook, or personal digital assistant, etc., and can also be a server, network attached storage, personal computer, television set, ATM, or self-service machine, etc. This application embodiment does not specifically limit the scope of the device.
[0264] The communication device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.
[0265] The communication device provided in this application embodiment can implement the various processes implemented in the various embodiments of the communication method executed by the second device described above. To avoid repetition, these processes will not be described again here.
[0266] Optionally, as shown in FIG10, this application embodiment also provides an electronic device 900, including a processor 901 and a memory 902. The memory 902 stores a program or instructions that can be executed by the processor 901. When the program or instructions are executed by the processor 901, they implement the various steps of the communication method embodiments executed by the first device or the second device described above, and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0267] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0268] Figure 11 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of this application.
[0269] The electronic device 1000 includes, but is not limited to, components such as: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, and processor 1010.
[0270] Those skilled in the art will understand that the electronic device 1000 may also include a power supply (such as a battery) for powering various components. The power supply can be logically connected to the processor 1010 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in Figure 11 does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0271] The processor 1010 is configured to receive a first digital certificate from a second device, the first digital certificate including at least a device certificate of the second device; verify the first digital certificate based on a pre-stored digital certificate chain, the digital certificate chain including the device certificate of the first device and a vendor certificate of a first vendor, the first vendor being the issuing authority that issued the device certificate of the first device; if the verification of the first digital certificate passes, determine a communication key between the first device and the second device; and communicate with the second device using the communication key.
[0272] In some embodiments of this application, the processor 1010 is configured to broadcast a second digital certificate before receiving a first digital certificate from a second device, the second digital certificate including at least the device certificate of the first device; wherein the first digital certificate is sent by the second device after the second digital certificate has been verified.
[0273] In some embodiments of this application, the first digital certificate includes a device certificate of the second device, wherein the device certificate of the second device includes the signature information of the first vendor and the device public key of the second device.
[0274] The processor 1010 is specifically used to decrypt the signature information of the first vendor based on the public key in the vendor certificate of the first vendor in the digital certificate chain to obtain a first hash value, and to hash the device public key of the second device to obtain a second hash value; and, if the first hash value and the second hash value are the same, to determine that the first digital certificate verification is successful.
[0275] In some embodiments of this application, the first digital certificate includes a device certificate of the second device and a vendor certificate of the second vendor. The second vendor is the issuing authority that issued the device certificate of the second device. The device certificate of the second device includes the signature information of the second vendor and the device public key of the second device. The vendor certificate of the second vendor includes the signature information of the issuing authority that issued the vendor certificate of the second vendor and the vendor public key of the second vendor. The digital certificate chain includes a root certificate.
[0276] The processor 1010 is specifically configured to: decrypt the signature information of the issuing authority that issued the second vendor certificate based on the public key in the root certificate to obtain a third hash value; and hash the vendor public key of the second vendor to obtain a fourth hash value; and, if the third hash value and the fourth hash value are the same, decrypt the signature information of the second vendor based on the vendor public key to obtain a fifth hash value; and hash the device public key of the second device to obtain a sixth hash value; and, if the fifth hash value and the sixth hash value are the same, determine that the first digital certificate verification has passed.
[0277] In some embodiments of this application, the processor 1010 is specifically configured to: encrypt a first random number using the device public key of the second device to obtain an encrypted first random number; send the encrypted first random number to the second device; receive an encrypted second random number and an encrypted third random number from the second device; decrypt the encrypted second random number and the encrypted third random number using the device private key of the first device to obtain a second random number and a fourth random number, respectively; and determine a communication key based on the first random number and the fourth random number if the second random number is the same as the first random number.
[0278] In some embodiments of this application, the processor 1010 is configured to encrypt a fourth random number using the device public key of the second device to obtain an encrypted fourth random number; and send the encrypted fourth random number to the second device.
[0279] or,
[0280] In some embodiments of this application, the processor 1010 is configured to receive a second digital certificate broadcast by a first device, the second digital certificate including at least the device certificate of the first device; verify the second digital certificate based on a pre-stored digital certificate chain, the digital certificate chain including the device certificate of the second device and the vendor certificate of a second vendor, the second vendor being the issuing authority that issued the device certificate of the second device; if the verification of the second digital certificate passes, determine a communication key between the first device and the second device; and communicate with the first device using the communication key.
[0281] In some embodiments of this application, the processor 1010 is configured to send a first digital certificate to a first device if the verification of the second digital certificate is successful. The first digital certificate includes at least the device certificate of the second device.
[0282] In some embodiments of this application, the second digital certificate includes the device certificate of the first device, which includes the signature information of the second vendor and the device public key of the first device.
[0283] The processor 1010 is specifically used to decrypt the signature information of the second vendor based on the public key in the vendor certificate of the second vendor in the digital certificate chain to obtain a first hash value, and to hash the device public key of the first device to obtain a second hash value; if the first hash value and the second hash value are the same, it is determined that the second digital certificate verification is successful.
[0284] In some embodiments of this application, the second digital certificate includes a device certificate of the first device and a vendor certificate of a third vendor. The third vendor is the issuing authority that issued the device certificate of the first device. The device certificate of the first device includes the signature information of the third vendor and the device public key of the first device. The vendor certificate of the third vendor includes the signature information of the issuing authority that issued the vendor certificate of the third vendor and the vendor public key of the third vendor. The digital certificate chain includes a root certificate.
[0285] The processor 1010 is specifically used to decrypt the signature information of the issuing authority of the third vendor's vendor certificate based on the public key in the root certificate to obtain a third hash value, and to hash the vendor's public key to obtain a fourth hash value; if the third hash value and the fourth hash value are the same, the processor decrypts the signature information of the third vendor based on the vendor's public key to obtain a fifth hash value, and to hash the device public key of the first device to obtain a sixth hash value; if the fifth hash value and the sixth hash value are the same, the processor determines that the second digital certificate verification is successful.
[0286] In some embodiments of this application, the processor 1010 is specifically configured to: receive an encrypted first random number from a first device; decrypt the encrypted first random number using the device private key of a second device to obtain a second random number; encrypt the second random number and a third random number using the device public key of the first device to obtain encrypted second random number and encrypted third random number, respectively; send the encrypted second random number and encrypted third random number to the first device; receive an encrypted fourth random number from the first device; decrypt the encrypted fourth random number using the device private key of the second device to obtain a fourth random number; and determine a communication key based on the second random number and the third random number if the fourth random number is the same as the third random number.
[0287] It should be understood that, in this embodiment, the input unit 1004 may include a graphics processing unit (GPU) 10041 and a microphone 10042. The GPU 10041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1006 may include a display panel 10061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0288] The memory 1009 can be used to store software programs and various data. The memory 1009 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1009 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 109 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.
[0289] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into the processor 1010.
[0290] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the communication method embodiments executed by the first device or the second device described above, and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0291] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0292] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the communication method embodiments executed by the first device or the second device described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0293] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0294] This application provides a computer program product stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the communication method embodiments executed by the first device or the second device described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0295] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0296] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0297] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A communication method applied to a first device, the method comprising: Receive a first digital certificate from a second device, wherein the first digital certificate includes at least the device certificate of the second device; The first digital certificate is verified based on a pre-stored digital certificate chain, which includes the device certificate of the first device and the manufacturer certificate of the first manufacturer, the first manufacturer being the issuing authority that issued the device certificate of the first device. If the first digital certificate is verified and passes verification, a communication key between the first device and the second device is determined, and the communication key is used to communicate with the second device.
2. The method of claim 1, wherein, Before receiving the first digital certificate from the second device, the method further includes: Broadcast a second digital certificate, which includes at least the device certificate of the first device; The first digital certificate is sent by the second device after the second digital certificate has been verified.
3. The method of claim 1, wherein, The first digital certificate includes the device certificate of the second device, and the device certificate of the second device includes the signature information of the first manufacturer and the device public key of the second device; The verification of the first digital certificate based on the pre-stored digital certificate chain includes: Based on the public key in the vendor certificate of the first vendor in the digital certificate chain, the signature information of the first vendor is decrypted to obtain a first hash value, and the device public key of the second device is hashed to obtain a second hash value; If the first hash value is the same as the second hash value, the first digital certificate verification is deemed successful.
4. The method of claim 1, wherein, The first digital certificate includes the device certificate of the second device and the vendor certificate of the second vendor. The second vendor is the issuing authority that issued the device certificate of the second device. The device certificate of the second device includes the signature information of the second vendor and the device public key of the second device. The vendor certificate of the second vendor includes the signature information of the issuing authority that issued the vendor certificate of the second vendor and the vendor public key of the second vendor. The digital certificate chain includes a root certificate. The verification of the first digital certificate based on the pre-stored digital certificate chain includes: Based on the public key in the root certificate, the signature information of the issuing authority that issued the second vendor certificate is decrypted to obtain a third hash value, and the vendor public key of the second vendor is hashed to obtain a fourth hash value. If the third hash value is the same as the fourth hash value, the signature information of the second manufacturer is decrypted based on the manufacturer's public key to obtain the fifth hash value, and the device public key of the second device is hashed to obtain the sixth hash value. If the fifth hash value is the same as the sixth hash value, the first digital certificate is deemed to have passed verification.
5. The method according to any one of claims 1 to 4, wherein, If the verification of the first digital certificate passes, determining the communication key between the first device and the second device includes: The first random number is encrypted using the device public key of the second device to obtain the encrypted first random number. Send the encrypted first random number to the second device; Receive an encrypted second random number and an encrypted third random number from the second device; The encrypted second random number and the encrypted third random number are decrypted using the device private key of the first device to obtain the second random number and the fourth random number, respectively. If the second random number is the same as the first random number, the communication key is determined based on the first random number and the fourth random number.
6. A communication method applied to a second device, the method comprising: Receive a second digital certificate broadcast by the first device, wherein the second digital certificate includes at least the device certificate of the first device; The second digital certificate is verified based on a pre-stored digital certificate chain, which includes the device certificate of the second device and the manufacturer certificate of the second manufacturer, the second manufacturer being the issuing authority that issued the device certificate of the second device. If the second digital certificate is verified, a communication key between the first device and the second device is determined, and the communication key is used to communicate with the first device.
7. The method of claim 6, wherein, The method further includes: If the verification of the second digital certificate is successful, a first digital certificate is sent to the first device, wherein the first digital certificate includes at least the device certificate of the second device.
8. The method of claim 6, wherein, The second digital certificate includes the device certificate of the first device, and the device certificate of the first device includes the signature information of the second manufacturer and the device public key of the first device; The verification of the second digital certificate based on the pre-stored digital certificate chain includes: Based on the public key in the vendor certificate of the second vendor in the digital certificate chain, the signature information of the second vendor is decrypted to obtain a first hash value, and the device public key of the first device is hashed to obtain a second hash value; If the first hash value is the same as the second hash value, the second digital certificate verification is deemed successful.
9. The method of claim 6, wherein, The second digital certificate includes the device certificate of the first device and the vendor certificate of the third vendor. The third vendor is the issuing authority that issued the device certificate of the first device. The device certificate of the first device includes the signature information of the third vendor and the device public key of the first device. The vendor certificate of the third vendor includes the signature information of the issuing authority that issued the vendor certificate of the third vendor and the vendor public key of the third vendor. The digital certificate chain includes a root certificate. The verification of the second digital certificate based on the pre-stored digital certificate chain includes: Based on the public key in the root certificate, the signature information of the issuing authority that issued the vendor certificate of the third vendor is decrypted to obtain a third hash value, and the vendor public key of the third vendor is hashed to obtain a fourth hash value. If the third hash value is the same as the fourth hash value, the signature information of the third vendor is decrypted based on the vendor's public key to obtain the fifth hash value, and the device public key of the first device is hashed to obtain the sixth hash value. If the fifth hash value is the same as the sixth hash value, the second digital certificate is deemed to have passed verification.
10. The method according to any one of claims 6 to 9, wherein, If the verification of the second digital certificate passes, determining the communication key between the first device and the second device includes: Receive an encrypted first random number from the first device; The encrypted first random number is decrypted using the device private key of the second device to obtain the second random number; The second random number and the third random number are encrypted using the device public key of the first device to obtain the encrypted second random number and the encrypted third random number, respectively. Send the encrypted second random number and the encrypted third random number to the first device; Receive an encrypted fourth random number from the first device; The encrypted fourth random number is decrypted using the device private key of the second device to obtain the fourth random number. If the fourth random number is the same as the third random number, the communication key is determined based on the second random number and the third random number.
11. A communications device, the device comprising: The system comprises a first receiving module, a first verification module, a first determining module, and a first communication module. A first receiving module is configured to receive a first digital certificate from a second device, wherein the first digital certificate includes at least the device certificate of the second device. The first verification module is used to verify the first digital certificate based on a pre-stored digital certificate chain, wherein the digital certificate chain includes the device certificate of the first device and the manufacturer certificate of the first manufacturer, and the first manufacturer is the issuing authority that issued the device certificate of the first device. The first determining module is used to determine the communication key between the first device and the second device if the first digital certificate is verified to be valid. The first communication module is used to communicate with the second device using the communication key.
12. A communications device, the device comprising: The system comprises a second receiving module, a second verification module, a second determining module, and a second communication module. The second receiving module is configured to receive a second digital certificate broadcast by the first device, wherein the second digital certificate includes at least the device certificate of the first device. The second verification module is used to verify the second digital certificate based on a pre-stored digital certificate chain, wherein the digital certificate chain includes the device certificate of the second device and the manufacturer certificate of the second manufacturer, and the second manufacturer is the issuing authority that issued the device certificate of the second device. The second determining module is used to determine the communication key between the first device and the second device if the verification of the second digital certificate passes. The second communication module is used to communicate with the first device using the communication key.
13. An electronic device comprising a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the communication method as claimed in any one of claims 1 to 10.
14. A readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the communication method as claimed in any one of claims 1 to 10.
15. A chip comprising a processor and a communication interface, the communication interface being coupled to the processor, the processor being configured to run a program or instructions to implement the communication method as described in any one of claims 1 to 10.
16. A computer program product stored in a storage medium, the computer program product being executed by at least one processor to implement the communication method as claimed in any one of claims 1 to 10.
