Key retrieval method, device and equipment and storage medium

By generating key identifiers in the blockchain system and mapping them to key storage tags, the problem of low key retrieval efficiency of hardware encryption devices in the blockchain system is solved, and key retrieval adaptation between devices is realized. Improved efficiency and stability.

CN118797675APending Publication Date: 2024-10-18CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410044273.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-11
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In blockchain systems that use hardware encryption, key retrieval efficiency is low, causing the encryption device to perform additional work to adapt to the key search logic of the blockchain system, increasing development costs and system stability risks.

Method used

The first device and the second device are implemented by generating a key identifier corresponding to the public key on the first device and requesting the private key from the second device based on the mapping relationship between the key identifier and the key storage tag. The key retrieval adaptation between them simplifies the key search process.

Benefits of technology

It improves the efficiency of key retrieval, reduces the adaptation workload and cost when introducing new devices, and reduces development complexity and system stability risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118797675A_ABST
    Figure CN118797675A_ABST
Patent Text Reader

Abstract

The invention provides a key retrieval method and device, equipment and a storage medium, and relates to the technical field of key retrieval. The method comprises the following steps: generating a first key identifier corresponding to a first public key according to the first public key; according to the mapping relation between the at least one key identifier and the at least one key storage label, a first key storage label corresponding to the first key identifier is determined, the first key identifier is one of the at least one key identifier, and the first key storage label is one of the at least one key storage label; the key identifiers are in one-to-one correspondence with the key storage tags; sending first request information to a second device, wherein the first request information is used for requesting the second device to feed back a first private key corresponding to the first key storage tag; and receiving first feedback information sent by the second equipment, wherein the first feedback information carries the first private key. According to the scheme provided by the invention, the problem that the key retrieval efficiency is relatively low when hardware encryption is used in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of key retrieval, and in particular to a key retrieval method, device, equipment and storage medium. Background Art

[0002] Hardware encryption is implemented through dedicated encryption chips or hardware modules, which can provide higher security, faster processing speed, lower power consumption and better anti-attack performance. Therefore, hardware encryption is the first choice in many security applications and sensitive data processing.

[0003] Among them, in a blockchain system using hardware encryption, when the encryption device generates a key pair, a unique key storage label (i.e., KeyLabel, the specific content of which is generally determined by the encryption device according to its own needs) is generated for the key pair inside the encryption device according to certain rules and transmitted. The KeyLabel is used as an index for subsequent search and use of private keys, while the private key used for signing is stored in the hardware encryption device. As a general system, the blockchain generally does not store the KeyLabel transmitted by the encryption device, but uses the Subject Key Identifier (SKI) generated based on the public key factor (i.e., the public key) to perform key search according to its own rules. Therefore, when the blockchain system supports hardware device encryption, it is difficult to naturally adapt to the key search process of the encryption device, and usually requires the encryption device to perform additional work (such as modifying the key search logic of the encryption device according to the rules of the blockchain). This change in the search method will reduce the efficiency of key search and use. Summary of the invention

[0004] The purpose of the present invention is to provide a key retrieval method, device, equipment and storage medium, which solves the problem of low key retrieval efficiency when using hardware encryption in related technologies.

[0005] To achieve the above object, an embodiment of the present invention provides a key retrieval method, which is applied to a first device and includes:

[0006] Generate a first key identifier corresponding to the first public key according to the first public key;

[0007] Determine, according to a mapping relationship between at least one key identifier and at least one key storage tag, a first key storage tag corresponding to the first key identifier, wherein the first key identifier is one of the at least one key identifier, the first key storage tag is one of the at least one key storage tags, and the key identifier and the key storage tag have a one-to-one correspondence;

[0008] Sending a first request message to a second device, where the first request message is used to request the second device to feedback a first private key corresponding to the first key storage tag;

[0009] Receive first feedback information sent by the second device, where the first feedback information carries the first private key.

[0010] Optionally, the method further comprises:

[0011] Sending second request information to the second device, where the second request information is used to request the second device to generate a key pair;

[0012] receiving second feedback information sent by the second device, where the second feedback information carries the public key in the key pair and the key storage tag corresponding to the key pair;

[0013] Generate the key identifier corresponding to the public key according to the public key;

[0014] A mapping relationship is established between the key storage tag corresponding to the key pair and the key identifier corresponding to the public key.

[0015] Optionally, before generating, according to the first public key, a first key identifier corresponding to the first public key, the method further includes:

[0016] Obtaining a digital certificate corresponding to the first public key, wherein the digital certificate is generated by the first device or a third device according to the first public key, and the third device is a device trusted by both the first device and the second device;

[0017] The digital certificate is parsed to obtain the first public key.

[0018] Optionally, generating the key identifier corresponding to the public key according to the public key includes:

[0019] A hash operation is performed on the public key to generate the key identifier corresponding to the public key.

[0020] Optionally, after generating the key identifier corresponding to the public key according to the public key, the method further includes:

[0021] Performing a modulo operation on the key identifier corresponding to the public key to obtain an operation result i, wherein N is the length of the target set, and N and i are both integers;

[0022] When the i-th element of the target set is empty, the key storage tag corresponding to the public key and the key pair is used as the i-th element of the target set. When the i-th element of the target set is not empty, the first empty target element after the i-th element is searched, and the key storage tag is used as the target element.

[0023] Optionally, after receiving the second feedback information sent by the second device, the method further includes:

[0024] The key storage tag corresponding to the public key and the key pair is written to a disk in the form of a file.

[0025] To achieve the above object, an embodiment of the present invention provides a key retrieval method, which is applied to a second device and includes:

[0026] receiving first request information sent by the first device, where the first request information is used to request the second device to feedback a first private key corresponding to the first key storage tag;

[0027] Acquire, according to the first request information, the first private key corresponding to the first key storage tag;

[0028] Sending first feedback information to the first device, where the first feedback information carries the first private key.

[0029] Optionally, the method further comprises:

[0030] receiving second request information sent by the first device, where the second request information is used to request the second device to generate a key pair;

[0031] Generate the key pair and the key storage tag corresponding to the key pair according to the second request information, wherein the key pair includes a public key and a private key;

[0032] Sending second feedback information to the first device, where the second feedback information carries the public key in the key pair and the key storage tag corresponding to the key pair.

[0033] To achieve the above object, an embodiment of the present invention provides a key retrieval device, applied to a first device, comprising:

[0034] A first processing module, configured to generate a first key identifier corresponding to the first public key according to the first public key;

[0035] a second processing module, configured to determine, according to a mapping relationship between at least one key identifier and at least one key storage label, a first key storage label corresponding to the first key identifier, wherein the first key identifier is one of the at least one key identifier, the first key storage label is one of the at least one key storage label, and the key identifier corresponds to the key storage label in one-to-one manner;

[0036] A first sending module, configured to send a first request message to a second device, wherein the first request message is used to request the second device to feedback a first private key corresponding to the first key storage tag;

[0037] The first receiving module is used to receive first feedback information sent by the second device, where the first feedback information carries the first private key.

[0038] Optionally, the device further comprises:

[0039] A third sending module, used to send second request information to the second device, where the second request information is used to request the second device to generate a key pair;

[0040] A third receiving module is used to receive second feedback information sent by the second device, where the second feedback information carries the public key in the key pair and the key storage tag corresponding to the key pair;

[0041] A fourth processing module, configured to generate the key identifier corresponding to the public key according to the public key;

[0042] The fifth processing module is used to establish a mapping relationship between the key storage tag corresponding to the key pair and the key identifier corresponding to the public key.

[0043] Optionally, the device further comprises:

[0044] a certificate acquisition module, configured to acquire a digital certificate corresponding to the first public key, wherein the digital certificate is generated by the first device or a third device according to the first public key, and the third device is a device trusted by both the first device and the second device;

[0045] The certificate parsing module is used to parse the digital certificate to obtain the first public key.

[0046] Optionally, the fourth processing module includes:

[0047] The first processing submodule is used to perform a hash operation on the public key to generate the key identifier corresponding to the public key.

[0048] Optionally, the device further comprises:

[0049] A second processing submodule is used to perform a modulo operation on the key identifier corresponding to the public key to obtain an operation result i, where N is the length of the target set, and N and i are both integers;

[0050] The third processing submodule is used to, when the i-th element of the target set is empty, use the key storage tag corresponding to the public key and the key pair as the i-th element of the target set; when the i-th element of the target set is not empty, search for the first empty target element after the i-th element and use the key storage tag as the target element.

[0051] Optionally, the device further comprises:

[0052] The data storage module is used to write the key storage tag corresponding to the public key and the key pair into a disk in the form of a file.

[0053] To achieve the above object, an embodiment of the present invention provides a key retrieval device, applied to a second device, comprising:

[0054] A second receiving module is used to receive a first request message sent by the first device, where the first request message is used to request the second device to feedback a first private key corresponding to the first key storage tag;

[0055] A third processing module, configured to obtain, according to the first request information, the first private key corresponding to the first key storage tag;

[0056] The second sending module is used to send first feedback information to the first device, where the first feedback information carries the first private key.

[0057] Optionally, the device further comprises:

[0058] a fourth receiving module, configured to receive second request information sent by the first device, where the second request information is used to request the second device to generate a key pair;

[0059] a sixth processing module, configured to generate the key pair and the key storage tag corresponding to the key pair according to the second request information, wherein the key pair includes a public key and a private key;

[0060] The fourth sending module is used to send second feedback information to the first device, where the second feedback information carries the public key in the key pair and the key storage tag corresponding to the key pair.

[0061] To achieve the above objective, an embodiment of the present invention provides a device, which is a first device and includes a processor and a transceiver, wherein the processor is configured to:

[0062] Generate a first key identifier corresponding to the first public key according to the first public key;

[0063] Determine, according to a mapping relationship between at least one key identifier and at least one key storage tag, a first key storage tag corresponding to the first key identifier, wherein the first key identifier is one of the at least one key identifier, the first key storage tag is one of the at least one key storage tags, and the key identifier and the key storage tag have a one-to-one correspondence;

[0064] Sending a first request message to a second device, where the first request message is used to request the second device to feedback a first private key corresponding to the first key storage tag;

[0065] Receive first feedback information sent by the second device, where the first feedback information carries the first private key.

[0066] Optionally, the processor is further configured to:

[0067] Sending second request information to the second device, where the second request information is used to request the second device to generate a key pair;

[0068] receiving second feedback information sent by the second device, where the second feedback information carries the public key in the key pair and the key storage tag corresponding to the key pair;

[0069] Generate the key identifier corresponding to the public key according to the public key;

[0070] A mapping relationship is established between the key storage tag corresponding to the key pair and the key identifier corresponding to the public key.

[0071] Optionally, the processor is further configured to:

[0072] Obtaining a digital certificate corresponding to the first public key, wherein the digital certificate is generated by the first device or a third device according to the first public key, and the third device is a device trusted by both the first device and the second device;

[0073] The digital certificate is parsed to obtain the first public key.

[0074] Optionally, when the processor generates the key identifier corresponding to the public key according to the public key, it is further configured to:

[0075] A hash operation is performed on the public key to generate the key identifier corresponding to the public key.

[0076] Optionally, the processor is further configured to:

[0077] Performing a modulo operation on the key identifier corresponding to the public key to obtain an operation result i, wherein N is the length of the target set, and N and i are both integers;

[0078] When the i-th element of the target set is empty, the key storage tag corresponding to the public key and the key pair is used as the i-th element of the target set. When the i-th element of the target set is not empty, the first empty target element after the i-th element is searched, and the key storage tag is used as the target element.

[0079] Optionally, the processor is further configured to:

[0080] The key storage tag corresponding to the public key and the key pair is written to a disk in the form of a file.

[0081] To achieve the above objective, an embodiment of the present invention provides a device, which is a second device and includes a processor and a transceiver, wherein the processor is configured to:

[0082] receiving first request information sent by the first device, where the first request information is used to request the second device to feedback a first private key corresponding to the first key storage tag;

[0083] Acquire, according to the first request information, the first private key corresponding to the first key storage tag;

[0084] Sending first feedback information to the first device, where the first feedback information carries the first private key.

[0085] Optionally, the processor is further configured to:

[0086] receiving second request information sent by the first device, where the second request information is used to request the second device to generate a key pair;

[0087] Generate the key pair and the key storage tag corresponding to the key pair according to the second request information, wherein the key pair includes a public key and a private key;

[0088] Sending second feedback information to the first device, where the second feedback information carries the public key in the key pair and the key storage tag corresponding to the key pair.

[0089] To achieve the above-mentioned purpose, an embodiment of the present invention provides a device, including a transceiver, a processor, a memory, and a program or instruction stored in the memory and executable on the processor; when the processor executes the program or instruction, it implements the key retrieval method applied to the first device as above, or implements the key retrieval method applied to the second device as above.

[0090] To achieve the above-mentioned purpose, an embodiment of the present invention provides a readable storage medium having a program or instruction stored thereon, which, when executed by a processor, implements the steps of the key retrieval method applied to the first device as above, or the steps of the key retrieval method applied to the second device as above.

[0091] The beneficial effects of the above technical solution of the present invention are as follows:

[0092] According to the method of the embodiment of the present invention, when the first device needs to use the first private key stored on the second device, it can generate the first key identifier according to the first public key, and then determine the first key storage tag corresponding to the first key identifier according to the mapping relationship between the key identifier and the key storage tag. After that, the first device obtains the first private key corresponding to the first key storage tag by sending the first request information to the second device. In the key retrieval process, the first key identifier on the first device can be mapped to the first key storage tag on the second device through the mapping relationship between the key identifier and the key storage tag, so as to request the second device to retrieve the first private key on the second device with the first key storage tag and feed it back to the first device, so as to realize the adaptation work between the first device and the second device, so that when the first device needs to use the first private key, it can simply and conveniently realize the retrieval of the first private key, thereby improving the key retrieval efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0093] Figure 1 The process of generating and storing key pairs in the related technology;

[0094] Figure 2 The process of using private keys in related technologies;

[0095] Figure 3 is a flow chart of a key retrieval method according to an embodiment of the present invention;

[0096] Figure 4 A key pair generation and storage process for an adapter introduced in an embodiment of the present invention;

[0097] Figure 5 The private key usage process of the adapter introduced in the embodiment of the present invention;

[0098] Figure 6 An adapter generation process for an embodiment of the present invention;

[0099] Figure 7 The adapter usage process of the embodiment of the present invention;

[0100] Figure 8 A flowchart of a key retrieval method according to another embodiment of the present invention;

[0101] Fig. 9 is a structural diagram of a key retrieval device according to an embodiment of the present invention;

[0102] Fig.10 A structural diagram of a key retrieval device according to another embodiment of the present invention;

[0103] Fig.11 is a structural diagram of a device according to an embodiment of the present invention;

[0104] Fig.12 This is a structural diagram of a device according to another embodiment of the present invention. DETAILED DESCRIPTION

[0105] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0106] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present invention. Therefore, the references to "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0107] In various embodiments of the present invention, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0108] Additionally, the terms "system" and "network" are often used interchangeably herein.

[0109] In the embodiments provided in the present application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.

[0110] With the implementation of the "Cryptography Law", the requirements for cryptographic applications in key areas such as finance and government affairs have become more stringent. Blockchain engines need to support hardware encryption to adapt to policy and market changes, thereby promoting the rapid popularization and development of blockchain technology.

[0111] The cryptographic module plays a very important role in the blockchain. It is mainly responsible for implementing the basic cryptographic algorithms that support the operation of the platform. Through the user's identity authentication and permission access mechanism, it realizes the traceability, non-forgeability, openness and transparency of the blockchain.

[0112] However, the implementation plans for hardware encryption support in various blockchain projects are different. Even the same blockchain technology has different cryptographic solutions in different projects, resulting in great obstacles to the interconnection and interoperability between projects. Moreover, the current blockchain hardware support solutions are difficult to easily introduce new manufacturers' equipment in specific application scenarios, making it difficult to meet the needs of different organizations to freely choose equipment from different manufacturers.

[0113] The hardware device key process currently used by the blockchain system is as follows:

[0114] In a blockchain system that uses hardware encryption devices, in order to ensure key security, the private key needs to be stored in the hardware device, and the corresponding public key is stored in the blockchain system in the form of a digital certificate. When an operation related to the private key (such as signing) needs to be performed, the public key is parsed from the certificate, the SKI is generated through the public key, the private key is searched and used to perform related operations in the device, and then the operation results are returned to the blockchain system.

[0115] The specific process of key generation and use is as follows:

[0116] from Figure 1 and Figure 2 It can be seen that in order to adapt to the blockchain system, the device needs to do extra work to change the key pair generation and search process. Figure 1 In , after generating a key pair, the device must follow the logic of the blockchain system and use the public key to regenerate and update the KeyLabel to ensure that the KeyLabel is consistent with the SKI. The update of the KeyLabel will inevitably lead to a change in the key search logic and affect the efficiency of the key search. Figure 2 In the new logic, the device needs to use the SKI passed in by the blockchain as the KeyLabel, search for the private key under the new logic, and complete the requested private key operation. These changes increase the workload of device manufacturers, increase the cost of introducing new devices, and affect the development efficiency, software quality, and system stability during the adaptation process.

[0117] like Figure 3 As shown, a key retrieval method according to an embodiment of the present invention is applied to a first device, including:

[0118] Step 301: Generate a first key identifier corresponding to a first public key according to the first public key.

[0119] It should be noted that the key retrieval method of the embodiment of the present invention can be applied to the blockchain system, and can also be applied to other systems that support hardware encryption. Here, the first device can be a blockchain node, or other devices that support hardware encryption. In the following embodiments, the first device is taken as an example of a blockchain node, and the key identifier can be a SKI generated by the blockchain node according to the public key.

[0120] It should be noted that the first public key is generated by the second device and then sent to the first device. The second device refers to the hardware device in hardware encryption, that is, the encryption device. The second device can generate a key pair for the first device. The key pair includes a public key (such as the first public key) and a private key. The second device will send the public key in the key pair to the first device and store the private key in the key pair on the second device. After receiving the first public key, the first device can generate a digital certificate corresponding to the first public key by itself or request a third party (such as a third device) to generate a digital certificate corresponding to the first public key for use when exchanging information with other devices.

[0121] In some embodiments, before step 301, the method further includes: obtaining a digital certificate corresponding to the first public key; parsing the digital certificate to obtain the first public key. The digital certificate is generated by the first device or a third device according to the first public key, and the third device is a device that is trusted by both the first device and the second device.

[0122] Step 302: determining a first key storage tag corresponding to the first key identifier according to a mapping relationship between at least one key identifier and at least one key storage tag, wherein the first key identifier is one of the at least one key identifier, the first key storage tag is one of the at least one key storage tags, and the key identifier and the key storage tag have a one-to-one correspondence;

[0123] Step 303: Send a first request message to the second device, where the first request message is used to request the second device to feedback a first private key corresponding to the first key storage tag.

[0124] It should be noted that the first private key is stored on the second device. Therefore, when the first device needs to use the first private key, it needs to send a request to the second device to retrieve the first private key from the second device. In some embodiments, the first request information in step 303 may carry a first key storage tag, which is a search factor unique to the encryption device (i.e., the second device) and can be used to search for the key on the second device. Therefore, sending the first request information to the second device can request the second device to feedback the first private key corresponding to the first key storage tag.

[0125] Step 304: Receive first feedback information sent by the second device, where the first feedback information carries the first private key.

[0126] In this embodiment, when the first device needs to use the first private key stored on the second device, it can generate a first key identifier based on the first public key, and then determine the first key storage tag corresponding to the first key identifier based on the mapping relationship between the key identifier and the key storage tag. After that, the first device obtains the first private key corresponding to the first key storage tag by sending a first request message to the second device. In the key retrieval process, the first key identifier on the first device can be mapped to the first key storage tag on the second device through the mapping relationship between the key identifier and the key storage tag, so as to request the second device to retrieve the first private key on the second device with the first key storage tag and feed it back to the first device, thus realizing the adaptation work between the first device and the second device, so that when the first device needs to use the first private key, it can simply and conveniently realize the retrieval of the first private key, thereby improving the key retrieval efficiency.

[0127] In the key retrieval method of the embodiment of the present invention, when a new device is introduced, no new logic needs to be added to the blockchain engine, and only a new mapping relationship needs to be added to the first device. In this way, the cost of supporting the newly introduced hardware encryption device can be simplified, the adaptation workload can be reduced, and blockchain users can more easily choose the encryption device that suits them based on cost, performance, etc.

[0128] In some specific embodiments, the method further comprises:

[0129] Step 1: Send a second request message to the second device, where the second request message is used to request the second device to generate a key pair.

[0130] Step 2: Receive second feedback information sent by the second device, where the second feedback information carries the public key in the key pair and the key storage tag corresponding to the key pair.

[0131] In some embodiments, after step 2, the method further includes: writing the key storage tag corresponding to the public key and the key pair to a disk in the form of a file. In this way, if the first device is restarted due to power failure or other reasons, all public keys and key storage tags stored in the disk can be read to regenerate the mapping relationship.

[0132] Step 3: Generate the key identifier corresponding to the public key based on the public key.

[0133] As a preferred embodiment, step 3 may specifically include: performing a hash operation on the public key to generate the key identifier corresponding to the public key.

[0134] Step 4: Establish a mapping relationship between the key storage tag corresponding to the key pair and the key identifier corresponding to the public key.

[0135] In some embodiments, after generating the key identifier corresponding to the public key according to the public key, the method further includes:

[0136] Perform a modulo operation on the key identifier corresponding to the public key to obtain an operation result i, where N is the length of the target set, and N and i are both integers; when the i-th element of the target set is empty, use the key storage tag corresponding to the public key and the key pair as the i-th element of the target set, and when the i-th element of the target set is not empty, find the first empty target element after the i-th element, and use the key storage tag as the target element.

[0137] It should be noted that the target set may be initialized when the first device is started, and may be used to store the mapping relationship between the key identifier and the key storage tag.

[0138] It should also be noted that when the first device generates the key identifier corresponding to the public key, a hash operation can be used. In this way, the key identifier can be used to perform a modulus operation on N to quickly find and locate the empty elements in the target set, thereby quickly storing the mapping relationship and reducing the impact on the processing performance of the first device.

[0139] In the above embodiment, Figure 4-Figure 5 As shown, after the first device receives the public key and key storage tag sent by the second device, it can generate a key identifier through the public key and perform a one-to-one mapping between the key identifier and the key storage tag. In the subsequent process, if the first device needs to use the private key, it can parse the public key from the digital certificate, generate a key identifier through the public key, map the key identifier to the key storage tag according to the mapping relationship, and finally complete the private key search process in the second device through the key storage tag, and then use the private key to perform related operations.

[0140] As an optional embodiment, an adapter can be added to the first device to implement a one-to-one mapping between a key identifier (taking the blockchain key identifier SKI as an example) and a key storage label (that is, the device key identifier KeyLabel). The rules for the adapter mapping are as follows:

[0141] (1) The adapter maintains a target set, which is represented by an association between a value and a key. The value can be retrieved using the corresponding key. In some specific implementations, SKI can be used as the key and KeyLabel as the corresponding value.

[0142] (2) The target set can realize the reading of elements at any position, so that the mapping between keys and values ​​is not affected by the size of the target set, thereby achieving constant time access and avoiding affecting the efficiency of existing systems (such as blockchain). In some specific implementations, a hash table can be used to directly locate the storage location.

[0143] (3) The length of the target set is not fixed, and the target set can be expanded when necessary. For example, in some specific implementations, the expansion can be completed by reapplying for an array with a larger space and copying the contents of the original target set.

[0144] (4) The keys in the target set can minimize retrieval conflicts through randomness. In some specific implementations, the SKI generation rules of the blockchain engine can naturally meet this randomness requirement for keys.

[0145] Based on the above design principles, a key identifier adapter can be added to the blockchain system so that the SKI of the blockchain itself can be mapped to the KeyLabel of the hardware device through the adapter, thereby achieving seamless adaptation of the device key search process. In this way, when a new device needs to be introduced into the blockchain system, the relevant mapping rules can be added to the adapter without changing the key search process of the blockchain engine and the device.

[0146] The following is a description of the target collection generation and usage process in the adapter.

[0147] (a) If Figure 6 As shown, the adapter can be generated by the following steps (including the stored procedure of the mapping relationship):

[0148] Step 1: When the first device (such as a blockchain node) starts, a set S (i.e., a target set) of length N is initialized.

[0149] Step 2: When the blockchain node requests the hardware device (i.e., the second device) to generate a key pair, the second device generates a key pair (including a public key and a private key) and returns the public key and KeyLabel to the blockchain node.

[0150] It should be noted that after receiving the public key and KeyLabel, the blockchain node can write the public key and KeyLabel to the disk in the form of a file, so that when the blockchain node is restarted, the public key and KeyLabel in the disk can be used to restore the adapter data (that is, the above-mentioned mapping relationship).

[0151] Step 3: The blockchain node performs a hash operation on the public key (public key factor) to generate SKI, and uses SKI to perform a modulo operation on N (that is, the length of the target set) to obtain the modulo operation result: i.

[0152] Step 4: If the position i in the set is free, that is, the i-th element in the set is empty, update the set element S(i) = (SKI, KeyLabel).

[0153] Step 5, if the position i in the set is occupied, set i=i+1 until a free position is found (that is, the first empty target element after the i-th element in the set, such as j), and then update the set element S(j)=(SKI,KeyLabel).

[0154] Through the above steps, a new SKI-->KeyLabel mapping relationship can be added in the adapter. After that, wait for the next reception of the public key and KeyLabel.

[0155] It should be noted that if the blockchain node is restarted due to power outage or other reasons, all public keys and KeyLables stored on the disk in step 2 can be read in sequence, and then all mapping relationships in the adapter can be regenerated according to steps 3 to 5.

[0156] (ii) Figure 7 As shown, the adapter usage includes the following steps (including the reading process of the mapping relationship):

[0157] Step 1: When a blockchain node needs to perform private key-related operations (such as signing), the public key is parsed from the digital certificate corresponding to the private key.

[0158] Step 2, perform a hash operation on the public key to generate SKI, and use SKI to perform a modulo operation on N, and the modulo operation result is: i.

[0159] Step 3, take out the SKI value from position i (that is, the i-th element of the target set) and compare it with the current SKI (that is, the SKI calculated in step 2).

[0160] Step 4, if they are the same, take out the KeyLabel from position i.

[0161] Afterwards, the KeyLabel may be used as a private key index to request related private key operations (such as searching for the private key corresponding to the KeyLabel) from the second device.

[0162] Step 5: If they are different, set i=i+1, compare the SKI value in position i with the current SKI, and repeat step 5 until they are the same (for example, the SKI value in position j is the same as the current SKI). Take out the KeyLabel from position j, and then use the KeyLabel as the private key index to request the second device to perform related private key operations (such as searching for the private key corresponding to the KeyLabel).

[0163] Through the above steps, the private key can be retrieved simply and quickly. In this way, when a blockchain system using the adapter solution introduces new hardware devices, the blockchain engine and device manufacturers no longer need to do additional adaptation work for the key search process, which reduces the cost of introducing new devices and has a beneficial impact on the development efficiency, software quality and system stability during the adaptation process, allowing different organizations to choose different encryption devices according to their needs.

[0164] It should be noted that with the increasingly stringent requirements for cryptographic applications in key areas such as finance and government affairs, the support of blockchain systems for hardware encryption is becoming increasingly important. There are many encryption equipment manufacturers on the market, and the performance and price vary greatly. After the key retrieval method of the embodiment of the present invention adds an adapter to the first device (or adds the above-mentioned mapping relationship), the second device (i.e., the hardware encryption device) no longer needs to perceive the existence of SKI, and it does not need to pay attention to the internal logic of the blockchain system, nor does it need to change the generation and search process of the key pair, which greatly simplifies the cost of supporting the newly introduced hardware encryption devices and reduces the workload of adapting the blockchain system.

[0165] The key retrieval method of this embodiment adds a corresponding mapping relationship on the first device according to the search factor (KeyLabel) unique to the encryption device (i.e., the second device), so that the first device can adapt to the key search process of the encryption device, so that when the first device needs to use the first private key, it can simply and conveniently retrieve the first private key according to the mapping relationship, thereby improving the key retrieval efficiency.

[0166] like Figure 8 As shown, a key retrieval method according to an embodiment of the present invention is applied to a second device, including:

[0167] Step 801: Receive first request information sent by a first device, where the first request information is used to request the second device to feedback a first private key corresponding to a first key storage tag.

[0168] It should be noted that the key retrieval method of the embodiment of the present invention can be applied to the blockchain system, and can also be applied to other systems that support hardware encryption. Here, the first device can specifically be a blockchain node, or other devices that support hardware encryption.

[0169] Step 802: acquiring the first private key corresponding to the first key storage tag according to the first request information;

[0170] Step 803: Send first feedback information to the first device, where the first feedback information carries the first private key.

[0171] In this embodiment, the first request information is used to request the second device to feedback the first private key corresponding to the first key storage tag. Therefore, after receiving the first request information, the second device can retrieve the first private key with the first key storage tag and feedback it to the first device without the second device performing additional adaptation work, thereby reducing the adaptation workload and improving the key retrieval efficiency.

[0172] Optionally, the method further comprises:

[0173] Receive a second request message sent by the first device, where the second request message is used to request the second device to generate a key pair; generate the key pair and the key storage tag corresponding to the key pair according to the second request message, where the key pair includes a public key and a private key; and send a second feedback message to the first device, where the second feedback message carries the public key in the key pair and the key storage tag corresponding to the key pair.

[0174] In this embodiment, the second device can generate a key pair and a key storage label (KeyLabel) according to the original logic, and then return the public key in the key pair and the KeyLabel to the first device. After receiving the public key and KeyLabel, the second device can establish a mapping relationship between the key identifier and the key storage label after a series of processing, wherein the key identifier is generated by the first device according to the public key. In this way, when the first device needs to use the first private key stored on the second device, it can determine the corresponding KeyLabel according to the mapping relationship, and then request the second device to feedback the private key corresponding to the KeyLabel, thereby realizing the adaptation work between the first device and the second device, so that when the first device needs to use the first private key, it can simply and conveniently retrieve the first private key, thereby improving the key retrieval efficiency.

[0175] In the key retrieval method of this embodiment, after receiving the first request information, the second device can retrieve the first private key with the first key storage tag and feed it back to the first device without the second device doing additional adaptation work, thereby reducing the adaptation workload and improving the key retrieval efficiency.

[0176] like Fig. 9 As shown, a key retrieval device according to an embodiment of the present invention is applied to a first device, including:

[0177] A first processing module 910 is configured to generate a first key identifier corresponding to the first public key according to the first public key;

[0178] A second processing module 920 is configured to determine a first key storage tag corresponding to the first key identifier according to a mapping relationship between at least one key identifier and at least one key storage tag, wherein the first key identifier is one of the at least one key identifier, the first key storage tag is one of the at least one key storage tags, and the key identifier corresponds to the key storage tag in one-to-one manner;

[0179] A first sending module 930 is configured to send a first request message to a second device, where the first request message is used to request the second device to feedback a first private key corresponding to the first key storage tag;

[0180] The first receiving module 940 is configured to receive first feedback information sent by the second device, where the first feedback information carries the first private key.

[0181] In this embodiment, when the first device needs to use the first private key stored on the second device, it can generate a first key identifier based on the first public key, and then determine the first key storage tag corresponding to the first key identifier based on the mapping relationship between the key identifier and the key storage tag. After that, the first device obtains the first private key corresponding to the first key storage tag by sending a first request message to the second device. In the key retrieval process, the first key identifier on the first device can be mapped to the first key storage tag on the second device through the mapping relationship between the key identifier and the key storage tag, so as to request the second device to retrieve the first private key on the second device with the first key storage tag and feed it back to the first device, thus realizing the adaptation work between the first device and the second device, so that when the first device needs to use the first private key, it can simply and conveniently realize the retrieval of the first private key, thereby improving the key retrieval efficiency.

[0182] Optionally, the device further comprises:

[0183] A third sending module, used to send second request information to the second device, where the second request information is used to request the second device to generate a key pair;

[0184] A third receiving module is used to receive second feedback information sent by the second device, where the second feedback information carries the public key in the key pair and the key storage tag corresponding to the key pair;

[0185] A fourth processing module, configured to generate the key identifier corresponding to the public key according to the public key;

[0186] The fifth processing module is used to establish a mapping relationship between the key storage tag corresponding to the key pair and the key identifier corresponding to the public key.

[0187] Optionally, the device further comprises:

[0188] a certificate acquisition module, configured to acquire a digital certificate corresponding to the first public key, wherein the digital certificate is generated by the first device or a third device according to the first public key, and the third device is a device trusted by both the first device and the second device;

[0189] The certificate parsing module is used to parse the digital certificate to obtain the first public key.

[0190] Optionally, the fourth processing module includes:

[0191] The first processing submodule is used to perform a hash operation on the public key to generate the key identifier corresponding to the public key.

[0192] Optionally, the device further comprises:

[0193] A second processing submodule is used to perform a modulo operation on the key identifier corresponding to the public key to obtain an operation result i, where N is the length of the target set, and N and i are both integers;

[0194] The third processing submodule is used to, when the i-th element of the target set is empty, use the key storage tag corresponding to the public key and the key pair as the i-th element of the target set; when the i-th element of the target set is not empty, search for the first empty target element after the i-th element and use the key storage tag as the target element.

[0195] Optionally, the device further comprises:

[0196] The data storage module is used to write the key storage tag corresponding to the public key and the key pair into a disk in the form of a file.

[0197] It should be noted here that the above-mentioned key retrieval device provided in an embodiment of the present invention can implement all the method steps implemented in the above-mentioned key retrieval method embodiment applied to the first device, and can achieve the same technical effect. The parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.

[0198] like Fig.10 As shown, a key retrieval device according to an embodiment of the present invention is applied to a second device, including:

[0199] The second receiving module 1010 is used to receive first request information sent by the first device, where the first request information is used to request the second device to feedback a first private key corresponding to the first key storage tag;

[0200] A third processing module 1020 is configured to obtain, according to the first request information, the first private key corresponding to the first key storage tag;

[0201] The second sending module 1030 is configured to send first feedback information to the first device, where the first feedback information carries the first private key.

[0202] In this embodiment, the first request information is used to request the second device to feedback the first private key corresponding to the first key storage tag. Therefore, after receiving the first request information, the second device can retrieve the first private key with the first key storage tag and feedback it to the first device without the second device performing additional adaptation work, thereby reducing the adaptation workload and improving the key retrieval efficiency.

[0203] Optionally, the device further comprises:

[0204] a fourth receiving module, configured to receive second request information sent by the first device, where the second request information is used to request the second device to generate a key pair;

[0205] a sixth processing module, configured to generate the key pair and the key storage tag corresponding to the key pair according to the second request information, wherein the key pair includes a public key and a private key;

[0206] The fourth sending module is used to send second feedback information to the first device, where the second feedback information carries the public key in the key pair and the key storage tag corresponding to the key pair.

[0207] It should be noted here that the above-mentioned key retrieval device provided in the embodiment of the present invention can implement all the method steps implemented by the above-mentioned key retrieval method embodiment applied to the second device, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.

[0208] like Fig.11 As shown, a device 1100 according to an embodiment of the present invention is a first device, including a processor 1110 and a transceiver 1120, wherein the processor 1110 is configured to:

[0209] Generate a first key identifier corresponding to the first public key according to the first public key;

[0210] Determine, according to a mapping relationship between at least one key identifier and at least one key storage tag, a first key storage tag corresponding to the first key identifier, wherein the first key identifier is one of the at least one key identifier, the first key storage tag is one of the at least one key storage tags, and the key identifier and the key storage tag have a one-to-one correspondence;

[0211] Sending a first request message to a second device, where the first request message is used to request the second device to feedback a first private key corresponding to the first key storage tag;

[0212] Receive first feedback information sent by the second device, where the first feedback information carries the first private key.

[0213] In this embodiment, when the first device needs to use the first private key stored on the second device, it can generate a first key identifier based on the first public key, and then determine the first key storage tag corresponding to the first key identifier based on the mapping relationship between the key identifier and the key storage tag. After that, the first device obtains the first private key corresponding to the first key storage tag by sending a first request message to the second device. In the key retrieval process, the first key identifier on the first device can be mapped to the first key storage tag on the second device through the mapping relationship between the key identifier and the key storage tag, so as to request the second device to retrieve the first private key on the second device with the first key storage tag and feed it back to the first device, thus realizing the adaptation work between the first device and the second device, so that when the first device needs to use the first private key, it can simply and conveniently realize the retrieval of the first private key, thereby improving the key retrieval efficiency.

[0214] Optionally, the processor 1110 is further configured to:

[0215] Sending second request information to the second device, where the second request information is used to request the second device to generate a key pair;

[0216] receiving second feedback information sent by the second device, where the second feedback information carries the public key in the key pair and the key storage tag corresponding to the key pair;

[0217] Generate the key identifier corresponding to the public key according to the public key;

[0218] A mapping relationship is established between the key storage tag corresponding to the key pair and the key identifier corresponding to the public key.

[0219] Optionally, the processor 1110 is further configured to:

[0220] Obtaining a digital certificate corresponding to the first public key, wherein the digital certificate is generated by the first device or a third device according to the first public key, and the third device is a device trusted by both the first device and the second device;

[0221] The digital certificate is parsed to obtain the first public key.

[0222] Optionally, when the processor 1110 generates the key identifier corresponding to the public key according to the public key, it is further configured to:

[0223] A hash operation is performed on the public key to generate the key identifier corresponding to the public key.

[0224] Optionally, the processor 1110 is further configured to:

[0225] Performing a modulo operation on the key identifier corresponding to the public key to obtain an operation result i, wherein N is the length of the target set, and N and i are both integers;

[0226] When the i-th element of the target set is empty, the key storage tag corresponding to the public key and the key pair is used as the i-th element of the target set. When the i-th element of the target set is not empty, the first empty target element after the i-th element is searched, and the key storage tag is used as the target element.

[0227] Optionally, the processor 1110 is further configured to:

[0228] The key storage tag corresponding to the public key and the key pair is written to a disk in the form of a file.

[0229] It should be noted here that the above-mentioned device provided by the embodiment of the present invention can implement all the method steps implemented by the above-mentioned key retrieval method embodiment applied to the first device, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.

[0230] A device according to an embodiment of the present invention, the device is a second device, and its structure can be as follows: Fig.11 The structure shown is the same as the first device, including a processor and a transceiver, wherein the processor is used to:

[0231] receiving first request information sent by the first device, where the first request information is used to request the second device to feedback a first private key corresponding to the first key storage tag;

[0232] Acquire, according to the first request information, the first private key corresponding to the first key storage tag;

[0233] Sending first feedback information to the first device, where the first feedback information carries the first private key.

[0234] In this embodiment, the first request information is used to request the second device to feedback the first private key corresponding to the first key storage tag. Therefore, after receiving the first request information, the second device can retrieve the first private key with the first key storage tag and feedback it to the first device without the second device performing additional adaptation work, thereby reducing the adaptation workload and improving the key retrieval efficiency.

[0235] Optionally, the processor is further configured to:

[0236] receiving second request information sent by the first device, where the second request information is used to request the second device to generate a key pair;

[0237] Generate the key pair and the key storage tag corresponding to the key pair according to the second request information, wherein the key pair includes a public key and a private key;

[0238] Sending second feedback information to the first device, where the second feedback information carries the public key in the key pair and the key storage tag corresponding to the key pair.

[0239] It should be noted here that the above-mentioned device provided by the embodiment of the present invention can implement all the method steps implemented by the above-mentioned key retrieval method embodiment applied to the second device, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.

[0240] A device according to another embodiment of the present invention, such as Fig.12 As shown, it includes a transceiver 1210, a processor 1200, a memory 1220, and a program or instruction stored in the memory 1220 and executable on the processor 1200; when the processor 1200 executes the program or instruction, it implements the key retrieval method applied to the first device, or implements the key retrieval method applied to the second device.

[0241] The transceiver 1210 is used to receive and send data under the control of the processor 1200 .

[0242] Among them, Fig.12In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 1200 and various circuits of memory represented by memory 1220 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 1210 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 1200 is responsible for managing the bus architecture and general processing, and the memory 1220 may store data used by the processor 1200 when performing operations.

[0243] A computer-readable storage medium according to an embodiment of the present invention stores a program or instruction thereon, and when the program or instruction is executed by a processor, the steps in the key retrieval method described above are implemented, and the same technical effect can be achieved. To avoid repetition, it is not described here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0244] It should be further explained that the terminals described in this specification include but are not limited to smart phones, tablet computers, etc., and many of the functional components described are called modules in order to more particularly emphasize the independence of their implementation methods.

[0245] In the embodiment of the present invention, module can be implemented with software so that it can be executed by various types of processors. For example, an executable code module of an identification can include one or more physical or logical blocks of computer instructions, for example, it can be constructed as an object, process or function. Nevertheless, the executable code of the identified module does not need to be physically located together, but can include different instructions stored in different positions, and when these instructions are logically combined together, it constitutes a module and realizes the specified purpose of the module.

[0246] In fact, executable code module can be a single instruction or many instructions, and can even be distributed on a plurality of different code segments, distributed among different programs, and distributed across a plurality of memory devices. Similarly, operating data can be identified in the module, and can be implemented and organized in the data structure of any appropriate type according to any appropriate form. The operating data can be collected as a single data set, or can be distributed in different locations (including on different storage devices), and can only be present on a system or network as an electronic signal at least in part.

[0247] When a module can be implemented by software, considering the level of existing hardware technology, a person skilled in the art can build a corresponding hardware circuit to implement the corresponding function of the module that can be implemented by software without considering the cost. The hardware circuit includes a conventional very large scale integration (VLSI) circuit or gate array and existing semiconductors such as logic chips, transistors, or other discrete components. The module can also be implemented by a programmable hardware device, such as a field programmable gate array, a programmable array logic, a programmable logic device, etc.

[0248] The above exemplary embodiments are described with reference to the accompanying drawings, and many different forms and embodiments are feasible without departing from the spirit and teachings of the present invention. Therefore, the present invention should not be constructed as a limitation of the exemplary embodiments proposed herein. More specifically, these exemplary embodiments are provided so that the present invention will be perfect and complete, and the scope of the present invention will be conveyed to those who are familiar with the technology. In these figures, the component sizes and relative sizes may be exaggerated for clarity. The terms used here are only based on the purpose of describing specific exemplary embodiments and are not intended to be limiting. As used herein, unless the text clearly indicates otherwise, the singular forms "one", "an" and "the" are intended to include these multiple forms. It will be further understood that the terms "including" and / or "comprising" when used in this specification indicate the presence of the features, integers, steps, operations, components and / or components, but do not exclude the presence or increase of one or more other features, integers, steps, operations, components, components and / or their groups. Unless otherwise indicated, when stated, a range of values ​​includes the upper and lower limits of that range and any subranges therebetween.

[0249] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A key retrieval method, characterized in that: Applied to a first device, comprising: Generate a first key identifier corresponding to the first public key according to the first public key; Determine, according to a mapping relationship between at least one key identifier and at least one key storage tag, a first key storage tag corresponding to the first key identifier, wherein the first key identifier is one of the at least one key identifier, the first key storage tag is one of the at least one key storage tags, and the key identifier and the key storage tag have a one-to-one correspondence; Sending a first request message to a second device, where the first request message is used to request the second device to feedback a first private key corresponding to the first key storage tag; Receive first feedback information sent by the second device, where the first feedback information carries the first private key.

2. The method according to claim 1, characterized in that The method further comprises: Sending second request information to the second device, where the second request information is used to request the second device to generate a key pair; receiving second feedback information sent by the second device, where the second feedback information carries the public key in the key pair and the key storage tag corresponding to the key pair; Generate the key identifier corresponding to the public key according to the public key; A mapping relationship is established between the key storage tag corresponding to the key pair and the key identifier corresponding to the public key.

3. The method according to claim 1, characterized in that Before generating a first key identifier corresponding to the first public key according to the first public key, the method further includes: Obtaining a digital certificate corresponding to the first public key, wherein the digital certificate is generated by the first device or a third device according to the first public key, and the third device is a device trusted by both the first device and the second device; The digital certificate is parsed to obtain the first public key.

4. The method according to claim 2, characterized in that: The step of generating the key identifier corresponding to the public key according to the public key includes: A hash operation is performed on the public key to generate the key identifier corresponding to the public key.

5. The method according to claim 1 or 4, characterized in that: After generating the key identifier corresponding to the public key according to the public key, the method further includes: Performing a modulo operation on the key identifier corresponding to the public key to obtain an operation result i, wherein N is the length of the target set, and N and i are both integers; When the i-th element of the target set is empty, the key storage tag corresponding to the public key and the key pair is used as the i-th element of the target set. When the i-th element of the target set is not empty, the first empty target element after the i-th element is searched, and the key storage tag is used as the target element.

6. The method according to claim 2, characterized in that After receiving the second feedback information sent by the second device, the method further includes: The key storage tag corresponding to the public key and the key pair is written to a disk in the form of a file.

7. A key retrieval method, characterized in that: Applied to the second device, comprising: receiving first request information sent by the first device, where the first request information is used to request the second device to feedback a first private key corresponding to the first key storage tag; Acquire, according to the first request information, the first private key corresponding to the first key storage tag; Sending first feedback information to the first device, where the first feedback information carries the first private key.

8. The method according to claim 7, characterized in that The method further comprises: receiving second request information sent by the first device, where the second request information is used to request the second device to generate a key pair; Generate the key pair and the key storage tag corresponding to the key pair according to the second request information, wherein the key pair includes a public key and a private key; Sending second feedback information to the first device, where the second feedback information carries the public key in the key pair and the key storage tag corresponding to the key pair.

9. A key retrieval device, characterized in that: Applied to a first device, comprising: A first processing module, configured to generate a first key identifier corresponding to the first public key according to the first public key; a second processing module, configured to determine, according to a mapping relationship between at least one key identifier and at least one key storage label, a first key storage label corresponding to the first key identifier, wherein the first key identifier is one of the at least one key identifier, the first key storage label is one of the at least one key storage label, and the key identifier corresponds to the key storage label in one-to-one manner; A first sending module, configured to send a first request message to a second device, wherein the first request message is used to request the second device to feedback a first private key corresponding to the first key storage tag; The first receiving module is used to receive first feedback information sent by the second device, where the first feedback information carries the first private key.

10. A key retrieval device, characterized in that: Applied to the second device, comprising: A second receiving module is used to receive a first request message sent by the first device, where the first request message is used to request the second device to feedback a first private key corresponding to the first key storage tag; A third processing module, configured to obtain, according to the first request information, the first private key corresponding to the first key storage tag; The second sending module is used to send first feedback information to the first device, where the first feedback information carries the first private key.

11. A device, the device being a first device, characterized in that: include: transceivers and processors; The processor is used to: Generate a first key identifier corresponding to the first public key according to the first public key; Determine, according to a mapping relationship between at least one key identifier and at least one key storage tag, a first key storage tag corresponding to the first key identifier, wherein the first key identifier is one of the at least one key identifier, the first key storage tag is one of the at least one key storage tags, and the key identifier and the key storage tag have a one-to-one correspondence; Sending a first request message to a second device, where the first request message is used to request the second device to feedback a first private key corresponding to the first key storage tag; Receive first feedback information sent by the second device, where the first feedback information carries the first private key.

12. A device, the device being a second device, characterized in that: include: transceivers and processors; The processor is used to: receiving first request information sent by the first device, where the first request information is used to request the second device to feedback a first private key corresponding to the first key storage tag; Acquire, according to the first request information, the first private key corresponding to the first key storage tag; Sending first feedback information to the first device, where the first feedback information carries the first private key.

13. A device comprising: A transceiver, a processor, a memory, and a program or instruction stored in the memory and executable on the processor; characterized in that when the processor executes the program or instruction, it implements the key retrieval method as described in any one of claims 1 to 6, or implements the key retrieval method as described in any one of claims 7 to 8.

14. A readable storage medium having a program or instruction stored thereon, characterized in that: When the program or instruction is executed by a processor, the steps in the key retrieval method according to any one of claims 1 to 6, or the steps in the key retrieval method according to any one of claims 7 to 8 are implemented.