WO2014047868A1 - Protocol stack type negotiation method and device - Google Patents

Protocol stack type negotiation method and device Download PDF

Info

Publication number
WO2014047868A1
WO2014047868A1 PCT/CN2012/082286 CN2012082286W WO2014047868A1 WO 2014047868 A1 WO2014047868 A1 WO 2014047868A1 CN 2012082286 W CN2012082286 W CN 2012082286W WO 2014047868 A1 WO2014047868 A1 WO 2014047868A1
Authority
WO
WIPO (PCT)
Prior art keywords
negotiation
protocol stack
stack type
message
negotiation device
Prior art date
Application number
PCT/CN2012/082286
Other languages
French (fr)
Chinese (zh)
Inventor
何承东
黄秋敏
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2012/082286 priority Critical patent/WO2014047868A1/en
Priority to CN201280001793.8A priority patent/CN103843449A/en
Publication of WO2014047868A1 publication Critical patent/WO2014047868A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/24Negotiation of communication capabilities

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a protocol stack type negotiation method and apparatus. Background technique
  • Cloud computing is a business computing model that distributes computing tasks across resource pools of a large number of client devices, enabling applications to obtain computing power, storage space, and information services from client devices as needed.
  • data transmission is often involved.
  • KMC Key Management Center
  • KMIP Key Management Interoperability Protocol
  • the data transmission process is carried out by the session.
  • the KMIP protocol is carried by the protocol stack.
  • the protocol stack refers to the sum of the layers of the protocol in the file transmission process in the network. According to the relevant specifications of the KMIP protocol, there may be many types of protocol stacks carrying the KMIP protocol. Kind.
  • the client device and the KMC can respectively support one or more protocol stack types of the KMIP protocol, because the protocol stack type supported by the client device may not be exactly the same as the protocol stack type supported by the KMC, so that the client When the device performs a KMIP session with the KMC, the KMC parsing the KMIP message fails when the protocol stack type used by the client device to send the KMIP message is different from the protocol stack type used by the KMC to parse the KMIP message. Therefore, in the prior art, the manual configuration mode is adopted, and the same protocol stack type is configured on the client device and the KMC respectively, so that the type of the protocol stack used by the client device and the KMC for the KMIP session is consistent.
  • the embodiment of the present invention provides a protocol stack type negotiation method and device, which solves the problem that the operation is cumbersome and difficult to maintain when manually configuring the protocol stack type in the prior art.
  • a protocol stack type negotiation method includes: the first negotiation device sends a negotiation request message to the second negotiation device, where the negotiation request message carries the protocol stack type supported by the first negotiation device, so that The second negotiation device selects a protocol stack type supported by the second negotiation device and the first negotiation device according to the protocol stack type supported by the first negotiation device that is carried in the negotiation request message; The first negotiation response message fed back by the second negotiation device according to the negotiation request message; and the protocol stack type supported by the second negotiation device and the first negotiation device is obtained according to the first negotiation response message.
  • a protocol stack type negotiation device the device is disposed in a first negotiation device that performs a protocol stack type negotiation with a second negotiation device, and includes: a negotiation request message sending unit, configured to send a negotiation request message to the second negotiation device, The negotiation request message carries the protocol stack type supported by the first negotiation device, so that the second negotiation device selects the protocol stack type supported by the first negotiation device that is carried in the negotiation request message.
  • the first negotiation response message receiving unit is configured to receive the negotiation request message sent by the second negotiation device according to the negotiation request message sending unit a first negotiation response message that is fed back;
  • a protocol stack type obtaining unit configured to obtain, according to the first negotiation response message received by the first negotiation response message receiving unit, that the second negotiation device and the first negotiation device support Protocol stack type.
  • a protocol stack type negotiation method includes: the second negotiation device receives a negotiation request message sent by the first negotiation device, where the negotiation request message carries a protocol stack type supported by the first negotiation device; Determining, by the negotiation request message, the protocol stack type supported by the first negotiation device, selecting a protocol stack type supported by the second negotiation device and the first negotiation device; and performing the message according to the negotiation request message to the first The negotiation device feeds back the first negotiation response message, so that the first negotiation device obtains the protocol stack type supported by the second negotiation device and the first negotiation device according to the first negotiation response message.
  • a protocol stack type negotiation device the device is disposed in a second negotiation device that performs a protocol stack type negotiation with the first negotiation device, and includes: a negotiation request message receiving unit, configured to receive a negotiation request message sent by the first negotiation device
  • the negotiation request message carries the protocol stack type supported by the first negotiation device
  • the protocol stack type obtaining unit is configured to perform, according to the first request carried in the negotiation request message received by the negotiation request message receiving unit
  • the first negotiation response message sending unit is configured to perform the negotiation according to the negotiation request message receiving unit.
  • Protocol stack type Protocol stack type.
  • the client device does not randomly select the protocol stack type to perform the KMIP session before the KMIP session with the KMC, but one party serves as the first negotiation device, and the other party acts as the second.
  • the device is negotiated and sent to the second negotiation device by using the first negotiation device.
  • the first negotiation response message fed back by the second negotiation device is received by the first negotiation device, and the protocol stack supported by the second negotiation device and the first negotiation device is obtained according to the first negotiation response message.
  • Type which is the type of protocol stack that is supported by the KMC and the client device.
  • the protocol stack type negotiated by the first negotiation device and the second negotiation device is a protocol stack type supported by the second negotiation device and the first negotiation device, and therefore, the KMC and the client are subsequently
  • the protocol stack type used by the two parties is the protocol stack type supported by the KMC and the client device. Therefore, both the KMC and the client device can correctly parse the received KMIP message; and, because the client device
  • the protocol stack type is selected through auto-negotiation with the KMC, so manual configuration is not required and maintenance is convenient.
  • FIG. 1 is a schematic diagram of a system architecture for performing protocol stack type negotiation in an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a protocol stack type negotiation method in an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a protocol stack type negotiation method in another embodiment of the present invention.
  • FIG. 5 is a schematic flowchart of a protocol stack type negotiation method according to another embodiment of the present invention.
  • FIG. 6 is a schematic flowchart of a protocol stack type negotiation method in another embodiment of the present invention.
  • FIG. 7 is a schematic flowchart of a protocol stack type negotiation method in another embodiment of the present invention.
  • FIG. 8 is a schematic flowchart of a protocol stack type negotiation method in another embodiment of the present invention.
  • FIG. 9 is a schematic flowchart of a protocol stack type negotiation method according to another embodiment of the present invention.
  • FIG. 10 is a schematic flowchart of a protocol stack type negotiation method according to another embodiment of the present invention.
  • 11 is a schematic flowchart of a protocol stack type negotiation method according to another embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of a protocol stack type negotiation apparatus according to an embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of a protocol stack type negotiation apparatus in another embodiment of the present invention.
  • FIG. 14 is a schematic structural diagram of a protocol stack type negotiation apparatus according to another embodiment of the present invention.
  • 15 is a schematic structural diagram of a protocol stack type negotiation apparatus in another embodiment of the present invention.
  • 16 is a schematic structural diagram of a protocol stack type negotiation apparatus in another embodiment of the present invention.
  • FIG. 17 is a schematic structural diagram of a protocol stack type negotiation apparatus in another embodiment of the present invention.
  • 18 is a schematic structural diagram of a protocol stack type negotiation apparatus according to another embodiment of the present invention.
  • FIG. 19 is a schematic structural diagram of a protocol stack type negotiation apparatus according to another embodiment of the present invention.
  • 20 is a schematic structural diagram of a protocol stack type negotiation apparatus in another embodiment of the present invention.
  • FIG. 21 is a schematic structural diagram of a protocol stack type negotiation apparatus according to another embodiment of the present invention.
  • the present invention will be further described in detail with reference to the accompanying drawings, in which FIG. An embodiment. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
  • FIG. 1 it is a schematic diagram of a system architecture for protocol stack type negotiation in an embodiment of the present invention.
  • the system includes multiple client devices and a KMC, where each client device performs a KMIP session with the KMC.
  • the protocol stack type negotiation may be initiated by the client device, or the protocol stack type negotiation may be initiated by the KMC.
  • the protocol stack type negotiation is performed with the KMC, and then the negotiated protocol stack type is used to perform the KMIP session with the KMC.
  • the party that defines the protocol stack type negotiation is the first negotiation device, and the other party is the second negotiation device.
  • FIG. 2 it is an embodiment of a protocol stack type negotiation method according to the present invention.
  • the embodiment describes the negotiation process from the first negotiation device side:
  • Step 201 The first negotiation device sends a negotiation request message to the second negotiation device, where the negotiation request message carries the protocol stack type supported by the first negotiation device, so that the second negotiation device sends the first negotiation device according to the negotiation request message.
  • the supported protocol stack type selects the protocol stack type supported by the second negotiation device and the first negotiation device.
  • the second negotiation device is a KMC; when the first negotiation device is a KMC, the second negotiation device is a client device.
  • the negotiation request message may carry all the protocol stack types supported by the first negotiation device, and may also carry a partial protocol stack type supported by the first negotiation device.
  • the negotiation request message may further carry the protocol stack type priority set by the first negotiation device, so that the second negotiation device can use the protocol stack type supported by the first negotiation device carried in the negotiation request message, and the first negotiation.
  • the protocol stack type priority set by the device is selected, and a protocol stack type supported by the second negotiation device and the first negotiation device is selected.
  • the protocol stack type used by the first negotiation device and the second negotiation device to perform the KMIP session may be various, for example, each protocol stack type shown in Table 1.
  • the protocol stack includes
  • KMIP Transport Layer Security
  • TLS Transport Layer Security
  • TCP Transmission Control Protocol
  • HTTPS Hypertext Transfer Protocol over Secure Socket Layer
  • TCP Transmission Control Protocol
  • the protocol stack type used for the KMIP session is type 3
  • the protocol stack includes the KMIP and the hypertext transfer protocol.
  • SOAP Simple Object Access Protocol
  • the protocol stack when the protocol stack type used for the KMIP session is type five, the protocol stack includes five protocols: KMIP, S0AP, HTTP, TLS, and TCP; when the protocol stack type used for the KMIP session is type six , the protocol stack contains KMIP, TCP and Internet Protocol Security (IPSec, Internet Protocol Security) protocol three protocols.
  • KMIP KMIP
  • S0AP HTTP
  • TLS Transmission Control Protocol
  • TCP Internet Protocol Security
  • Step 202 The first negotiation device receives a first negotiation response message that is sent by the second negotiation device according to the negotiation request message.
  • the first negotiation response message carries the protocol stack type supported by the second negotiation device, and the protocol stack type carried in the first negotiation response message may include: the first negotiation device carries the first message according to the received negotiation request message.
  • the first negotiation device carries the first message according to the received negotiation request message.
  • Negotiating the protocol stack type supported by the device determining the at least one protocol stack type supported by the second negotiation device and the first negotiation device; or the protocol stack type supported by the second negotiation device.
  • the first negotiation response message may carry the second negotiation device from the second negotiation device.
  • a protocol stack type selected from the types of protocol stacks supported by the first negotiation device.
  • the negotiation request message sent by the first negotiation device carries the protocol stack type priority set by the first negotiation device
  • the first negotiation response message may carry a protocol stack type supported by the two parties selected by the second negotiation device, where A protocol stack type supported by the two parties is a second negotiation device selected by the second negotiation device according to the protocol stack type supported by the first negotiation device and the protocol stack type priority set by the first negotiation device.
  • the first negotiation response message may carry the protocol stack type supported by the second negotiation device, and further may carry the protocol stack type priority preset by the second negotiation device, so that the first negotiation device can Selecting a second type according to the protocol stack type priority supported by the second negotiation device carried in the first negotiation response message, from the at least one protocol stack type supported by the second negotiation device that is carried by the second negotiation device The type of protocol stack supported by the negotiation device and the first negotiation device.
  • the entity that pre-sets the priority of the protocol stack type may be the two sides of the protocol stack type negotiation, or may be only one of the following, and may specifically include the following three situations: The first negotiation device presets the protocol stack type priority; The second negotiation device presets the protocol stack type priority; the first negotiation device and the second negotiation device both preset the protocol stack type priority.
  • the protocol stack type priority is set in advance.
  • both the first negotiation device and the second negotiation device may be adopted.
  • the first negotiation device is pre-agreed when the priority of the same protocol stack type is set in advance, or when the priority of the protocol stack type set by the first negotiation device is different from the priority of the protocol stack type preset by the second negotiation device. Pre-set protocol stack type priority, or pre-agreed the protocol stack type priority preset by the second negotiation device.
  • Step 203 Obtain a protocol stack type supported by the second negotiation device and the first negotiation device according to the first negotiation response message.
  • the first negotiation device may select one of the at least one protocol stack type carried in the first negotiation response message.
  • the first negotiation device may select the second protocol stack type supported by the second negotiation device that is carried in the received first negotiation response message, and select the second The type of protocol stack supported by the negotiation device and the first negotiation device.
  • the protocol stack type supported by the second negotiation device and the first negotiation device may be one or more.
  • the number of protocol stacks supported by the second negotiation device and the first negotiation device may be multiple.
  • the processing flow may also be included in the following: a protocol stack supported by the second negotiation device and the first negotiation device When the type is greater than one, the first negotiation device first selects a protocol stack type from the protocol stack type supported by the second negotiation device and the first negotiation device, and then sends a second negotiation response message to the second negotiation device, and the second negotiation is performed.
  • the response message carries a protocol stack type supported by both parties finally selected by the first negotiation device.
  • the protocol stack type is selected from the protocol stack type supported by the second negotiation device and the first negotiation device: at least one supported by the second negotiation device and the first negotiation device.
  • a protocol stack type is randomly selected. From at least one protocol stack type supported by the second negotiation device and the first negotiation device, a protocol stack type is selected according to a protocol stack type priority preset by the first negotiation device. The at least one protocol stack type supported by the second negotiation device and the first negotiation device is selected according to a protocol stack type priority preset by the second negotiation device carried in the first negotiation response message.
  • the entire protocol stack negotiation process may be encrypted, for example, using public-private key mechanism encryption and decryption (ie, asymmetric key encryption and decryption), or using symmetric key encryption and decryption, of course.
  • public-private key mechanism encryption and decryption ie, asymmetric key encryption and decryption
  • symmetric key encryption and decryption of course.
  • Other encryption and decryption processing methods may also be used, which are not limited in this embodiment of the present invention.
  • the key information is exchanged with the second negotiation device, so that the first negotiation device and the second negotiation device are configured according to the public information.
  • the above-mentioned key information uses the public-private key encryption and decryption mechanism to negotiate the protocol stack type, which may include the following two situations:
  • the key is used to encrypt the message sent to the second negotiation device (for example, the negotiation request message and the second negotiation response message), and the message received from the second negotiation device (for example, according to the first negotiation device public key encryption)
  • the first first negotiation response message is decrypted, and the first negotiation device public key is used by the second negotiation device for the message received from the first negotiation device (for example, the negotiation request message encrypted according to the first negotiation device private key) Decrypting with the second negotiation response message, and encrypting the message (for example, the first negotiation response message) sent to the first negotiation device;
  • the second negotiation device private key and the second negotiation device public key are preset by the second negotiation device, and the second negotiation device obtains the second preset before the first negotiation device sends the negotiation request message to the second negotiation device.
  • Negotiating the device public key encrypting the message sent to the second negotiation device (for example, the negotiation request message and the second negotiation response message) by using the second negotiation device public key, and using the second negotiation device public key pair to negotiate from the second
  • the message received by the device (for example, the first negotiation response message encrypted according to the second negotiation device private key) is decrypted.
  • the second negotiation device uses the second negotiation device private key pair to send the message to the first negotiation device.
  • the first negotiation response message is encrypted, and the message received from the first negotiation device is obtained by using the second negotiation device private key (for example, the negotiation request message and the second negotiation response encrypted according to the second negotiation device public key) Message) Decrypt.
  • the symmetric key is shared with the second negotiation device before the first negotiation device sends the negotiation request message to the second negotiation device.
  • the first negotiation device encrypts the message sent to the second negotiation device according to the symmetric key and the obtained random number, obtains the message ciphertext, and simultaneously sends the message when the message is sent.
  • the message ciphertext is used to enable the second negotiation device to decrypt the received message ciphertext to obtain the message plaintext, compare the message plaintext with the received message, and continue the protocol stack type negotiation when the comparison result is the same;
  • the first negotiation device decrypts the message ciphertext according to the symmetric key, obtains the message plaintext, and compares the message plaintext with the received message.
  • the protocol stack type negotiation is continued.
  • the message ciphertext is a message ciphertext obtained by the second negotiation device encrypting the message sent to the first negotiation device according to the symmetric key and the obtained random number.
  • the protocol stack type negotiated by the first negotiation device and the second negotiation device is a protocol stack type supported by the two parties. Therefore, when the KMC and the client device perform a KMIP session, The protocol stack type adopted by the two parties is the protocol stack type supported by the KMC and the client device. Therefore, both the KMC and the client device can correctly parse the received KMIP message; and, because the client device and the KMC pass the automatic Negotiation, select the protocol stack type, so no manual configuration is required, which is easy to maintain.
  • FIG. 3 it is another embodiment of the protocol stack type negotiation method of the present invention. The embodiment describes the negotiation process from the second negotiation device side:
  • Step 301 The second negotiation device receives the negotiation request message sent by the first negotiation device, where the negotiation request message carries the protocol stack type supported by the first negotiation device.
  • the negotiation request message may carry all the protocol stack types supported by the first negotiation device, and may also carry a partial protocol stack type supported by the first negotiation device.
  • the negotiation request message may further carry the first negotiation device preset. Protocol stack type priority.
  • the first negotiation device is a client device; when the second negotiation device is a client device, the first negotiation device is a KMC.
  • Step 302 The second negotiation device selects a protocol stack type supported by the second negotiation device and the first negotiation device according to the protocol stack type supported by the first negotiation device that is carried in the negotiation request message.
  • the protocol stack type supported by the first negotiation device carried in the negotiation request message is type one, type two, and type three, and all protocol stack types supported by the second negotiation device are type one, type two, and type five.
  • the protocol stack types supported by the second negotiation device and the first negotiation device selected by the second negotiation device are type one and type two.
  • the second negotiation device selects the second negotiation device and the first negotiation device to support the same. After the protocol stack type, at least one protocol stack type supported by the two parties may be determined; or, one protocol stack type is selected from the protocol stack types supported by the second negotiation device and the first negotiation device.
  • the second negotiation device may select a protocol stack type by using any one of the following methods: a protocol stack type is randomly selected from the protocol stack types supported by the second negotiation device and the first negotiation device; and the second negotiation device and the first The protocol stack type supported by the negotiation device is selected according to the protocol stack type priority set by the first negotiation device carried in the negotiation request message; and the protocol stack type priority set according to the second negotiation device is selected. Protocol stack type.
  • the negotiation request message carries both the protocol stack type supported by the first negotiation device and the protocol stack type priority set by the first negotiation device
  • the protocol stack supported by the first negotiation device carried in the negotiation request message may be used.
  • the type and the priority of the protocol stack type preset by the first negotiation device are selected, and a protocol stack type supported by the second negotiation device and the first negotiation device is selected.
  • Step 303 The second negotiation device feeds back the first negotiation response message to the first negotiation device according to the negotiation request message, so that the first negotiation device obtains the protocol supported by the second negotiation device and the first negotiation device according to the first negotiation response message.
  • Stack type The second negotiation device feeds back the first negotiation response message to the first negotiation device according to the negotiation request message, so that the first negotiation device obtains the protocol supported by the second negotiation device and the first negotiation device according to the first negotiation response message.
  • the type of the protocol stack carried in the first negotiation response message may include: a protocol stack type supported by the second negotiation device selected by the second negotiation device and the first negotiation device in step 302, so that the first negotiation device can receive the After the first negotiation response message, the protocol stack type supported by the second negotiation device and the first negotiation device can be directly obtained from the first negotiation response message; or at least one protocol stack type supported by the two parties, so that the first negotiation is performed.
  • the device may select a protocol stack type supported by the second negotiation device and the first negotiation device from the at least one protocol stack type supported by the two parties in the first negotiation response message; or the second negotiation device negotiates from the second negotiation device.
  • a protocol stack type supported by a negotiation device; or, a second negotiation setting Protocol stack supported type so that the first device may negotiate receiving the first negotiation response message, support device capable of responding to a second negotiation message carried in the first negotiation protocol stack type, select the second negotiation device a type of protocol stack supported by the first negotiation device, and subsequently performed by the first negotiation device and the second negotiation device
  • the KMIP session is performed by using the protocol stack type supported by the second negotiation device and the first negotiation device.
  • the first negotiation response message when the first negotiation response message carries at least one protocol stack type supported by the two parties, the first negotiation response message may further carry a protocol stack type priority preset by the second negotiation device, so that The first negotiating device selects a second negotiating device from the at least one protocol stack type jointly supported by the second negotiation device that is carried by the second negotiation device that is carried by the second negotiation device according to the protocol stack type priority set by the second negotiation device.
  • the protocol stack type supported by the first negotiation device when the first negotiation response message carries at least one protocol stack type supported by the two parties, the first negotiation response message may further carry a protocol stack type priority preset by the second negotiation device, so that The first negotiating device selects a second negotiating device from the at least one protocol stack type jointly supported by the second negotiation device that is carried by the second negotiation device that is carried by the second negotiation device according to the protocol stack type priority set by the second negotiation device.
  • the protocol stack type supported by the first negotiation device when the first negotiation response message carries at least one protocol stack type supported by the two parties, the
  • step 302 may be performed first, and then step 303 is performed; or step 303 may be performed first, and then step 302 is performed; Steps 302 and 303 are performed, and the embodiment of the present invention is not limited.
  • the first negotiation response message may carry the protocol stack type supported by the second negotiation device, and further may carry the protocol stack type priority preset by the second negotiation device, so that the first negotiation device can be configured according to the first negotiation response message.
  • the protocol stack type supported by the second negotiation device carried in the second negotiation device and the protocol stack type priority preset by the second negotiation device determine a protocol stack type supported by the second negotiation device and the first negotiation device.
  • the second negotiation device receives the second negotiation response message sent by the first negotiation device, where the second negotiation response message carries the two parties selected by the first negotiation device.
  • a type of protocol stack that is commonly supported.
  • the first negotiation device may select a protocol stack type selected from the protocol stack types supported by the second negotiation device and the first negotiation device according to the received first negotiation response message, and subsequently negotiate with the first negotiation device.
  • the KMIP session is performed using one of the protocol stack types selected above.
  • the entire protocol stack negotiation process may be encrypted, for example, using public-private key mechanism encryption and decryption (ie, asymmetric key encryption and decryption), or using symmetric key encryption and decryption, of course.
  • public-private key mechanism encryption and decryption ie, asymmetric key encryption and decryption
  • symmetric key encryption and decryption of course.
  • Other encryption and decryption processing methods may also be used, which are not limited in this embodiment of the present invention.
  • the second negotiation device When the second negotiation device receives the negotiation request message sent by the first negotiation device, the key information is exchanged with the first negotiation device to enable the first negotiation device and the second negotiation device.
  • the protocol stack type negotiation is performed by using a public-private key encryption and decryption mechanism according to the key information, which may include the following two situations:
  • the second negotiation device private key and the second negotiation device public key are preset by the second negotiation device, and the second negotiation device private key is stored, and the second negotiation device public key is sent to the first negotiation device, and the second negotiation device is private.
  • Key use Encrypting a message (eg, a first negotiation response message) sent to the first negotiation device, and receiving a message received from the first negotiation device (eg, a negotiation request message encrypted according to the second negotiation device public key)
  • the second negotiation device message is decrypted, and the second negotiation device public key is used by the first negotiation device to receive the message from the second negotiation device (for example, the first negotiation response message encrypted according to the second negotiation device private key)
  • Decrypting, and encrypting messages sent to the second negotiating device eg, the negotiation request message and the second negotiation response message);
  • the first negotiation device private key and the first negotiation device public key are preset by the first negotiation device.
  • the first negotiation device Before the second negotiation device receives the negotiation request message sent by the first negotiation device, the first negotiation device obtains the preset Negotiating the device public key, encrypting the message (for example, the first negotiation response message) sent to the first negotiation device by using the first negotiation device public key, and receiving the first negotiation device from the first negotiation device by using the first negotiation device public key pair
  • the message is decrypted according to the first negotiation device private key encrypted negotiation request message and the second negotiation response message, and the first negotiation device uses the first negotiation device private key pair to send to the second negotiation device.
  • the message (eg, the negotiation request message and the second negotiation response message) is encrypted, and the message received from the second negotiation device is obtained using the first negotiation device private key (eg, the first encrypted according to the first negotiation device public key) Negotiate response message) Decrypt.
  • the symmetric key is shared with the first negotiation device before the second negotiation device receives the negotiation request message sent by the first negotiation device.
  • the second negotiation device receives the message ciphertext sent by the first negotiation device at the same time as the message is sent, decrypts the message ciphertext according to the symmetric key, obtains the message plaintext, and compares the message plaintext with the received message.
  • the protocol stack type negotiation is continued, where the message ciphertext is that the first negotiation device encrypts the message sent to the first negotiation device according to the symmetric key and the obtained random number, and the obtained message is dense.
  • the second negotiation device before sending the message to the first negotiation device, the second negotiation device encrypts the message sent to the first negotiation device according to the symmetric key and the obtained random number, obtains the message ciphertext, and sends the message.
  • the message ciphertext is sent at the same time, so that the first negotiation device decrypts the received message ciphertext to obtain the message plaintext, compares the message plaintext with the received message, and when the comparison result is the same, continues the protocol stack type negotiation.
  • the protocol stack type negotiated by the first negotiation device and the second negotiation device is a protocol stack type supported by the two parties. Therefore, when the KMC and the client device perform a KMIP session, The protocol stack type adopted by the two parties is the protocol stack type supported by the KMC and the client device. Therefore, both the KMC and the client device can correctly parse the received KMIP message; and, because the client device and the KMC pass the automatic Negotiation, select the protocol stack type, so no manual configuration is required, which is easy to maintain. As shown in FIG.
  • the first negotiation device is a client device
  • the second negotiation device is a KMC
  • the KMC unilaterally selects a protocol stack type
  • the selected protocol stack type is sent to the client device, and the information transmitted by the protocol stack type is encrypted and decrypted by using the public and private keys set by the KMC.
  • the specific processing flow is as follows:
  • Step 401 The client device encrypts the negotiation request message to be sent by using the KMC public key.
  • the KMC can pre-set the KMC public key and the KMC private key, publish the KMC public key, and save the KMC private key.
  • the negotiation request message may carry only all the protocol stack types supported by the client device (for example, type one, type two, and type three), and may further carry each type of cooperation set by the client device.
  • the corresponding priority for example, the priority corresponding to each protocol stack type is shown in Table 2.
  • the subsequent KMC can select the protocol stack type supported by the KMC and the client device from all the protocol stack types supported by the KMC according to all protocol stack types supported by the client device carried in the received negotiation request message.
  • the number of protocol stacks supported by the KMC and the client device may be multiple. If the negotiation request message carries the priority corresponding to each protocol stack type set by the client device, the KMC may be based on a preset priority policy. Select a protocol stack type from the protocol stack type supported by the KMC and the client device.
  • Step 402 The client device sends the negotiation request message encrypted in step 401 to the KMC.
  • Step 403 The KMC decrypts the received encrypted negotiation request message by using the KMC private key.
  • Step 405 The KMC selects a protocol stack type from all the protocol stack types supported by the determined KMC and the client device.
  • the KMC may select a protocol stack type in any of the following ways: From the protocol stack types supported by the KMC and the client device, randomly select a protocol stack type; Set the protocol stack type priority. From all the protocol stack types supported by the KMC and the client device, select a protocol stack type according to a preset policy. For example, preset a protocol stack with the highest priority.
  • Protocol stack Type or pre-set to select a protocol stack type with the lowest priority; according to the protocol stack type priority preset by the client device carried in the received negotiation request message, all supported by the KMC and the client device
  • a protocol stack type is selected according to a preset policy, for example, a protocol stack type with the highest priority is selected in advance, or a protocol stack type with the lowest priority is selected in advance.
  • the same protocol stack type priority may be preset in advance, or the protocol stack type priority and the client preset by the KMC are used.
  • the priority of the protocol stack type preset by the device is different, the priority of the protocol stack type preset by the KMC may be pre-agreed, or the protocol stack type priority preset by the client device may be pre-agreed.
  • Step 406 The KMC encrypts the first negotiation response message to be sent by using the KMC private key, and the first negotiation response message carries a protocol stack type selected in step 405.
  • Step 407 The KMC sends the encrypted first negotiation response message to the client device.
  • Step 408 The client device decrypts the received encrypted first negotiation response message by using the KMC public key.
  • the client device may directly obtain a protocol stack type supported by the KMC and the KMC supported by the KMC from the first negotiation response message, and the subsequent client device may use the protocol stack type to perform a KMIP session with the KMC.
  • the main body of the public-private key pair may also be a client device, wherein the client device may pre-set the client public key and the client. End the private key, and publish the client public key, and save the client private key.
  • the subsequent client device may encrypt the message to be sent to the KMC by using the client private key, and decrypt the message received from the KMC by using the client private key, and accordingly, the KMC utilizes the The client public key decrypts the message received from the client device and encrypts the message to be sent to the client device using the client public key.
  • the client device encrypts the negotiation request message sent to the KMC by using the client private key, and the KMC decrypts the received encrypted negotiation request message by using the client public key; when the KMC returns the first to the client device
  • the first negotiation response message to be sent by the client public key is encrypted
  • the client device decrypts the received encrypted first negotiation response message by using the client private key.
  • the protocol stack type negotiation method of the present invention is another embodiment.
  • the first negotiation device is a client device
  • the second negotiation device is a KMC, where the KMC and the client device jointly select a protocol.
  • the stack type uses the public-private key set by the client device to encrypt and decrypt the information transmitted during the negotiation of the protocol stack type.
  • Step 501 The client device encrypts the negotiation request message to be sent by using the client private key, and the negotiation request message carries all protocol stack types supported by the client device.
  • the client device may preset the client public key and the client private key, advertise the client public key, and save the client private key.
  • Step 502 The client device sends the negotiation request message encrypted in step 501 to the KMC.
  • Step 503 The KMC decrypts the received encrypted negotiation request message by using the client public key.
  • the system may have multiple client devices respectively performing KMIP sessions with the KMC, and each client device may separately set the client public key and the client private key, and advertise the client public key, and save the client private key, KMC.
  • the client public key After receiving the client public key advertised by the client device, the client public key may be stored in association with the identifier of the client device, so as to receive the negotiation request message sent by the client device, and then carry the message according to the negotiation request message.
  • the identifier of the client device in the corresponding relationship between the pre-stored client public key and the identifier of the client device, find the client public key corresponding to the identifier of the client device, and negotiate with the found client public key pair
  • the request message is decrypted, and the correspondence between the client public key stored in the KMC and the identifier of the client device is shown in Table 3.
  • Step 504 The KMC selects all protocol stack types supported by the KMC and the client device according to all protocol stack types supported by the client device carried by the negotiation request message and all protocol stack types supported by the KMC.
  • Step 505 The KMC encrypts the first negotiation response message to be sent by using the client public key.
  • the first negotiation response message carries all protocol stack types supported by the KMC and the client device.
  • the first negotiation response message may only carry all the protocol stack types supported by the KMC and the client device, and may further carry the priority corresponding to each protocol stack type set by the KMC.
  • the first negotiation response message may also carry only all protocol stack types supported by the KMC, and may be combined by the client device according to all protocol stack types supported by the KMC carried by the first negotiation response message, and the client device itself. All the types of protocol stacks supported by the KMC and the client device are selected.
  • the first negotiation response message may further carry the priority corresponding to each protocol stack type set by the KMC.
  • Step 506 The KMC sends the encrypted first negotiation response message to the client device.
  • Step 507 The client device decrypts the received encrypted first negotiation response message by using the client private key.
  • the protocol stack supported by the KMC and the client device can be one or more.
  • the client device can also support the KMC and the client device.
  • a protocol stack type is pre-selected, and the selected protocol stack type is sent to the KMC, so that when the client device performs a KMIP session with the KMC, both parties use the selected protocol stack type.
  • the KMIP session therefore, the embodiment of the present invention may further include multiple optional steps, as follows, step 508 to step 511.
  • Step 508 The client device selects a protocol stack type from all protocol stack types supported by the KMC and the client device carried by the first negotiation response message.
  • the client device may adopt any one of the following methods when selecting a protocol stack type: randomly select a protocol stack type from all protocol stack types supported by the KMC and the client device;
  • a protocol stack type is selected according to the protocol stack type priority set by the client device; from all protocol stack types supported by the KMC and the client device, according to the first
  • the priority of the protocol stack type preset by the KMC carried in the negotiation response message is selected as a protocol stack type.
  • Step 509 The client device encrypts the second negotiation response message to be sent by using the client private key, and the second negotiation response message carries a protocol stack type selected in step 508.
  • Step 510 The client device sends the encrypted second negotiation response message to the KMC.
  • Step 511 The KMC decrypts the encrypted second negotiation response message by using the client public key, and the KMC uses the protocol stack type carried in the second negotiation response message when the KMC performs a KMIP session with the client device.
  • the client device performs a KMIP session.
  • the main body of the public-private key pair may also be a KMC.
  • the specific encryption and decryption processing process is not described here. As shown in FIG.
  • the first negotiation device is a client device
  • the second negotiation device is a KMC
  • the KMC unilaterally selects a protocol stack type
  • the selected protocol stack type is sent to the client device, and the information transmitted by the protocol stack type is encrypted and decrypted by using the symmetric key, and the robustness of the random number enhanced encryption and decryption is introduced to ensure the protocol stack type negotiation process information. It has not been tampered with, and its specific processing flow is as follows:
  • Step 601 The client device and the KMC share a symmetric key Key.
  • Step 602 The client device sends a negotiation request message to the KMC.
  • the negotiation request message carries two parts of content: Contentl, Content2.
  • Contentl may contain only all protocol stack types supported by the client device itself, and may further include the priority corresponding to each protocol stack type set by the client device.
  • Content2 is the ciphertext output obtained after executing the encryption function encryptFunc (ClientRandl, Contentl, Key).
  • the parameter ClientRandl is a random number generated by the client device. It is the same as the parameter Contentl as the plaintext input in the encryption algorithm.
  • the parameter Key is the symmetric key Key in step 601, and is used as the encryption key in the function encryptFunc.
  • Step 603 The KMC determines the validity of the negotiation request message.
  • the KMC first performs a decryption function decryptFunc (Content2, Key carried in step 602) to obtain a plaintext output.
  • the parameter Key is the symmetric key Key in step 601, and is used as the decryption key in the function decryptFunc. If the decryption fails, indicating that the negotiation request message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get ClientRandl ' , Contentl '.
  • the KMC compares Contentl ' with the Contentl carried in step 602. If the two are inconsistent, indicating that the negotiation request message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the negotiation request message is valid, continue to negotiate.
  • Step 604 The KMC determines, according to all protocol stack types supported by the client device in the Content1 carried in the negotiation request message, and all protocol stack types supported by the KMC, to determine all protocol stack types supported by the KMC and the client device.
  • Step 605 The KMC selects a protocol stack type from all the protocol stack types supported by the determined KMC and the client device.
  • the KMC can select a protocol stack type in any of the following ways: From the protocol stack types supported by the KMC and the client device, a protocol stack type is randomly selected; according to the client device carried in the negotiation request message.
  • the protocol stack type priority is set. From all the protocol stack types supported by the KMC and the client device, a protocol stack type is selected according to a preset policy, for example, a protocol stack type with the highest priority is selected in advance. Or pre-set to select a protocol stack type with the lowest priority; From all protocol stack types supported by the KMC and the client device, according to the protocol stack type priority preset by the KMC, a protocol stack type is selected according to a preset policy, for example, a protocol with the highest priority is selected in advance. Stack type, or pre-set to select a protocol stack type with the lowest priority.
  • Step 606 The KMC sends a first negotiation response message to the client device, where the first negotiation response message carries two parts of content: Content3 and Content4.
  • Content3 is a protocol stack type selected in step 605.
  • Content4 is the ciphertext output obtained by executing the encryption function encryptFunc (random number combination, Content3, Key).
  • the parameter "random number combination” may only include the ClientRandl ' decrypted in step 603, and may further include the random number KMCRand1 generated by the KMC. Two random numbers can be combined by means of / or / connection.
  • the "random number combination" is the same as the plaintext input in the encryption algorithm, and the parameter Key is the symmetric key Key in step 601, and is used as the encryption key in the function encryptFunc.
  • Step 607 The client device determines validity of the first negotiation response message.
  • the client device first performs a decryption function decryptFunc (Contents Key carried in step 606) to obtain a plaintext output. If the decryption fails, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get the random number combination ', Cont en t3 '.
  • the client device compares Contents ' with Content3 carried in step 606. If the two are inconsistent, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the first negotiation response message is valid, the protocol stack type in Cont en t3 is selected as the negotiated protocol stack type. As shown in FIG.
  • the first negotiation device is a client device
  • the second negotiation device is a KMC, where the KMC and the client device jointly select a protocol.
  • the stack type the client device sends the finally selected protocol stack type to the KMC, and uses the symmetric key to encrypt and decrypt the information transmitted during the negotiation of the protocol stack type, and introduces random number enhancement encryption and decryption robustness.
  • the specific processing procedure is as follows: Step 701: The client device and the KMC share the symmetric key Key.
  • Step 702 The client device sends a negotiation request message to the KMC.
  • the negotiation request message carries two parts of content: Contentl, Content2.
  • Contentl may contain only all protocol stack types supported by the client device itself, and may further include the priority corresponding to each protocol stack type set by the client device.
  • Content2 is the ciphertext output obtained after executing the encryption function encryptFunc (ClientRandl, Contentl, Key).
  • the parameter ClientRandl is a random number generated by the client device, which is the same as the parameter Contentl.
  • the parameter Key is the symmetric key Key in step 701, and is used as the encryption key in the function encryptFunc.
  • Step 703 The KMC determines the validity of the negotiation request message.
  • the KMC first performs the decryption function decryptFunc (Content2, Key carried in step 702) to obtain the plaintext output.
  • the parameter Key is the symmetric key Key in step 701, and is used as the decryption key in the function decryptFunc. If the decryption fails, indicating that the negotiation request message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get ClientRandl ' , Content 1 '.
  • the KMC then compares the Content with the Contentl carried in step 702. If the two are inconsistent, indicating that the negotiation request message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the negotiation request message is valid, continue to negotiate.
  • Step 704 The KMC selects all protocol stack types supported by the KMC and the client device according to all protocol stack types supported by the client device in the Content1 carried in the negotiation request message, and all protocol stack types supported by the KMC.
  • Step 705 The KMC sends the first negotiation response message to the client device.
  • the first negotiation response message carries two parts of content: Content3, Content4.
  • Content3 can contain only all the protocol stack types supported by the KMC and the client device, and can further include the priority corresponding to each protocol stack type set by the KMC.
  • Content4 is the ciphertext output obtained after executing the encryption function encryptFunc (random number combination, Content3, Key).
  • the parameter "random number combination” may include only the ClientRand1 ' obtained by decrypting in step 703, and may further include the random number KMCRand1 generated by the KMC. Two random numbers can be combined by means of / or / connection.
  • the "random number combination" is the same as the plaintext input in the encryption algorithm, and the parameter Key is the symmetric key Key in step 701, and is used as the encryption key in the function encryptFunc.
  • the Cont en t3 in the first negotiation response message may also include only all protocol stack types supported by the KMC, and may be combined with the client device according to all protocol stack types supported by the KMC carried by the first negotiation response message.
  • the protocol stack type supported by the device itself is selected by the KMC and the client device.
  • the Cont en t3 in the first negotiation response message may further carry the priority corresponding to each protocol stack type set by the KMC.
  • the protocol stack supported by the KMC and the client device can be one or more.
  • the client device can also support the KMC and the client device.
  • a protocol stack type is pre-selected, and the selected protocol stack type is sent to the KMC, so that when the client device performs a KMIP session with the KMC, both parties use the selected protocol stack type.
  • KMIP session therefore, the embodiment of the present invention further includes multiple optional Steps, as follows, step 707, step 708 and step 709.
  • Step 706 The client device determines validity of the first negotiation response message.
  • the client device first performs a decryption function decryptFunc (Contents Key carried in step 705) to obtain a plaintext output. If the decryption fails, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get the random number combination ', Cont en t3 '.
  • the client device compares Contents ' with Content3 carried in step 705. If the two are inconsistent, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, the first negotiation response message is valid, and the negotiation is continued. Step 707: The client device selects a protocol stack type from all protocol stack types supported by the KMC and the client device in the Cont en t3 carried in the first negotiation response message.
  • any one of the following selection methods may be adopted:
  • a protocol stack type is randomly selected
  • a protocol stack type is selected according to a preset policy, for example, a preset with the highest priority is selected.
  • the protocol stack type, or a protocol stack type with the lowest priority is selected in advance; from all the protocol stack types supported by the KMC and the client device, the protocol stack type preset according to the KMC carried in the first negotiation response message takes precedence.
  • select a protocol stack type according to a preset policy for example, pre-set to select a protocol stack type with the highest priority, or pre-set to select a protocol stack type with the lowest priority.
  • Step 708 The client device sends a second negotiation response message to the KMC, where the second negotiation response message carries two parts: Content5, Content6.
  • Content5 is a protocol stack type selected in step 707.
  • Content6 is the ciphertext output obtained by executing the encryption function encryptFunc (random number combination, Content5, Key).
  • the parameter "random number combination” may include only the ClientRand1 in the negotiation request message, or only the random number ClientRand2 regenerated by the client device, and may further include the random number KMCRand1 generated by the KMC in Content4 in step 705. Two random numbers can be combined by means of / or / connection.
  • the "random number combination” is the same as the plaintext input in the encryption algorithm, and the parameter Key is the symmetric key Key in step 701, and is used as the encryption key in the function encryptFunc.
  • Step 709 The KMC determines the validity of the second negotiation response message.
  • the KMC first executes the decryption function decryptFunc (Content6, Key carried in step 708) to obtain the plaintext output. If the decryption fails, indicating that the second negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get the random number combination ', Content5'. KMC compares Content5 ' With Content5 carried in step 708, if the two are inconsistent, indicating that the second negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the second negotiation response message is valid, the protocol stack type in Content6 is selected as the negotiated protocol stack type.
  • decryptFunc Content6, Key carried in step 708
  • the KMC may perform a KMIP session with the client device by using the protocol stack type carried in the second negotiation response message when performing a KMIP session with the client device.
  • the following describes an embodiment in which the first negotiation device is a KMC, that is, a negotiation request is initiated by the KMC.
  • the first negotiation device is a KMC
  • the second negotiation device is a client device, where the client device unilaterally selects a protocol stack type. Then, the selected protocol stack type is sent to the KMC, and the information transmitted by the protocol stack type is encrypted and decrypted by using the public and private keys set by the KMC.
  • the specific processing flow is as follows:
  • Step 801 The KMC encrypts the negotiation request message to be sent by using the KMC private key.
  • the KMC can pre-set the KMC public key and the KMC private key, publish the KMC public key, and save the KMC private key.
  • the negotiation request message may carry only all the protocol stack types supported by the KMC, and may further carry the priority corresponding to each protocol stack type set by the KMC.
  • Step 802 The KMC sends the negotiation request message encrypted in step 801 to the client device.
  • Step 803 The client device decrypts the received encrypted negotiation request message by using the KMC public key.
  • Step 804 The client device determines, according to all protocol stack types supported by the KMC carried in the negotiation request message, all protocol stack types supported by the KMC and the client device, in combination with all protocol stack types supported by the client device.
  • Step 805 The client device selects a protocol stack type from all the protocol stack types supported by the determined KMC and the client device.
  • the client device may select a protocol stack type by using any one of the following methods: From the protocol stack types supported by the KMC and the client device, randomly select a protocol stack type; according to a protocol preset by the client device The stack type priority, from all the protocol stack types supported by the KMC and the client device, select a protocol stack type according to a preset policy; according to the protocol preset by the KMC carried in the received negotiation request message Stack type priority. From all protocol stack types supported by KMC and client devices, select a protocol stack type according to a preset policy.
  • Step 806 The client device encrypts the first negotiation response message to be sent by using the KMC public key.
  • the first negotiation response message carries a protocol stack type selected in step 805.
  • Step 807 The client device sends the encrypted first negotiation response message to the KMC.
  • Step 808 The KMC decrypts the received encrypted first negotiation response message by using the KMC private key.
  • the KMC can obtain a protocol stack type supported by the client device and the KMC jointly supported by the client device from the first negotiation response message, and the KMC can use the protocol stack type to perform a KMIP session with the client device.
  • the main body of the public-private key pair may also be a client device, wherein the client device may pre-set the client public key and the client. End the private key, and publish the client public key, and save the client private key.
  • the subsequent client device may encrypt the message to be sent to the KMC by using the client private key, and decrypt the message received from the KMC by using the client private key, and accordingly, the KMC utilizes the The client public key decrypts the message received from the client device and encrypts the message to be sent to the client device using the client public key.
  • the KMC encrypts the negotiation request message sent to the client device by using the client public key, and the client device decrypts the received encrypted negotiation request message by using the client private key; when the client device returns to the KMC
  • the first negotiation response message is used, the first negotiation response message to be sent by the client private key is encrypted, and the KMC decrypts the received encrypted first negotiation response message by using the client public key.
  • FIG. 9 another embodiment of the method for negotiating a protocol stack type according to the present invention is as follows: in this embodiment, the first negotiation device is a KMC, and the second negotiation device is a client device, where the client device and the KMC jointly select a protocol.
  • the stack type uses the public-private key set by the client device to encrypt and decrypt the information transmitted during the negotiation of the protocol stack type.
  • the specific processing flow is as follows:
  • Step 901 The KMC encrypts the negotiation request message to be sent by using the client public key, and the negotiation request message carries all protocol stack types supported by the KMC.
  • the negotiation request message may carry only all the protocol stack types supported by the KMC, and may further carry the priority corresponding to each protocol stack type set by the KMC.
  • the client device may preset the client public key and the client private key, advertise the client public key, and save the client private key.
  • each client device may separately set a client public key and a client private key, and advertise the client public key, and save the client.
  • the private key after receiving the client public key published by the client device, the KMC can contact the client public key with the client.
  • the identifier of the client device is correspondingly stored, so that the client corresponding to the identifier of the client device is found in the correspondence between the pre-stored client public key and the identifier of the client device when the client device performs protocol stack type negotiation.
  • the public key, and the negotiation request message to be sent is encrypted by the found client public key.
  • Step 902 The KMC sends the negotiation request message encrypted in step 901 to the client device.
  • Step 903 The client device decrypts the received encrypted negotiation request message by using the client private key.
  • Step 904 The client device selects all protocol stack types supported by the KMC and the client device according to all protocol stack types supported by the KMC carried by the negotiation request message and all protocol stack types supported by the client device.
  • Step 905 The client device encrypts the first negotiation response message to be sent by using the client private key, where the first negotiation response message carries all protocol stack types supported by the KMC and the client device.
  • the first negotiation response message may only carry all the protocol stack types supported by the KMC and the client device, and may further carry the priority corresponding to each protocol stack type set by the client device.
  • the first negotiation response message may also carry only all protocol stack types supported by the client device, and may be combined with the KMC itself according to all protocol stack types supported by the client device carried by the first negotiation response message. All the types of protocol stacks supported by the KMC and the client device are selected. The first negotiation response message may further carry the priority corresponding to each protocol stack type set by the client device.
  • Step 906 The client device sends the encrypted first negotiation response message to the KMC.
  • Step 907 The KMC decrypts the received encrypted first negotiation response message by using the client public key.
  • the KMC and the client device can support only one protocol type or multiple.
  • the KMC and the client device can also support the KMC and the client device.
  • a protocol stack type is pre-selected, and the subsequent KMC performs a KMIP session with the client device by using the selected protocol stack type when performing a KMIP session with the client device. Therefore, the present invention implements The example also includes a plurality of optional steps, as follows step 908 to step 911.
  • Step 908 The KMC selects a protocol stack type from all protocol stack types supported by the KMC and the client device carried by the first negotiation response message.
  • the KMC may select any of the following methods when selecting the protocol stack type: From the protocol stack types supported by the KMC and the client device, a protocol stack type is randomly selected; according to the KMC Pre-set protocol stack type priority, from all protocol stack types supported by the KMC and the client device, selecting a protocol stack type according to a preset policy; according to the received first negotiation response message The pre-set protocol stack type priority of the client device. From all protocol stack types supported by the KMC and the client device, a protocol stack type is selected according to a preset policy.
  • Step 909 The KMC encrypts the second negotiation response message to be sent by using the client public key, and the second negotiation response message carries a protocol stack type selected by step 908.
  • Step 910 The KMC sends the encrypted second negotiation response message to the client device.
  • Step 911 The client device decrypts the encrypted second negotiation response message by using the client private key, and then the client device uses the protocol stack type carried in the second negotiation response message when performing KMIP session with the KMC. A KMIP session with the KMC.
  • the protocol stack type negotiation method of the present invention is another embodiment.
  • the first negotiation device is a KMC
  • the second negotiation device is a client device, where the client device unilaterally selects a protocol stack type. Then, the selected protocol stack type is sent to the KMC, and the information transmitted by the protocol stack type is encrypted and decrypted by using the symmetric key, and the random number enhanced encryption and decryption robustness is introduced to ensure the protocol stack type negotiation process information. It has not been tampered with, and its specific processing flow is as follows:
  • Step 1001 The KMC shares the symmetric key Key with both client devices.
  • Step 1002 The KMC sends a negotiation request message to the client device.
  • the negotiation request message carries two parts of content: Contentl, Content2
  • Contentl can contain only all the protocol stack types supported by the KMC itself, and can further include the priority corresponding to each protocol stack type set by the KMC.
  • Content2 is the ciphertext output obtained after executing the encryption function encryptFunc (KMCRandl , Contentl , Key).
  • the parameter KMCRandl is a random number generated by KMC. It is the same as the parameter Contentl as the plaintext input in the encryption algorithm.
  • the parameter Key is the symmetric key Key in step 1001, and is used as the encryption key in the function encryptFunc.
  • Step 1003 The client device determines the validity of the negotiation request message.
  • the client device first performs a decryption function decryptFunc (Content2, Key carried in step 1002) to obtain a plaintext output.
  • the parameter Key is the symmetric key Key in step 1001 and is used as the decryption key in the function decryptFunc. If the decryption fails, indicating that the negotiation request message is invalid (may have been tampered with), then the end Negotiation. If the decryption is successful, get KMCRandl ' , Content 1 '.
  • the client device compares Contentl ' with Contentl carried in step 1002. If the two are inconsistent, indicating that the negotiation request message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the negotiation request message is valid, continue to negotiate.
  • Step 1004 The client device determines, according to all protocol stack types supported by the KMC in Contentl carried in the negotiation request message, and all protocol stack types supported by the client device, to determine all protocol stack types supported by the KMC and the client device. .
  • Step 1005 The client device selects a protocol stack type from all protocol stack types supported by the determined KMC and the client device.
  • the client device may select a protocol stack type in any of the following ways: From all protocol stack types supported by the KMC and the client device, randomly select a protocol stack type; according to a protocol stack preset by the client device.
  • Type priority from all protocol stack types supported by the KMC and the client device, select a protocol stack type according to a preset policy, for example, preset a protocol stack type with the highest priority, or preset Select a protocol stack type with the lowest priority; from all the protocol stack types supported by the KMC and the client device, select a protocol stack type priority set by the KMC carried in the negotiation request message, and select one according to a preset policy.
  • the protocol stack type for example, is preset to select a protocol stack type with the highest priority, or preset to select a protocol stack type with the lowest priority.
  • Step 1006 The client device sends a first negotiation response message to the KMC, where the first negotiation response message carries two parts: Content3, Content4.
  • Content3 is a protocol stack type selected in step 1005.
  • Content4 is the ciphertext output obtained by executing the encryption function encryptFunc (random number combination, Content3, Key).
  • the parameter "random number combination” may only include the KMCRandl ' decrypted in step 1103, and may further include a random number ClientRandl generated by the client device. Two random numbers can be combined by means of / or / connection.
  • the "random number combination” is the same as the plaintext input in the encryption algorithm, and the parameter Key is the symmetric key Key in step 1001, and is used as the encryption key in the function encryptFunc.
  • Step 1007 The KMC determines the validity of the first negotiation response message.
  • the KMC first performs a decryption function decryptFunc (Content4, Key carried in step 1006) to obtain a plaintext output. If the decryption fails, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get the random number combination ', Content3'. The KMC then compares Content3' with Content3 carried in step 1006. If the two are inconsistent, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the first negotiation response message is valid, the protocol stack type in Content3 is selected as the negotiated protocol stack type. As shown in FIG.
  • decryptFunc Content4, Key carried in step 1006
  • the first negotiation device is a KMC
  • the second negotiation device is a client device, where the client device and the KMC jointly select a protocol.
  • the stack type, and then the KMC sends the finally selected protocol stack type to the client device, and uses the symmetric key to encrypt and decrypt the information transmitted during the protocol stack type negotiation, and introduces random number enhancement encryption and decryption robustness.
  • the specific processing procedure is as follows: Step 1101: The KMC and the client device share the symmetric key Key.
  • Step 1102 The KMC sends a negotiation request message to the client device.
  • the negotiation request message carries two parts of content: Contentl, Content2.
  • Contentl can contain only all the protocol stack types supported by the KMC itself, and can further include the priority corresponding to each protocol stack type set by the KMC.
  • Content2 is the ciphertext output obtained after executing the encryption function encryptFunc (KMCRandl , Contentl , Key).
  • the parameter KMCRandl is a random number generated by KMC, which is the same as the parameter Contentl as the plaintext input in the encryption algorithm.
  • the parameter Key is the symmetric key Key in step 1101, and is used as the encryption key in the function encryptFunc.
  • Step 1103 The client determines the validity of the negotiation request message.
  • the client device first performs a decryption function decryptFunc (Content2, Key carried in step 1102) to obtain a plaintext output.
  • the parameter Key is the symmetric key Key in step 1101 and is used as the decryption key in the function decryptFunc. If the decryption fails, indicating that the negotiation request message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get KMCRandl ' , Contentl '. The client device then compares Contentl ' with the Contentl carried in step 1102. If the two are inconsistent, indicating that the negotiation request message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the negotiation request message is valid, continue to negotiate.
  • Step 1104 The client device selects all protocol stack types supported by the KMC and the client device according to all protocol stack types supported by the KMC in the Contentl carried in the negotiation request message, and all protocol stack types supported by the client device. .
  • Step 1105 The client device sends a first negotiation response message to the KMC.
  • the first negotiation response message carries two parts of content: Content3, Content4.
  • Content3 can contain only all protocol stack types supported by the KMC and the client device, and can further include the priority corresponding to each protocol stack type set by the client device.
  • Content4 is the ciphertext output obtained after executing the encryption function encryptFunc (random number combination, Content3, Key).
  • the parameter "random number combination” may include only the KMCRandl ' decrypted in step 1103, and may further include a random number ClientRand1 generated by the client device. Two random numbers can pass and / or / A combination of connections and the like.
  • the "random number combination” is the same as the plaintext input in the encryption algorithm, and the parameter Key is the symmetric key Key in step 1101, and is used as the encryption key in the function encryptFunc.
  • the Cont en t3 in the first negotiation response message may also carry only all protocol stack types supported by the client device, and may be combined by the KMC according to all protocol stack types supported by the client device carried by the first negotiation response message.
  • the protocol stack type supported by the KMC itself is selected by the protocol stack type supported by the KMC and the client device.
  • the Cont en t3 in the first negotiation response message may further carry the protocol stack type corresponding to the client device. priority.
  • the KMC and the client device can support only one protocol type or multiple.
  • the KMC and the client device can also support the KMC and the client device.
  • a protocol stack type is pre-selected, and the subsequent KMC performs a KMIP session with the client device by using the selected protocol stack type when performing a KMIP session with the client device. Therefore, the present invention implements The example also includes a plurality of optional steps, as follows, step 1107, step 1108, and step 1109.
  • Step 1106 The KMC determines the validity of the first negotiation response message.
  • the KMC first performs the decryption function decryptFunc (Content4, Key carried in step 1105) to obtain the plaintext output. If the decryption fails, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get the random number combination ', Content3'. The KMC then compares Content3' with the Content3 carried in step 1105. If the two are inconsistent, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the first negotiation response message is valid, continue to negotiate.
  • decryptFunc Content4, Key carried in step 1105
  • Step 1107 The KMC selects a protocol stack type from all protocol stack types supported by the KMC and the client device carried by the first negotiation response message.
  • the KMC selects the protocol stack type, it can adopt any of the following selection methods: From the protocol stack types supported by the KMC and the client device, a protocol stack type is randomly selected; according to the protocol stack type preset by the KMC Priority, from all the protocol stack types supported by the KMC and the client device, select a protocol stack type according to a preset policy, for example, preset a protocol stack type with the highest priority, or preset Selecting a protocol stack type with the lowest priority; according to the protocol stack type priority preset by the client device carried in the received first negotiation response message, from all protocol stack types supported by the KMC and the client device Select a protocol stack type according to a preset policy, for example, pre-set to select a protocol stack type with the highest priority, or pre-set to select a protocol stack type with the lowest priority.
  • Step 1108 The KMC sends a second negotiation response message to the client device, where the second negotiation response message carries two parts: Content5, Content6.
  • Content5 is a protocol stack type selected in step 1107.
  • Content6 is the ciphertext output obtained by executing the encryption function encryptFunc (random number combination, Content5, Key).
  • the parameter "random number combination” may include only the KMCRand1 in the negotiation request message, or only the KMC regenerated KMCRand2, and may further include the random number ClientRand1 generated by the client device in Content1 in step 1105. Two random numbers can be combined by means of / or / connection.
  • the "random number combination” and Cont en t5 are the plaintext input in the encryption algorithm, and the parameter Key is the symmetric key Key in step 1101, and is used as the encryption key in the function encryptFunc.
  • Step 1109 The client device determines validity of the second negotiation response message.
  • the client device first performs a decryption function decryptFunc (Content6, Key carried in step 1108) to obtain a plaintext output. If the decryption fails, indicating that the second negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get the random number combination ', Contents'. The client device compares the Contents ' with the Content5 carried in step 1108. If the two are inconsistent, indicating that the second negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the second negotiation response message is valid, the protocol stack type in Contents is selected as the negotiated protocol stack type.
  • decryptFunc Content6, Key carried in step 1108
  • the client device may perform a KMIP session with the KMC by using the protocol stack type carried in the second negotiation response message when performing a KMIP session with the KMC.
  • the present invention also provides an embodiment of the protocol stack type negotiation apparatus.
  • FIG. 12 An embodiment of the protocol stack type negotiation device of the present invention is shown in FIG. 12, where the device is configured in a first negotiation device that performs protocol stack type negotiation with the second negotiation device, and includes:
  • the negotiation request message sending unit 1201 is configured to send a negotiation request message to the second negotiation device, where the negotiation request message carries the protocol stack type supported by the first negotiation device, so that the second negotiation device is configured according to the Selecting a protocol stack type supported by the first negotiation device that is carried in the negotiation request message, and selecting a protocol stack type supported by the second negotiation device and the first negotiation device;
  • the first negotiation response message receiving unit 1202 is configured to receive a first negotiation response message that is sent by the second negotiation device according to the negotiation request message sent by the negotiation request message sending unit 1201;
  • the protocol stack type obtaining unit 1203 is configured to obtain, according to the first negotiation response message received by the first negotiation response message receiving unit 1202, a protocol stack supported by the second negotiation device and the first negotiation device. Types of.
  • the client device before the KMIP session with the KMC, the client device does not randomly select the protocol stack type to perform the KMIP session, but one party serves as the first negotiation device, and the other party acts as the second.
  • the negotiation device sends a negotiation request message carrying the protocol stack type supported by the first negotiation device to the second negotiation device through the negotiation request message sending unit 1201 in the protocol stack type negotiation device, which is set in the first negotiation device, and then
  • the first negotiation response message receiving unit 1202 receives the first negotiation response message fed back by the second negotiation device, and the protocol stack type obtaining unit 1203 obtains the protocol supported by the second negotiation device and the first negotiation device by using the first negotiation response message.
  • the stack type that is, the type of protocol stack that is supported by the KMC and the client device.
  • the protocol stack type negotiated by the first negotiation device and the second negotiation device is a protocol stack type supported by the second negotiation device and the first negotiation device, and therefore, the KMC and the client are subsequently
  • the protocol stack type used by the two parties is the protocol stack type supported by the KMC and the client device. Therefore, both the KMC and the client device can correctly parse the received KMIP message; and, the client device and The KMC chooses the protocol stack type through auto-negotiation, so it does not need to be manually configured for easy maintenance.
  • the first negotiation response message received by the first negotiation response message receiving unit 1202 carries the second negotiation device and the two parties jointly support at least one protocol stack.
  • the protocol stack type obtaining unit 1203 is specifically configured to: select, from the first negotiation response message received by the first negotiation response message receiving unit 1202, one of the second negotiation device and the first negotiation device to support Protocol stack type.
  • the first negotiation response message received by the first negotiation response message receiving unit 1202 further carries a protocol stack type priority preset by the second negotiation device;
  • the protocol stack type obtaining unit 1203 is specifically configured to: according to the protocol stack type priority set by the second negotiation device, the first negotiation response message received by the first negotiation response message receiving unit 1202 At least one protocol stack type supported by the two parties determined by the second negotiation device, and a protocol stack type supported by the second negotiation device and the first negotiation device is selected.
  • the negotiation request message sent by the negotiation request message sending unit 1201 further carries a protocol stack type priority set in advance by the first negotiation device;
  • the first negotiation response message received by the first negotiation response message receiving unit 1202 carries a protocol stack type supported by the two parties selected by the second negotiation device, where the two parties jointly support one protocol.
  • the stack type is a protocol stack type supported by the first negotiation device and a protocol preset by the first negotiation device, which are carried by the second negotiation device according to the negotiation request message sent by the negotiation request message sending unit 1201.
  • the first negotiation response message received by the first negotiation response message receiving unit 1202 carries the protocol stack type supported by the second negotiation device;
  • the protocol stack type obtaining unit 1203 is specifically configured to: select, according to the protocol stack type supported by the second negotiation device, in the first negotiation response message received by the first negotiation response message receiving unit 1202, Negotiating the type of protocol stack supported by the device and the first negotiation device.
  • the first negotiation response message received by the first negotiation response message receiving unit 1202 further carries a protocol stack type priority preset by the second negotiation device;
  • the protocol stack type obtaining unit 1203 is specifically configured to: prior to the protocol stack type priority set by the second negotiation device carried in the first negotiation response message received by the first negotiation response message receiving unit 1202, Determining a protocol stack type supported by the second negotiation device, and determining a protocol stack type supported by the second negotiation device and the first negotiation device.
  • FIG. 13 is another embodiment of the protocol stack type negotiation device of the present invention.
  • the device is configured in a first negotiation device that performs protocol stack type negotiation with the second negotiation device, and includes:
  • the negotiation request message sending unit 1301 is configured to send a negotiation request message to the second negotiation device, where the negotiation request message carries the protocol stack type supported by the first negotiation device;
  • the first negotiation response message receiving unit 1302 is configured to receive a first negotiation response message that is sent by the second negotiation device according to the negotiation request message sent by the negotiation request message sending unit 1301;
  • a protocol stack type obtaining unit 1303, configured to obtain, according to the first negotiation response message received by the first negotiation response message receiving unit 1302, a protocol stack type supported by the second negotiation device and the first negotiation device;
  • the second negotiation response message sending unit 1304 is configured to send a second negotiation response message to the second negotiation device, where the second negotiation response message carries a protocol stack type commonly supported by the two parties selected by the first negotiation device.
  • FIG. 14 is another embodiment of a protocol stack type negotiation apparatus according to the present invention, where the apparatus is disposed in The first negotiation device that negotiates the protocol stack type by the second negotiation device includes:
  • the key interaction unit 1401 is configured to exchange key information with the second negotiation device before the negotiation request message sending unit 1402 sends the negotiation request message to the second negotiation device, so that the first negotiation device and the device
  • the second negotiation device uses the public-private key encryption and decryption mechanism to perform protocol stack type negotiation according to the key information.
  • the negotiation request message sending unit 1402 is configured to send, according to the key interaction unit, the second negotiation device.
  • the negotiation request message after the encrypted key information is encrypted where the negotiation request message carries the protocol stack type supported by the first negotiation device;
  • the first negotiation response message receiving unit 1403 is configured to receive the encrypted first negotiation response message that is fed back by the second negotiation device according to the negotiation request message, and the key information pair that is exchanged according to the key interaction unit 1401. Decrypting the encrypted first negotiation response message to obtain a first negotiation response message; the protocol stack type obtaining unit 1404 is configured to obtain, according to the first negotiation response message received by the first negotiation response message receiving unit 1403, The protocol stack type supported by the second negotiation device and the first negotiation device.
  • the key interaction unit 1401 specifically includes: a key setting subunit, configured to advance the negotiation request message sending unit 1402 before sending the negotiation request message to the second negotiation device. Setting a first negotiation device private key and a first negotiation device public key;
  • a private key storage sub-unit configured to store a first negotiation device private key set by the key setting sub-unit
  • a public key sending sub-unit configured to set the first negotiation device set by the key setting sub-unit Sending a key to the second negotiation device
  • the negotiation request message sending unit 1402 is specifically configured to send, to the second negotiation device, the negotiation request message that is encrypted by the first negotiation device private key stored by the private key storage subunit, where the negotiation request message is included. Carrying all protocol stack types supported by the first negotiation device;
  • the first negotiation response message receiving unit 1403 is configured to receive, after the second negotiation device encrypts, the first negotiation device public key that is sent by the public key sending subunit, according to the negotiation request message, a negotiation response message, the first negotiation response message carries a protocol stack type supported by the second negotiation device, and the first negotiation device private key stored by the private key storage subunit is used to encrypt the The first negotiation response message is decrypted to obtain a first negotiation response message.
  • the key interaction unit 1401 is specifically configured to: before the negotiation request message sending unit 1402 sends a negotiation request message to the second negotiation device, obtain the second negotiation device to preset The second negotiated device public key.
  • the negotiation request message sending unit 1402 is specifically configured to acquire the information from the key interaction unit 1401.
  • the second negotiation device public key, and the negotiation request message that is encrypted by the second negotiation device public key is sent to the second negotiation device, where the negotiation request message carries all the protocols supported by the first negotiation device.
  • the first negotiation response message receiving unit 1403 is configured to receive, by the second negotiation device, a first negotiation response message that is encrypted by the second negotiation device private key, which is fed back according to the negotiation request message, the first negotiation The response message carries the protocol stack type supported by the second negotiation device, and decrypts the encrypted first negotiation response message by using the second negotiation device public key acquired by the key interaction unit 1401. , get the first negotiation response message.
  • the apparatus is configured in a first negotiation device that performs protocol stack type negotiation with the second negotiation device, and includes:
  • a key sharing unit 1501 configured to share a symmetric key with the second negotiation device
  • the encryption unit 1502 is configured to send, by the first negotiation device, the symmetric key shared by the key sharing unit 1501 and the obtained random number pair to the second negotiation device before sending the message to the second negotiation device.
  • the message is encrypted to obtain a message ciphertext;
  • the negotiation request message sending unit 1503 is configured to send a negotiation request message to the second negotiation device, where the negotiation request message carries the protocol stack type supported by the first negotiation device, so that the second negotiation device is configured according to the Selecting a protocol stack type supported by the first negotiation device that is carried in the negotiation request message, and selecting a protocol stack type supported by the second negotiation device and the first negotiation device;
  • the ciphertext sending unit 1504 is configured to send the message ciphertext obtained by the encryption unit 1502 at the same time when the message is sent, so that the second negotiation device decrypts the received message ciphertext to obtain a message plaintext. Comparing the plaintext of the message with the received message, and continuing the protocol stack type negotiation when the comparison result is the same;
  • the first negotiation response message receiving unit 1505 is configured to receive a first negotiation response message that is sent by the second negotiation device according to the negotiation request message sent by the negotiation request message sending unit 1503.
  • the decryption unit 1506 is configured to: after the first negotiation device receives the message ciphertext sent by the second negotiation device while sending the message, pair the message ciphertext according to the symmetric key shared by the key sharing unit 1501 Decrypting, obtaining a message plaintext, wherein the message ciphertext is that the second negotiation device encrypts the message sent to the first negotiation device according to the symmetric key and the obtained random number, and the obtained message is obtained.
  • the ciphertext comparison unit 1507 is configured to compare the message plaintext obtained by the decryption unit 1506 with the received message, and continue to perform protocol stack type negotiation when the comparison result is the same;
  • the protocol stack type obtaining unit 1508 is configured to obtain, according to the first negotiation response message received by the first negotiation response message receiving unit 1505, a protocol stack type supported by the second negotiation device and the first negotiation device.
  • FIG. 16 is another embodiment of the protocol stack type negotiation device of the present invention.
  • the device is configured in a second negotiation device that performs protocol stack type negotiation with the first negotiation device, and includes:
  • the negotiation request message receiving unit 1601 is configured to receive a negotiation request message sent by the first negotiation device, where the negotiation request message carries a protocol stack type supported by the first negotiation device;
  • the protocol stack type obtaining unit 1602 is configured to select, according to the protocol stack type supported by the first negotiation device that is carried in the negotiation request message received by the negotiation request message receiving unit 1601, the second negotiation device and the first a protocol stack type that is commonly supported by the negotiation device;
  • the first negotiation response message sending unit 1603 is configured to feed back a first negotiation response message to the first negotiation device according to the negotiation request message received by the negotiation request message receiving unit 1601, so that the first negotiation device is configured according to the The first negotiation response message obtains a protocol stack type supported by the second negotiation device and the first negotiation device.
  • the first negotiation response message sent by the first negotiation response message sending unit 1603 carries the protocol stack type supported by the second negotiation device, And causing the first negotiation device to select a protocol stack type supported by the second negotiation device and the first negotiation device according to the protocol stack type supported by the second negotiation device that is carried in the first negotiation response message .
  • the first negotiation response message sent by the first negotiation response message sending unit 1603 further carries a protocol stack type priority preset by the second negotiation device, so that Determining, by the first negotiation device, a second negotiation according to a protocol stack type priority preset by the second negotiation device and a protocol stack type supported by the second negotiation device, which are carried in the first negotiation response message.
  • the type of protocol stack supported by the device and the first negotiation device As shown in FIG. 17, another embodiment of the protocol stack type negotiation apparatus of the present invention is provided, where the apparatus is disposed in a second negotiation device that performs protocol stack type negotiation with the first negotiation device, and includes:
  • the negotiation request message receiving unit 1701 is configured to receive a negotiation request message sent by the first negotiation device, where the negotiation request message carries a protocol stack type supported by the first negotiation device;
  • a protocol stack type obtaining unit 1702 configured to receive according to the negotiation request message receiving unit 1701 Selecting a protocol stack type supported by the first negotiation device that is carried in the negotiation request message, and selecting a protocol stack type supported by the second negotiation device and the first negotiation device;
  • the protocol stack type determining unit 1703 is configured to determine at least one protocol stack type that is supported by the two parties.
  • the first negotiation response message sending unit 1704 is configured to send, according to the negotiation request message received by the negotiation request message receiving unit 1701, the first The negotiation device feeds back a first negotiation response message, where the first negotiation response message carries at least one protocol stack type that is jointly supported by the protocol stack type determining unit 1703, so that the first negotiation device is In the first negotiation response message, a protocol stack type supported by the second negotiation device and the first negotiation device is selected.
  • the first negotiation response message sent by the first negotiation response message sending unit 1704 further carries a protocol stack type preset by the second negotiation device. a priority level, so that the first negotiation device supports the two mutually agreed by the second negotiation device that is carried in the first negotiation response message according to the protocol stack type priority set by the second negotiation device. At least one protocol stack type, selecting a protocol stack type supported by the second negotiation device and the first negotiation device.
  • the device is configured in a second negotiation device that performs protocol stack type negotiation with the first negotiation device, and includes:
  • the negotiation request message receiving unit 1801 is configured to receive a negotiation request message sent by the first negotiation device, where the negotiation request message carries a protocol stack type supported by the first negotiation device and a protocol preset by the first negotiation device. Stack type priority;
  • a protocol stack type obtaining unit 1802 configured to select, according to all protocol stack types supported by the first negotiation device that are carried in the negotiation request message received by the negotiation request message receiving unit 1801, the second negotiation device and the The type of protocol stack supported by the first negotiation device;
  • the selecting unit 1803 is configured to select one of the second negotiation devices according to the protocol stack type supported by the first negotiation device and the protocol stack type priority set by the first negotiation device that are carried in the negotiation request message. a protocol stack type supported by the first negotiation device;
  • the first negotiation response message sending unit 1804 is configured to feed back a first negotiation response message to the first negotiation device according to the negotiation request message received by the negotiation request message receiving unit 1801, where the first negotiation response message carries Another type of protocol stack supported by the two selected by the selecting unit 1803. As shown in FIG. 19, another embodiment of the protocol stack type negotiating apparatus of the present invention is provided.
  • the second negotiation device that negotiates the protocol stack type by the first negotiation device includes:
  • the negotiation request message receiving unit 1901 is configured to receive a negotiation request message sent by the first negotiation device, where the negotiation request message carries a protocol stack type supported by the first negotiation device;
  • the protocol stack type obtaining unit 1902 is configured to select, according to the protocol stack type supported by the first negotiation device that is carried in the negotiation request message received by the negotiation request message receiving unit 1901, the second negotiation device and the first a protocol stack type that is commonly supported by the negotiation device;
  • the first negotiation response message sending unit 1903 is configured to feed back a first negotiation response message to the first negotiation device according to the negotiation request message received by the negotiation request message receiving unit 1901, so that the first negotiation device is configured according to the a first negotiation response message, obtaining a protocol stack type supported by the second negotiation device and the first negotiation device;
  • the second negotiation response message receiving unit 1904 is configured to receive a second negotiation response message sent by the first negotiation device, where the second negotiation response message carries a protocol stack jointly supported by the first selected device by the first negotiation device.
  • Types of As shown in FIG. 20, another embodiment of the protocol stack type negotiation apparatus of the present invention is provided.
  • the apparatus is configured in a second negotiation device that performs protocol stack type negotiation with the first negotiation device, and includes:
  • the key interaction unit 2001 is configured to: before the negotiation request message receiving unit 2002 receives the negotiation request message sent by the first negotiation device, exchange key information with the first negotiation device, so that the first negotiation device and the The second negotiating device performs protocol stack type negotiation by using a public-private key encryption and decryption mechanism according to the key information.
  • the negotiation request message receiving unit 2002 is configured to receive a negotiation request message that is encrypted by the key information exchanged by the key interaction unit 2001 and sent by the first negotiation device, and use the key information to perform the encrypted negotiation request.
  • the message is decrypted to obtain a negotiation request message;
  • the protocol stack type obtaining unit 2003 is configured to select the second negotiation device and the first according to the protocol stack type supported by the first negotiation device that is carried in the negotiation request message received by the negotiation request message receiving unit 2002.
  • the first negotiation response message sending unit 2004 is configured to feed back, to the first negotiation device, a first negotiation response message that is encrypted according to the key information exchanged by the key interaction unit 2001, so that the first negotiation device is configured according to the first negotiation device.
  • the first negotiation response message obtains a protocol stack type supported by the second negotiation device and the first negotiation device.
  • the key interaction unit 2001 specifically includes: a key setting subunit, configured to preset a second negotiation device private key and a second negotiation device public key before the negotiation request message receiving unit 2002 receives the negotiation request message sent by the first negotiation device;
  • a private key storage subunit configured to store a second negotiating device private key set by the key setting subunit; a public key sending subunit, configured to set a second negotiating device set by the key setting subunit The key is sent to the first negotiation device.
  • the key interaction unit 2001 is specifically configured to: obtain the first negotiation device in advance before the negotiation request message receiving unit 2002 receives the negotiation request message sent by the first negotiation device.
  • the first negotiated device public key is set.
  • FIG. 21 another embodiment of the protocol stack type negotiation device of the present invention is provided.
  • the device is configured in a second negotiation device that performs protocol stack type negotiation with the first negotiation device, and includes:
  • a key sharing unit 2101 configured to share a symmetric key with the first negotiation device
  • the negotiation request message receiving unit 2102 is configured to receive a negotiation request message sent by the first negotiation device, where the negotiation request message carries a protocol stack type supported by the first negotiation device;
  • the decryption unit 2103 is configured to: after the second negotiation device receives the message ciphertext sent by the first negotiation device while sending the message, pair the message ciphertext according to the symmetric key shared by the key sharing unit 2101 Decrypting, obtaining a message plaintext, wherein the message ciphertext is that the first negotiation device encrypts a message sent to the first negotiation device according to the symmetric key and the obtained random number, and the obtained message is obtained.
  • the ciphertext comparison unit 2104 is configured to compare the message plaintext obtained by the decryption unit 2103 with the received message, and continue to perform protocol stack type negotiation when the comparison result is the same;
  • the protocol stack type obtaining unit 2105 is configured to select, according to the protocol stack type supported by the first negotiation device that is carried in the negotiation request message received by the negotiation request message receiving unit 2102, the second negotiation device and the first a protocol stack type that is commonly supported by the negotiation device;
  • the encryption unit 2106 is configured to send, by the second negotiation device, the symmetric key shared by the key sharing unit 2101 and the obtained random number pair to the first negotiation device before sending the message to the first negotiation device.
  • the message is encrypted to obtain a message ciphertext;
  • the first negotiation response message sending unit 2107 is configured to feed back the first negotiation response message to the first negotiation device, so that the first negotiation device obtains the second negotiation device according to the first negotiation response message.
  • the ciphertext sending unit 2108 is configured to send the message ciphertext obtained by the encryption unit 2106 at the same time when the message is sent, so that the first negotiation device decrypts the received message ciphertext to obtain a message plaintext.
  • the plaintext of the message is compared with the received message, and when the comparison result is the same, the protocol stack type negotiation is continued.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

A protocol stack type negotiation method and device. The method includes: sending a negotiation request message from the first negotiation device to the second negotiation device, wherein, the negotiation request message carries the protocol stack type supported by the first negotiation device, so the second negotiation device can select the protocol stack type supported by both the second negotiation device and the first negotiation device according to the protocol stack type as carried in the negotiation request message and supported by the first negotiation device; receiving the first negotiation response message responded for the negotiation request message from the second negotiation device; obtaining the protocol stack type supported by both the second and the second negotiation device according to the first negotiation response message. In the embodiments of the invention, the key management center KMC and client devices can select the same protocol stack type to setup the Key Management Interoperability Protocol KMIP sessions, and that the client devices and KMC select the protocol stack type automatically, without manual configuration and easy to maintain.

Description

协议栈类型协商方法及装置  Protocol stack type negotiation method and device
技术领域 本发明涉及通信技术领域, 尤其涉及协议栈类型协商方法及装置。 背景技术 The present invention relates to the field of communications technologies, and in particular, to a protocol stack type negotiation method and apparatus. Background technique
云计算是一种商业计算模型,它将计算任务分布在大量客户端设备构成的资源池 上, 使各种应用系统能够根据需要从各客户端设备上获取计算力、存储空间和信息服 务。 在云计算的应用中, 常常会涉及到数据的传输, 当客户端设备和密钥管理中心 (KMC, Key Manage Center) 作为数据传输的双方时, 可以基于密钥管理互操作协 议 (KMIP, Key Management Internet Protocol) 会话来进行数据传输过程, KMIP协 议由协议栈承载,协议栈是指网络中文件传输过程中各层协议的总和,根据 KMIP协 议相关规范, 承载 KMIP协议的协议栈类型可能有多种。  Cloud computing is a business computing model that distributes computing tasks across resource pools of a large number of client devices, enabling applications to obtain computing power, storage space, and information services from client devices as needed. In cloud computing applications, data transmission is often involved. When the client device and Key Management Center (KMC, Key Manage Center) are used as data transmission partners, they can be based on Key Management Interoperability Protocol (KMIP, Key). Management Internet Protocol) The data transmission process is carried out by the session. The KMIP protocol is carried by the protocol stack. The protocol stack refers to the sum of the layers of the protocol in the file transmission process in the network. According to the relevant specifications of the KMIP protocol, there may be many types of protocol stacks carrying the KMIP protocol. Kind.
现有技术中, 客户端设备与 KMC可以分别支持 KMIP协议的一种或多种协议栈 类型,由于客户端设备支持的协议栈类型可能与 KMC支持的协议栈类型不完全相同, 从而当客户端设备与 KMC进行 KMIP会话时, 当客户端设备发送 KMIP消息所采用 的协议栈类型与 KMC解析该 KMIP消息采用的协议栈类型不同时, 将导致 KMC解 析 KMIP消息失败。因此,现有技术中采用手动配置方式,分别在客户端设备和 KMC 上配置相同的协议栈类型, 以便使客户端设备与 KMC进行 KMIP会话时所采用的协 议栈类型相一致。  In the prior art, the client device and the KMC can respectively support one or more protocol stack types of the KMIP protocol, because the protocol stack type supported by the client device may not be exactly the same as the protocol stack type supported by the KMC, so that the client When the device performs a KMIP session with the KMC, the KMC parsing the KMIP message fails when the protocol stack type used by the client device to send the KMIP message is different from the protocol stack type used by the KMC to parse the KMIP message. Therefore, in the prior art, the manual configuration mode is adopted, and the same protocol stack type is configured on the client device and the KMC respectively, so that the type of the protocol stack used by the client device and the KMC for the KMIP session is consistent.
发明人在对现有技术的研究过程中发现, 由于云计算中客户端设备数量较大, 而 且随时可能动态增减, 每增减一个客户端设备, 都需要对客户端设备和 KMC两侧配 置的协议栈类型进行手动调整, 因此操作繁琐且难以维护。 发明内容  In the process of researching the prior art, the inventor found that, due to the large number of client devices in the cloud computing, and the possibility of dynamic increase or decrease at any time, each client device needs to be configured on both sides of the KMC. The protocol stack type is manually adjusted, so the operation is cumbersome and difficult to maintain. Summary of the invention
本发明实施例提供了协议栈类型协商方法及装置,以解决现有技术中采用手动配 置协议栈类型时, 操作繁琐且难以维护的问题。  The embodiment of the present invention provides a protocol stack type negotiation method and device, which solves the problem that the operation is cumbersome and difficult to maintain when manually configuring the protocol stack type in the prior art.
为解决上述问题, 本发明实施例提供的技术方案如下:  To solve the above problem, the technical solution provided by the embodiment of the present invention is as follows:
一种协议栈类型协商方法, 该方法包括: 第一协商设备向第二协商设备发送协商 请求消息,所述协商请求消息中携带有所述第一协商设备支持的协议栈类型, 以使所 述第二协商设备根据所述协商请求消息中携带的所述第一协商设备支持的协议栈类 型,选取所述第二协商设备与所述第一协商设备共同支持的协议栈类型; 接收所述第 二协商设备根据所述协商请求消息反馈的第一协商响应消息;根据所述第一协商响应 消息, 获得所述第二协商设备与所述第一协商设备共同支持的协议栈类型。 A protocol stack type negotiation method, the method includes: the first negotiation device sends a negotiation request message to the second negotiation device, where the negotiation request message carries the protocol stack type supported by the first negotiation device, so that The second negotiation device selects a protocol stack type supported by the second negotiation device and the first negotiation device according to the protocol stack type supported by the first negotiation device that is carried in the negotiation request message; The first negotiation response message fed back by the second negotiation device according to the negotiation request message; and the protocol stack type supported by the second negotiation device and the first negotiation device is obtained according to the first negotiation response message.
一种协议栈类型协商装置,所述装置设置于与第二协商设备进行协议栈类型协商 的第一协商设备中, 包括: 协商请求消息发送单元, 用于向第二协商设备发送协商请 求消息,所述协商请求消息中携带有所述第一协商设备支持的协议栈类型, 以使所述 第二协商设备根据所述协商请求消息中携带的所述第一协商设备支持的协议栈类型, 选取所述第二协商设备与所述第一协商设备共同支持的协议栈类型;第一协商响应消 息接收单元,用于接收所述第二协商设备根据所述协商请求消息发送单元发送的协商 请求消息反馈的第一协商响应消息; 协议栈类型获得单元,用于根据所述第一协商响 应消息接收单元接收的第一协商响应消息,获得所述第二协商设备与所述第一协商设 备共同支持的协议栈类型。  A protocol stack type negotiation device, the device is disposed in a first negotiation device that performs a protocol stack type negotiation with a second negotiation device, and includes: a negotiation request message sending unit, configured to send a negotiation request message to the second negotiation device, The negotiation request message carries the protocol stack type supported by the first negotiation device, so that the second negotiation device selects the protocol stack type supported by the first negotiation device that is carried in the negotiation request message. a protocol stack type supported by the second negotiation device and the first negotiation device; the first negotiation response message receiving unit is configured to receive the negotiation request message sent by the second negotiation device according to the negotiation request message sending unit a first negotiation response message that is fed back; a protocol stack type obtaining unit, configured to obtain, according to the first negotiation response message received by the first negotiation response message receiving unit, that the second negotiation device and the first negotiation device support Protocol stack type.
一种协议栈类型协商方法, 该方法包括: 第二协商设备接收第一协商设备发送的 协商请求消息,所述协商请求消息中携带有所述第一协商设备支持的协议栈类型; 根 据所述协商请求消息中携带的所述第一协商设备支持的协议栈类型,选取所述第二协 商设备与所述第一协商设备共同支持的协议栈类型;根据所述协商请求消息向所述第 一协商设备反馈第一协商响应消息,以使所述第一协商设备根据所述第一协商响应消 息, 获得所述第二协商设备与所述第一协商设备共同支持的协议栈类型。  A protocol stack type negotiation method, the method includes: the second negotiation device receives a negotiation request message sent by the first negotiation device, where the negotiation request message carries a protocol stack type supported by the first negotiation device; Determining, by the negotiation request message, the protocol stack type supported by the first negotiation device, selecting a protocol stack type supported by the second negotiation device and the first negotiation device; and performing the message according to the negotiation request message to the first The negotiation device feeds back the first negotiation response message, so that the first negotiation device obtains the protocol stack type supported by the second negotiation device and the first negotiation device according to the first negotiation response message.
一种协议栈类型协商装置,所述装置设置于与第一协商设备进行协议栈类型协商 的第二协商设备中, 包括: 协商请求消息接收单元, 用于接收第一协商设备发送的协 商请求消息,所述协商请求消息中携带有所述第一协商设备支持的协议栈类型; 协议 栈类型获得单元,用于根据所述协商请求消息接收单元所接收的协商请求消息中携带 的所述第一协商设备支持的协议栈类型,选取所述第二协商设备与所述第一协商设备 共同支持的协议栈类型; 第一协商响应消息发送单元,用于根据所述协商请求消息接 收单元接收的协商请求消息向所述第一协商设备反馈第一协商响应消息,以使所述第 一协商设备根据所述第一协商响应消息,获得所述第二协商设备与所述第一协商设备 共同支持的协议栈类型。  A protocol stack type negotiation device, the device is disposed in a second negotiation device that performs a protocol stack type negotiation with the first negotiation device, and includes: a negotiation request message receiving unit, configured to receive a negotiation request message sent by the first negotiation device The negotiation request message carries the protocol stack type supported by the first negotiation device, and the protocol stack type obtaining unit is configured to perform, according to the first request carried in the negotiation request message received by the negotiation request message receiving unit Negotiating the protocol stack type supported by the device, and selecting a protocol stack type supported by the second negotiation device and the first negotiation device; the first negotiation response message sending unit is configured to perform the negotiation according to the negotiation request message receiving unit. Sending, by the requesting message, the first negotiation response message to the first negotiation device, so that the first negotiation device obtains the second negotiation device and the first negotiation device jointly supported by the first negotiation device according to the first negotiation response message. Protocol stack type.
采用本发明实施例所提供的协议栈类型协商方法, 客户端设备在与 KMC 进行 KMIP会话之前, 不是随意选择协议栈类型来进行 KMIP会话, 而是一方作为第一协 商设备, 另一方作为第二协商设备,先通过第一协商设备向第二协商设备发送携带有 第一协商设备支持的协议栈类型的协商请求消息,然后接收第二协商设备反馈的第一 协商响应消息,根据第一协商响应消息, 获得第二协商设备与第一协商设备共同支持 的协议栈类型, 即获得 KMC与客户端设备共同支持的协议栈类型。 由上可见, 本发 明实施例中,第一协商设备与第二协商设备协商好的协议栈类型为第二协商设备与第 一协商设备共同支持的协议栈类型, 因此, 后续当 KMC与客户端设备进行 KMIP会 话时, 双方所采用的协议栈类型是 KMC与客户端设备共同支持的协议栈类型, 因此 KMC与客户端设备均能够对接收到的 KMIP消息进行正确解析; 并且, 由于客户端 设备和 KMC之间通过自动协商,选择协议栈类型, 因此不需要手动配置,便于维护。 附图说明 With the protocol stack type negotiation method provided by the embodiment of the present invention, the client device does not randomly select the protocol stack type to perform the KMIP session before the KMIP session with the KMC, but one party serves as the first negotiation device, and the other party acts as the second. The device is negotiated and sent to the second negotiation device by using the first negotiation device. And the first negotiation response message fed back by the second negotiation device is received by the first negotiation device, and the protocol stack supported by the second negotiation device and the first negotiation device is obtained according to the first negotiation response message. Type, which is the type of protocol stack that is supported by the KMC and the client device. It can be seen that, in the embodiment of the present invention, the protocol stack type negotiated by the first negotiation device and the second negotiation device is a protocol stack type supported by the second negotiation device and the first negotiation device, and therefore, the KMC and the client are subsequently When the device performs a KMIP session, the protocol stack type used by the two parties is the protocol stack type supported by the KMC and the client device. Therefore, both the KMC and the client device can correctly parse the received KMIP message; and, because the client device The protocol stack type is selected through auto-negotiation with the KMC, so manual configuration is not required and maintenance is convenient. DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现 有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅 是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前 提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings to be used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any inventive labor.
图 1是本发明实施例中进行协议栈类型协商的系统架构示意图;  1 is a schematic diagram of a system architecture for performing protocol stack type negotiation in an embodiment of the present invention;
图 2是本发明一个实施例中的协议栈类型协商方法流程示意图;  2 is a schematic flowchart of a protocol stack type negotiation method in an embodiment of the present invention;
图 3是本发明另一个实施例中的协议栈类型协商方法流程示意图;  3 is a schematic flowchart of a protocol stack type negotiation method in another embodiment of the present invention;
图 4是本发明另一个实施例中的协议栈类型协商方法流程示意图;  4 is a schematic flowchart of a protocol stack type negotiation method in another embodiment of the present invention;
图 5是本发明另一个实施例中的协议栈类型协商方法流程示意图;  FIG. 5 is a schematic flowchart of a protocol stack type negotiation method according to another embodiment of the present invention; FIG.
图 6是本发明另一个实施例中的协议栈类型协商方法流程示意图;  6 is a schematic flowchart of a protocol stack type negotiation method in another embodiment of the present invention;
图 7是本发明另一个实施例中的协议栈类型协商方法流程示意图;  7 is a schematic flowchart of a protocol stack type negotiation method in another embodiment of the present invention;
图 8是本发明另一个实施例中的协议栈类型协商方法流程示意图;  8 is a schematic flowchart of a protocol stack type negotiation method in another embodiment of the present invention;
图 9是本发明另一个实施例中的协议栈类型协商方法流程示意图;  9 is a schematic flowchart of a protocol stack type negotiation method according to another embodiment of the present invention;
图 10是本发明另一个实施例中的协议栈类型协商方法流程示意图;  FIG. 10 is a schematic flowchart of a protocol stack type negotiation method according to another embodiment of the present invention; FIG.
图 11是本发明另一个实施例中的协议栈类型协商方法流程示意图;  11 is a schematic flowchart of a protocol stack type negotiation method according to another embodiment of the present invention;
图 12是本发明一个实施例中的协议栈类型协商装置结构示意图;  FIG. 12 is a schematic structural diagram of a protocol stack type negotiation apparatus according to an embodiment of the present invention; FIG.
图 13是本发明另一个实施例中的协议栈类型协商装置结构示意图  13 is a schematic structural diagram of a protocol stack type negotiation apparatus in another embodiment of the present invention;
图 14是本发明另一个实施例中的协议栈类型协商装置结构示意图  FIG. 14 is a schematic structural diagram of a protocol stack type negotiation apparatus according to another embodiment of the present invention;
图 15是本发明另一个实施例中的协议栈类型协商装置结构示意图  15 is a schematic structural diagram of a protocol stack type negotiation apparatus in another embodiment of the present invention;
图 16是本发明另一个实施例中的协议栈类型协商装置结构示意图  16 is a schematic structural diagram of a protocol stack type negotiation apparatus in another embodiment of the present invention;
图 17是本发明另一个实施例中的协议栈类型协商装置结构示意图 图 18是本发明另一个实施例中的协议栈类型协商装置结构示意图 图 19是本发明另一个实施例中的协议栈类型协商装置结构示意图 17 is a schematic structural diagram of a protocol stack type negotiation apparatus in another embodiment of the present invention; 18 is a schematic structural diagram of a protocol stack type negotiation apparatus according to another embodiment of the present invention. FIG. 19 is a schematic structural diagram of a protocol stack type negotiation apparatus according to another embodiment of the present invention.
图 20是本发明另一个实施例中的协议栈类型协商装置结构示意图  20 is a schematic structural diagram of a protocol stack type negotiation apparatus in another embodiment of the present invention;
图 21是本发明另一个实施例中的协议栈类型协商装置结构示意图。 具体实施方式 为了使本发明的目的、技术方案和优点更加清楚, 下面将结合附图对本发明作进 一步地详细描述, 显然, 所描述的实施例仅仅是本发明一部份实施例, 而不是全部的 实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下 所获得的所有其它实施例, 都属于本发明保护的范围。  FIG. 21 is a schematic structural diagram of a protocol stack type negotiation apparatus according to another embodiment of the present invention. The present invention will be further described in detail with reference to the accompanying drawings, in which FIG. An embodiment. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
如图 1所示, 为本发明实施例中进行协议栈类型协商的系统架构示意图, 该系统 包括多个客户端设备和一个 KMC, 其中, 每个客户端设备在与 KMC进行 KMIP会 话之前,都要先与 KMC进行协议栈类型协商,然后采用协商好的协议栈类型与 KMC 进行 KMIP会话, 本发明实施例中, 可以由客户端设备发起协议栈类型协商, 也可以 由 KMC发起协议栈类型协商, 为描述方便, 在进行协议栈类型协商的客户端设备与 KMC中, 定义发起协议栈类型协商的一方为第一协商设备, 另一方为第二协商设备。 如图 2所示, 为本发明协议栈类型协商方法的一个实施例, 该实施例从第一协商 设备侧对协商过程进行描述:  As shown in FIG. 1 , it is a schematic diagram of a system architecture for protocol stack type negotiation in an embodiment of the present invention. The system includes multiple client devices and a KMC, where each client device performs a KMIP session with the KMC. In the embodiment of the present invention, the protocol stack type negotiation may be initiated by the client device, or the protocol stack type negotiation may be initiated by the KMC. The protocol stack type negotiation is performed with the KMC, and then the negotiated protocol stack type is used to perform the KMIP session with the KMC. For the convenience of description, in the client device and the KMC that negotiate the protocol stack type, the party that defines the protocol stack type negotiation is the first negotiation device, and the other party is the second negotiation device. As shown in FIG. 2, it is an embodiment of a protocol stack type negotiation method according to the present invention. The embodiment describes the negotiation process from the first negotiation device side:
步骤 201, 第一协商设备向第二协商设备发送协商请求消息, 协商请求消息中携 带有第一协商设备支持的协议栈类型,以使第二协商设备根据协商请求消息中携带的 第一协商设备支持的协议栈类型,选取第二协商设备与第一协商设备共同支持的协议 栈类型。  Step 201: The first negotiation device sends a negotiation request message to the second negotiation device, where the negotiation request message carries the protocol stack type supported by the first negotiation device, so that the second negotiation device sends the first negotiation device according to the negotiation request message. The supported protocol stack type selects the protocol stack type supported by the second negotiation device and the first negotiation device.
其中, 当第一协商设备为客户端设备时, 第二协商设备为 KMC; 当第一协商设 备为 KMC时, 第二协商设备为客户端设备。  When the first negotiation device is a client device, the second negotiation device is a KMC; when the first negotiation device is a KMC, the second negotiation device is a client device.
协商请求消息中可以携带有第一协商设备支持的所有协议栈类型,也可以携带有 第一协商设备支持的部分协议栈类型。  The negotiation request message may carry all the protocol stack types supported by the first negotiation device, and may also carry a partial protocol stack type supported by the first negotiation device.
协商请求消息中进一步还可以携带有第一协商设备预先设置的协议栈类型优先 级,以使第二协商设备可以根据协商请求消息中携带的第一协商设备支持的协议栈类 型, 以及第一协商设备预先设置的协议栈类型优先级,选取出第二协商设备与第一协 商设备共同支持的一个协议栈类型。 本发明实施例中,第一协商设备和第二协商设备进行 KMIP会话所采用的协议栈 类型可以有多种, 例如, 表一所示的各协议栈类型。 The negotiation request message may further carry the protocol stack type priority set by the first negotiation device, so that the second negotiation device can use the protocol stack type supported by the first negotiation device carried in the negotiation request message, and the first negotiation. The protocol stack type priority set by the device is selected, and a protocol stack type supported by the second negotiation device and the first negotiation device is selected. In the embodiment of the present invention, the protocol stack type used by the first negotiation device and the second negotiation device to perform the KMIP session may be various, for example, each protocol stack type shown in Table 1.
 Table
Figure imgf000007_0001
由表一可知, 当进行 KMIP 会话所采用的协议栈类型为类型一时, 协议栈包含
Figure imgf000007_0001
As can be seen from Table 1, when the protocol stack type used for the KMIP session is type one, the protocol stack includes
KMIP、 安全传输层 (TLS , Transport Layer Security) 协议和传输控制协议 (TCP , Transmission Control Protocol) 三种协议; 当进行 KMIP会话所采用的协议栈类型为 类型二时,协议栈包含 KMIP、超文本传输协议下加入安全套接层(HTTPS , Hypertext Transfer Protocol over Secure Socket Layer)协议和 TCP三种协议; 当进行 KMIP会话 所采用的协议栈类型为类型三时, 协议栈包含 KMIP、 超文本传输协议 (HTTP, Hypertext Transfer Protocol ) TLS协议和 TCP四种协议; 当进行 KMIP会话所采用的 协议栈类型为类型四时,协议栈包含 KMIP、简单对象访问协议(SOAP , Simple Object Access Protocol ) HTTPS协议和 TCP四种协议; 当进行 KMIP会话所采用的协议栈 类型为类型五时, 协议栈包含 KMIP、 S0AP、 HTTP、 TLS协议和 TCP五种协议; 当进行 KMIP会话所采用的协议栈类型为类型六时, 协议栈包含 KMIP、 TCP和因特 网协议安全性 (IPSec, Internet Protocol Security) 协议三种协议。 KMIP, Transport Layer Security (TLS) protocol and Transmission Control Protocol (TCP); when the protocol stack type used for KMIP sessions is type 2, the protocol stack contains KMIP and hypertext. Under the transport protocol, the Hypertext Transfer Protocol over Secure Socket Layer (HTTPS) protocol and the TCP protocol are added. When the protocol stack type used for the KMIP session is type 3, the protocol stack includes the KMIP and the hypertext transfer protocol. HTTP, Hypertext Transfer Protocol) TLS protocol and TCP four protocols; when the protocol stack type used for KMIP session is type four, the protocol stack includes KMIP, Simple Object Access Protocol (SOAP), HTTPS protocol and TCP. Four protocols; when the protocol stack type used for the KMIP session is type five, the protocol stack includes five protocols: KMIP, S0AP, HTTP, TLS, and TCP; when the protocol stack type used for the KMIP session is type six , the protocol stack contains KMIP, TCP and Internet Protocol Security (IPSec, Internet Protocol Security) protocol three protocols.
步骤 202, 第一协商设备接收第二协商设备根据协商请求消息反馈的第一协商响 应消息。  Step 202: The first negotiation device receives a first negotiation response message that is sent by the second negotiation device according to the negotiation request message.
其中, 第一协商响应消息中携带有第二协商设备支持的协议栈类型, 第一协商响 应消息中携带的协议栈类型可以包括:第二协商设备根据接收到的协商请求消息中携 带的第一协商设备支持的协议栈类型,确定的第二协商设备与第一协商设备共同支持 的至少一个协议栈类型; 或者, 第二协商设备支持的协议栈类型。  The first negotiation response message carries the protocol stack type supported by the second negotiation device, and the protocol stack type carried in the first negotiation response message may include: the first negotiation device carries the first message according to the received negotiation request message. Negotiating the protocol stack type supported by the device, determining the at least one protocol stack type supported by the second negotiation device and the first negotiation device; or the protocol stack type supported by the second negotiation device.
本发明实施例中,当第二协商设备与第一协商设备共同支持的协议栈类型至少为 两个协议栈类型时,第一协商响应消息中具体可以携带有第二协商设备从第二协商设 备与第一协商设备共同支持的协议栈类型中选取出的一个协议栈类型。 当第一协商设备发送的协商请求消息中携带第一协商设备预先设置的协议栈类 型优先级时,第一协商响应消息可以携带第二协商设备选取的双方共同支持的一个协 议栈类型,其中,双方共同支持的一个协议栈类型为第二协商设备根据协商请求消息 中携带的第一协商设备支持的协议栈类型和第一协商设备预先设置的协议栈类型优 先级, 选取的一个第二协商设备与第一协商设备共同支持的协议栈类型。 In the embodiment of the present invention, when the protocol stack type supported by the second negotiation device and the first negotiation device is at least two protocol stack types, the first negotiation response message may carry the second negotiation device from the second negotiation device. A protocol stack type selected from the types of protocol stacks supported by the first negotiation device. When the negotiation request message sent by the first negotiation device carries the protocol stack type priority set by the first negotiation device, the first negotiation response message may carry a protocol stack type supported by the two parties selected by the second negotiation device, where A protocol stack type supported by the two parties is a second negotiation device selected by the second negotiation device according to the protocol stack type supported by the first negotiation device and the protocol stack type priority set by the first negotiation device. The type of protocol stack that is supported by the first negotiation device.
本发明实施例中,第一协商响应消息中可以携带有第二协商设备支持的协议栈类 型,进一步还可以携带有第二协商设备预先设置的协议栈类型优先级, 以使第一协商 设备可以根据第一协商响应消息中携带的第二协商设备支持的协议栈类型优先级,从 第一协商响应消息中携带的第二协商设备确定的双方共同支持的至少一个协议栈类 型, 选择一个第二协商设备与第一协商设备共同支持的协议栈类型。  In the embodiment of the present invention, the first negotiation response message may carry the protocol stack type supported by the second negotiation device, and further may carry the protocol stack type priority preset by the second negotiation device, so that the first negotiation device can Selecting a second type according to the protocol stack type priority supported by the second negotiation device carried in the first negotiation response message, from the at least one protocol stack type supported by the second negotiation device that is carried by the second negotiation device The type of protocol stack supported by the negotiation device and the first negotiation device.
此外, 预先设置协议栈类型优先级的主体可以是进行协议栈类型协商的双方, 也 可以只是其中任意一方, 具体可以包含下述三种情况: 第一协商设备预先设置了协议 栈类型优先级; 第二协商设备预先设置了协议栈类型优先级; 第一协商设备和第二协 商设备都预先设置了协议栈类型优先级。  In addition, the entity that pre-sets the priority of the protocol stack type may be the two sides of the protocol stack type negotiation, or may be only one of the following, and may specifically include the following three situations: The first negotiation device presets the protocol stack type priority; The second negotiation device presets the protocol stack type priority; the first negotiation device and the second negotiation device both preset the protocol stack type priority.
针对第一协商设备和第二协商设备都预先设置了协议栈类型优先级的情况,为了 双方能够根据相同的协议栈类型优先级选择协议栈类型,可以采取第一协商设备和第 二协商设备都预先设置相同的协议栈类型优先级的方式, 或者, 当第一协商设备预先 设置的协议栈类型优先级与第二协商设备预先设置的协议栈类型优先级不同时,预先 约定采用第一协商设备预先设置的协议栈类型优先级,或者预先约定采用第二协商设 备预先设置的协议栈类型优先级。  For the first negotiation device and the second negotiation device, the protocol stack type priority is set in advance. In order to enable the two parties to select the protocol stack type according to the same protocol stack type priority, both the first negotiation device and the second negotiation device may be adopted. The first negotiation device is pre-agreed when the priority of the same protocol stack type is set in advance, or when the priority of the protocol stack type set by the first negotiation device is different from the priority of the protocol stack type preset by the second negotiation device. Pre-set protocol stack type priority, or pre-agreed the protocol stack type priority preset by the second negotiation device.
步骤 203, 根据第一协商响应消息, 获得第二协商设备与第一协商设备共同支持 的协议栈类型。  Step 203: Obtain a protocol stack type supported by the second negotiation device and the first negotiation device according to the first negotiation response message.
若第一协商响应消息中携带有第二协商设备确定的双方共同支持的至少一个协 议栈类型,则第一协商设备可以从第一协商响应消息中所携带的至少一个协议栈类型 中, 选择一个第二协商设备与第一协商设备共同支持的协议栈类型。  If the first negotiation response message carries at least one protocol stack type supported by the two parties determined by the second negotiation device, the first negotiation device may select one of the at least one protocol stack type carried in the first negotiation response message. The protocol stack type supported by the second negotiation device and the first negotiation device.
若第一协商响应消息中携带有第二协商设备支持的协议栈类型,则第一协商设备 可以根据接收到的第一协商响应消息中携带的第二协商设备支持的协议栈类型,选取 第二协商设备与第一协商设备共同支持的协议栈类型。  If the first negotiation response message carries the protocol stack type supported by the second negotiation device, the first negotiation device may select the second protocol stack type supported by the second negotiation device that is carried in the received first negotiation response message, and select the second The type of protocol stack supported by the negotiation device and the first negotiation device.
第二协商设备与第一协商设备共同支持的协议栈类型可以只有一个,也可以有多 个, 由于第二协商设备与第一协商设备共同支持的协议栈类型可能有多个,本发明实 施例中还可以包含下述处理流程:当第二协商设备与第一协商设备共同支持的协议栈 类型大于一个时,第一协商设备先从第二协商设备与第一协商设备共同支持的协议栈 类型中, 选取一个协议栈类型, 然后向第二协商设备发送第二协商响应消息, 第二协 商响应消息中携带有第一协商设备最终选取的双方共同支持的一个协议栈类型。 The protocol stack type supported by the second negotiation device and the first negotiation device may be one or more. The number of protocol stacks supported by the second negotiation device and the first negotiation device may be multiple. The processing flow may also be included in the following: a protocol stack supported by the second negotiation device and the first negotiation device When the type is greater than one, the first negotiation device first selects a protocol stack type from the protocol stack type supported by the second negotiation device and the first negotiation device, and then sends a second negotiation response message to the second negotiation device, and the second negotiation is performed. The response message carries a protocol stack type supported by both parties finally selected by the first negotiation device.
其中, 可以采用如下任意一种选取方式, 从第二协商设备与第一协商设备共同支 持的协议栈类型中,选取一个协议栈类型: 从第二协商设备与第一协商设备共同支持 的至少一个协议栈类型中, 随机选取一个协议栈类型; 从第二协商设备与第一协商设 备共同支持的至少一个协议栈类型中,根据第一协商设备预先设置的协议栈类型优先 级选取一个协议栈类型;从第二协商设备与第一协商设备共同支持的至少一个协议栈 类型中,根据第一协商响应消息中携带的第二协商设备预先设置的协议栈类型优先级 选取一个协议栈类型。  The protocol stack type is selected from the protocol stack type supported by the second negotiation device and the first negotiation device: at least one supported by the second negotiation device and the first negotiation device. In the protocol stack type, a protocol stack type is randomly selected. From at least one protocol stack type supported by the second negotiation device and the first negotiation device, a protocol stack type is selected according to a protocol stack type priority preset by the first negotiation device. The at least one protocol stack type supported by the second negotiation device and the first negotiation device is selected according to a protocol stack type priority preset by the second negotiation device carried in the first negotiation response message.
本发明实施例中, 为了防止中间人攻击,可以对整个协议栈协商过程进行加密处 理, 例如, 采用公私钥机制加解密 (即非对称密钥加解密), 或是采用对称密钥加解 密, 当然也可以采用其他加解密处理方法, 对此本发明实施例不进行限制。  In the embodiment of the present invention, in order to prevent man-in-the-middle attacks, the entire protocol stack negotiation process may be encrypted, for example, using public-private key mechanism encryption and decryption (ie, asymmetric key encryption and decryption), or using symmetric key encryption and decryption, of course. Other encryption and decryption processing methods may also be used, which are not limited in this embodiment of the present invention.
当采用公私钥机制加解密时,可以在第一协商设备向第二协商设备发送协商请求 消息之前, 与第二协商设备之间交互密钥信息, 以使第一协商设备与第二协商设备根 据上述密钥信息采用公私钥加解密机制进行协议栈类型协商,具体可以包含下述两种 情况:  When the first negotiation device sends the negotiation request message to the second negotiation device, the key information is exchanged with the second negotiation device, so that the first negotiation device and the second negotiation device are configured according to the public information. The above-mentioned key information uses the public-private key encryption and decryption mechanism to negotiate the protocol stack type, which may include the following two situations:
由第一协商设备预先设置第一协商设备私钥和第一协商设备公钥,并且存储第一 协商设备私钥, 以及将第一协商设备公钥发送给第二协商设备,第一协商设备私钥用 于对发送给第二协商设备的消息(例如, 协商请求消息和第二协商响应消息)进行加 密, 以及对从第二协商设备接收到的消息(例如, 根据第一协商设备公钥加密后的第 一协商响应消息)进行解密, 而第一协商设备公钥用于第二协商设备对从第一协商设 备接收到的消息(例如,根据第一协商设备私钥加密后的协商请求消息和第二协商响 应消息) 进行解密, 以及对发送给第一协商设备的消息 (例如, 第一协商响应消息) 进行加密;  Determining, by the first negotiation device, the first negotiation device private key and the first negotiation device public key, and storing the first negotiation device private key, and sending the first negotiation device public key to the second negotiation device, where the first negotiation device is private The key is used to encrypt the message sent to the second negotiation device (for example, the negotiation request message and the second negotiation response message), and the message received from the second negotiation device (for example, according to the first negotiation device public key encryption) The first first negotiation response message is decrypted, and the first negotiation device public key is used by the second negotiation device for the message received from the first negotiation device (for example, the negotiation request message encrypted according to the first negotiation device private key) Decrypting with the second negotiation response message, and encrypting the message (for example, the first negotiation response message) sent to the first negotiation device;
还可以, 由第二协商设备预先设置第二协商设备私钥和第二协商设备公钥,在第 一协商设备向第二协商设备发送协商请求消息之前,获得第二协商设备预先设置的第 二协商设备公钥, 利用第二协商设备公钥对发送给第二协商设备的消息(例如, 协商 请求消息和第二协商响应消息)进行加密, 以及利用第二协商设备公钥对从第二协商 设备接收到的消息(例如, 根据第二协商设备私钥加密后的第一协商响应消息)进行 解密,相应的,第二协商设备利用第二协商设备私钥对发送给第一协商设备的消息 (例 如, 第一协商响应消息)进行加密, 以及利用第二协商设备私钥对从第一协商设备接 收到的消息(例如,根据第二协商设备公钥加密后的协商请求消息和第二协商响应消 息) 进行解密。 The second negotiation device private key and the second negotiation device public key are preset by the second negotiation device, and the second negotiation device obtains the second preset before the first negotiation device sends the negotiation request message to the second negotiation device. Negotiating the device public key, encrypting the message sent to the second negotiation device (for example, the negotiation request message and the second negotiation response message) by using the second negotiation device public key, and using the second negotiation device public key pair to negotiate from the second The message received by the device (for example, the first negotiation response message encrypted according to the second negotiation device private key) is decrypted. Correspondingly, the second negotiation device uses the second negotiation device private key pair to send the message to the first negotiation device. (example For example, the first negotiation response message is encrypted, and the message received from the first negotiation device is obtained by using the second negotiation device private key (for example, the negotiation request message and the second negotiation response encrypted according to the second negotiation device public key) Message) Decrypt.
当采用对称密钥加解密时,在第一协商设备向第二协商设备发送协商请求消息之 前, 与第二协商设备共享对称密钥。一方面, 第一协商设备在向第二协商设备发送消 息之前,根据对称密钥和获得的随机数对发送给第二协商设备的消息进行加密,得到 消息密文, 以及在发送消息时同时发送消息密文, 以使第二协商设备对接收到的消息 密文进行解密得到消息明文,将消息明文与接收到的消息进行比较, 当比较结果相同 时, 继续进行协议栈类型协商; 另一方面, 第一协商设备接收到第二协商设备在发送 消息的同时发送的消息密文后, 根据对称密钥对消息密文进行解密, 得到消息明文, 将消息明文与接收到的消息进行比较,当比较结果相同时,继续进行协议栈类型协商, 其中,消息密文为第二协商设备根据对称密钥和获得的随机数对发送给第一协商设备 的消息进行加密, 所得到的消息密文。  When symmetric key encryption and decryption is employed, the symmetric key is shared with the second negotiation device before the first negotiation device sends the negotiation request message to the second negotiation device. On one hand, before the first negotiation device sends the message to the second negotiation device, the first negotiation device encrypts the message sent to the second negotiation device according to the symmetric key and the obtained random number, obtains the message ciphertext, and simultaneously sends the message when the message is sent. The message ciphertext is used to enable the second negotiation device to decrypt the received message ciphertext to obtain the message plaintext, compare the message plaintext with the received message, and continue the protocol stack type negotiation when the comparison result is the same; After receiving the message ciphertext sent by the second negotiation device at the same time as the message is sent, the first negotiation device decrypts the message ciphertext according to the symmetric key, obtains the message plaintext, and compares the message plaintext with the received message. When the comparison result is the same, the protocol stack type negotiation is continued. The message ciphertext is a message ciphertext obtained by the second negotiation device encrypting the message sent to the first negotiation device according to the symmetric key and the obtained random number.
由上述处理过程可知, 本发明实施例中, 第一协商设备与第二协商设备协商好的 协议栈类型为双方共同支持的协议栈类型, 因此, 后续当 KMC 与客户端设备进行 KMIP会话时, 双方所采用的协议栈类型是 KMC与客户端设备共同支持的协议栈类 型, 因此 KMC与客户端设备均能够对接收到的 KMIP消息进行正确解析; 并且, 由 于客户端设备和 KMC之间通过自动协商, 选择协议栈类型, 因此不需要手动配置, 便于维护。 如图 3所示, 为本发明协议栈类型协商方法的另一个实施例, 该实施例从第二协 商设备侧对协商过程进行描述:  According to the foregoing process, in the embodiment of the present invention, the protocol stack type negotiated by the first negotiation device and the second negotiation device is a protocol stack type supported by the two parties. Therefore, when the KMC and the client device perform a KMIP session, The protocol stack type adopted by the two parties is the protocol stack type supported by the KMC and the client device. Therefore, both the KMC and the client device can correctly parse the received KMIP message; and, because the client device and the KMC pass the automatic Negotiation, select the protocol stack type, so no manual configuration is required, which is easy to maintain. As shown in FIG. 3, it is another embodiment of the protocol stack type negotiation method of the present invention. The embodiment describes the negotiation process from the second negotiation device side:
步骤 301, 第二协商设备接收第一协商设备发送的协商请求消息, 协商请求消息 中携带有第一协商设备支持的协议栈类型。  Step 301: The second negotiation device receives the negotiation request message sent by the first negotiation device, where the negotiation request message carries the protocol stack type supported by the first negotiation device.
其中,协商请求消息中可以携带有第一协商设备支持的所有协议栈类型, 也可以 携带有第一协商设备支持的部分协议栈类型;协商请求消息中进一步还可以携带有第 一协商设备预先设置的协议栈类型优先级。  The negotiation request message may carry all the protocol stack types supported by the first negotiation device, and may also carry a partial protocol stack type supported by the first negotiation device. The negotiation request message may further carry the first negotiation device preset. Protocol stack type priority.
当第二协商设备为 KMC时, 第一协商设备为客户端设备; 当第二协商设备为客 户端设备时, 第一协商设备为 KMC。  When the second negotiation device is a KMC, the first negotiation device is a client device; when the second negotiation device is a client device, the first negotiation device is a KMC.
步骤 302, 第二协商设备根据协商请求消息中携带的第一协商设备支持的协议栈 类型, 选取第二协商设备与第一协商设备共同支持的协议栈类型。 例如, 协商请求消息中携带的第一协商设备支持的协议栈类型为类型一、类型二 和类型三, 而第二协商设备支持的所有协议栈类型为类型一、类型二和类型五, 则第 二协商设备选取的第二协商设备与第一协商设备共同支持的协议栈类型为类型一和 类型二。 Step 302: The second negotiation device selects a protocol stack type supported by the second negotiation device and the first negotiation device according to the protocol stack type supported by the first negotiation device that is carried in the negotiation request message. For example, the protocol stack type supported by the first negotiation device carried in the negotiation request message is type one, type two, and type three, and all protocol stack types supported by the second negotiation device are type one, type two, and type five. The protocol stack types supported by the second negotiation device and the first negotiation device selected by the second negotiation device are type one and type two.
本发明实施例中,当第二协商设备与第一协商设备共同支持的协议栈类型至少为 两个协议栈类型时,第二协商设备在选取出第二协商设备与第一协商设备共同支持的 协议栈类型后, 还可以确定双方共同支持的至少一个协议栈类型; 或者, 从第二协商 设备与第一协商设备共同支持的协议栈类型中选取一个协议栈类型。  In the embodiment of the present invention, when the protocol stack type supported by the second negotiation device and the first negotiation device is at least two protocol stack types, the second negotiation device selects the second negotiation device and the first negotiation device to support the same. After the protocol stack type, at least one protocol stack type supported by the two parties may be determined; or, one protocol stack type is selected from the protocol stack types supported by the second negotiation device and the first negotiation device.
第二协商设备可以采用如下任意一种方式选取一个协议栈类型:从第二协商设备 与第一协商设备共同支持的协议栈类型中, 随机选取一个协议栈类型; 从第二协商设 备与第一协商设备共同支持的协议栈类型中,根据协商请求消息中携带的第一协商设 备预先设置的协议栈类型优先级选取一个协议栈类型;根据第二协商设备预先设置的 协议栈类型优先级选取一个协议栈类型。  The second negotiation device may select a protocol stack type by using any one of the following methods: a protocol stack type is randomly selected from the protocol stack types supported by the second negotiation device and the first negotiation device; and the second negotiation device and the first The protocol stack type supported by the negotiation device is selected according to the protocol stack type priority set by the first negotiation device carried in the negotiation request message; and the protocol stack type priority set according to the second negotiation device is selected. Protocol stack type.
此外, 当协商请求消息既携带第一协商设备支持的协议栈类型, 还携带第一协商 设备预先设置的协议栈类型优先级时,可以根据协商请求消息中携带的第一协商设备 支持的协议栈类型和第一协商设备预先设置的协议栈类型优先级,选取一个第二协商 设备与第一协商设备共同支持的协议栈类型。  In addition, when the negotiation request message carries both the protocol stack type supported by the first negotiation device and the protocol stack type priority set by the first negotiation device, the protocol stack supported by the first negotiation device carried in the negotiation request message may be used. The type and the priority of the protocol stack type preset by the first negotiation device are selected, and a protocol stack type supported by the second negotiation device and the first negotiation device is selected.
步骤 303, 第二协商设备根据协商请求消息向第一协商设备反馈第一协商响应消 息, 以使第一协商设备根据第一协商响应消息, 获得第二协商设备与第一协商设备共 同支持的协议栈类型。  Step 303: The second negotiation device feeds back the first negotiation response message to the first negotiation device according to the negotiation request message, so that the first negotiation device obtains the protocol supported by the second negotiation device and the first negotiation device according to the first negotiation response message. Stack type.
其中,第一协商响应消息中携带的协议栈类型可以包括: 步骤 302中第二协商设 备选取的第二协商设备与第一协商设备共同支持的协议栈类型,以便第一协商设备可 以在接收到第一协商响应消息后,能够从第一协商响应消息中直接获得第二协商设备 与第一协商设备共同支持的协议栈类型;或者,双方共同支持的至少一个协议栈类型, 以使第一协商设备可以从第一协商响应消息所携带的双方共同支持的至少一个协议 栈类型中, 选择一个第二协商设备与第一协商设备共同支持的协议栈类型; 或者, 第 二协商设备从第二协商设备与第一协商设备共同支持的协议栈类型中选取的双方共 同支持的一个协议栈类型, 以使第一协商设备可以从接收到的第一协商响应消息中, 直接获得第二协商设备与第一协商设备共同支持的一个协议栈类型; 或者,第二协商 设备支持的协议栈类型, 以使第一协商设备可以在接收到第一协商响应消息后, 能够 根据第一协商响应消息中携带的第二协商设备支持的协议栈类型,选取第二协商设备 与第一协商设备共同支持的协议栈类型, 后续在第一协商设备与第二协商设备进行The type of the protocol stack carried in the first negotiation response message may include: a protocol stack type supported by the second negotiation device selected by the second negotiation device and the first negotiation device in step 302, so that the first negotiation device can receive the After the first negotiation response message, the protocol stack type supported by the second negotiation device and the first negotiation device can be directly obtained from the first negotiation response message; or at least one protocol stack type supported by the two parties, so that the first negotiation is performed. The device may select a protocol stack type supported by the second negotiation device and the first negotiation device from the at least one protocol stack type supported by the two parties in the first negotiation response message; or the second negotiation device negotiates from the second negotiation device. A protocol stack type supported by the two parties selected by the device and the protocol stack type supported by the first negotiation device, so that the first negotiation device can directly obtain the second negotiation device and the first negotiation response message from the received first negotiation response message. a protocol stack type supported by a negotiation device; or, a second negotiation setting Protocol stack supported type, so that the first device may negotiate receiving the first negotiation response message, support device capable of responding to a second negotiation message carried in the first negotiation protocol stack type, select the second negotiation device a type of protocol stack supported by the first negotiation device, and subsequently performed by the first negotiation device and the second negotiation device
KMIP会话时, 采用第二协商设备与第一协商设备共同支持的协议栈类型进行 KMIP 会话。 In the KMIP session, the KMIP session is performed by using the protocol stack type supported by the second negotiation device and the first negotiation device.
本发明实施例中,当第一协商响应消息中携带双方共同支持的至少一个协议栈类 型时,第一协商响应消息中进一步还可以携带第二协商设备预先设置的协议栈类型优 先级, 以使第一协商设备根据第二协商设备预先设置的协议栈类型优先级, 从第一协 商响应消息中携带的第二协商设备确定的双方共同支持的至少一个协议栈类型,选择 一个第二协商设备与第一协商设备共同支持的协议栈类型。  In the embodiment of the present invention, when the first negotiation response message carries at least one protocol stack type supported by the two parties, the first negotiation response message may further carry a protocol stack type priority preset by the second negotiation device, so that The first negotiating device selects a second negotiating device from the at least one protocol stack type jointly supported by the second negotiation device that is carried by the second negotiation device that is carried by the second negotiation device according to the protocol stack type priority set by the second negotiation device. The protocol stack type supported by the first negotiation device.
若第一协商响应消息中携带的协议栈类型为第二协商设备支持的协议栈类型,则 可以先执行步骤 302, 再执行步骤 303 ; 也可以先执行步骤 303, 再执行步骤 302; 还 可以同时执行步骤 302和步骤 303, 对此本发明实施例不进行限制。  If the protocol stack type carried in the first negotiation response message is the protocol stack type supported by the second negotiation device, step 302 may be performed first, and then step 303 is performed; or step 303 may be performed first, and then step 302 is performed; Steps 302 and 303 are performed, and the embodiment of the present invention is not limited.
第一协商响应消息中可以携带有第二协商设备支持的协议栈类型,进一步还可以 携带有第二协商设备预先设置的协议栈类型优先级,以使第一协商设备可以根据第一 协商响应消息中携带的第二协商设备支持的协议栈类型,以及第二协商设备预先设置 的协议栈类型优先级, 确定一个第二协商设备与第一协商设备共同支持的协议栈类 型。  The first negotiation response message may carry the protocol stack type supported by the second negotiation device, and further may carry the protocol stack type priority preset by the second negotiation device, so that the first negotiation device can be configured according to the first negotiation response message. The protocol stack type supported by the second negotiation device carried in the second negotiation device and the protocol stack type priority preset by the second negotiation device determine a protocol stack type supported by the second negotiation device and the first negotiation device.
此外, 本发明实施例中, 还可以包含下述可选步骤: 第二协商设备接收第一协商 设备所发送的第二协商响应消息,第二协商响应消息中携带第一协商设备最终选取的 双方共同支持的一个协议栈类型。其中,第一协商设备可以根据接收的第一协商响应 消息,从第二协商设备与第一协商设备共同支持的协议栈类型中选取的一个协议栈类 型,后续在第二协商设备与第一协商设备进行 KMIP会话时,采用上述选取的一个协 议栈类型进行 KMIP会话。  In addition, in the embodiment of the present invention, the following optional steps may be further included: the second negotiation device receives the second negotiation response message sent by the first negotiation device, where the second negotiation response message carries the two parties selected by the first negotiation device. A type of protocol stack that is commonly supported. The first negotiation device may select a protocol stack type selected from the protocol stack types supported by the second negotiation device and the first negotiation device according to the received first negotiation response message, and subsequently negotiate with the first negotiation device. When the device performs a KMIP session, the KMIP session is performed using one of the protocol stack types selected above.
本发明实施例中, 为了防止中间人攻击,可以对整个协议栈协商过程进行加密处 理, 例如, 采用公私钥机制加解密 (即非对称密钥加解密), 或是采用对称密钥加解 密, 当然也可以采用其他加解密处理方法, 对此本发明实施例不进行限制。  In the embodiment of the present invention, in order to prevent man-in-the-middle attacks, the entire protocol stack negotiation process may be encrypted, for example, using public-private key mechanism encryption and decryption (ie, asymmetric key encryption and decryption), or using symmetric key encryption and decryption, of course. Other encryption and decryption processing methods may also be used, which are not limited in this embodiment of the present invention.
当采用公私钥机制加解密时,可以在第二协商设备接收第一协商设备发送的协商 请求消息之前, 与第一协商设备之间交互密钥信息, 以使第一协商设备与第二协商设 备根据密钥信息采用公私钥加解密机制进行协议栈类型协商,具体可以包含下述两种 情况:  When the second negotiation device receives the negotiation request message sent by the first negotiation device, the key information is exchanged with the first negotiation device to enable the first negotiation device and the second negotiation device. The protocol stack type negotiation is performed by using a public-private key encryption and decryption mechanism according to the key information, which may include the following two situations:
由第二协商设备预先设置第二协商设备私钥和第二协商设备公钥,并且存储第二 协商设备私钥, 以及将第二协商设备公钥发送给第一协商设备,第二协商设备私钥用 于对发送给第一协商设备的消息(例如, 第一协商响应消息)进行加密, 以及对从第 一协商设备接收到的消息(例如,根据第二协商设备公钥加密后的协商请求消息和第 二协商响应消息)进行解密, 而第二协商设备公钥用于第一协商设备对从第二协商设 备接收到的消息(例如, 根据第二协商设备私钥加密后的第一协商响应消息)进行解 密, 以及对发送给第二协商设备的消息 (例如, 协商请求消息和第二协商响应消息) 进行加密; The second negotiation device private key and the second negotiation device public key are preset by the second negotiation device, and the second negotiation device private key is stored, and the second negotiation device public key is sent to the first negotiation device, and the second negotiation device is private. Key use Encrypting a message (eg, a first negotiation response message) sent to the first negotiation device, and receiving a message received from the first negotiation device (eg, a negotiation request message encrypted according to the second negotiation device public key) The second negotiation device message is decrypted, and the second negotiation device public key is used by the first negotiation device to receive the message from the second negotiation device (for example, the first negotiation response message encrypted according to the second negotiation device private key) Decrypting, and encrypting messages sent to the second negotiating device (eg, the negotiation request message and the second negotiation response message);
还可以, 由第一协商设备预先设置第一协商设备私钥和第一协商设备公钥,在第 二协商设备接收第一协商设备发送的协商请求消息之前,获得第一协商设备预先设置 的第一协商设备公钥, 利用第一协商设备公钥对发送给第一协商设备的消息 (例如, 第一协商响应消息)进行加密, 以及利用第一协商设备公钥对从第一协商设备接收到 的消息 (例如, 根据第一协商设备私钥加密后的协商请求消息和第二协商响应消息) 进行解密,相应的,第一协商设备利用第一协商设备私钥对发送给第二协商设备的消 息(例如, 协商请求消息和第二协商响应消息)进行加密, 以及利用第一协商设备私 钥对从第二协商设备接收到的消息(例如,根据第一协商设备公钥加密后的第一协商 响应消息) 进行解密。  The first negotiation device private key and the first negotiation device public key are preset by the first negotiation device. Before the second negotiation device receives the negotiation request message sent by the first negotiation device, the first negotiation device obtains the preset Negotiating the device public key, encrypting the message (for example, the first negotiation response message) sent to the first negotiation device by using the first negotiation device public key, and receiving the first negotiation device from the first negotiation device by using the first negotiation device public key pair The message is decrypted according to the first negotiation device private key encrypted negotiation request message and the second negotiation response message, and the first negotiation device uses the first negotiation device private key pair to send to the second negotiation device. The message (eg, the negotiation request message and the second negotiation response message) is encrypted, and the message received from the second negotiation device is obtained using the first negotiation device private key (eg, the first encrypted according to the first negotiation device public key) Negotiate response message) Decrypt.
当采用对称密钥加解密时,在第二协商设备接收第一协商设备发送的协商请求消 息之前, 与第一协商设备共享对称密钥。一方面, 第二协商设备接收到第一协商设备 在发送消息的同时发送的消息密文后,根据对称密钥对消息密文进行解密,得到消息 明文, 将消息明文与接收到的消息进行比较, 当比较结果相同时, 继续进行协议栈类 型协商,其中, 消息密文为第一协商设备根据对称密钥和获得的随机数对发送给第一 协商设备的消息进行加密, 所得到的消息密文; 另一方面, 第二协商设备在向第一协 商设备发送消息之前,根据对称密钥和获得的随机数对发送给第一协商设备的消息进 行加密, 得到消息密文, 以及在发送消息时同时发送消息密文, 以使第一协商设备对 接收到的消息密文进行解密得到消息明文,将消息明文与接收到的消息进行比较, 当 比较结果相同时, 继续进行协议栈类型协商。  When symmetric key encryption and decryption is used, the symmetric key is shared with the first negotiation device before the second negotiation device receives the negotiation request message sent by the first negotiation device. On the one hand, the second negotiation device receives the message ciphertext sent by the first negotiation device at the same time as the message is sent, decrypts the message ciphertext according to the symmetric key, obtains the message plaintext, and compares the message plaintext with the received message. When the comparison result is the same, the protocol stack type negotiation is continued, where the message ciphertext is that the first negotiation device encrypts the message sent to the first negotiation device according to the symmetric key and the obtained random number, and the obtained message is dense. On the other hand, before sending the message to the first negotiation device, the second negotiation device encrypts the message sent to the first negotiation device according to the symmetric key and the obtained random number, obtains the message ciphertext, and sends the message. The message ciphertext is sent at the same time, so that the first negotiation device decrypts the received message ciphertext to obtain the message plaintext, compares the message plaintext with the received message, and when the comparison result is the same, continues the protocol stack type negotiation.
由上述处理过程可知, 本发明实施例中, 第一协商设备与第二协商设备协商好的 协议栈类型为双方共同支持的协议栈类型, 因此, 后续当 KMC 与客户端设备进行 KMIP会话时, 双方所采用的协议栈类型是 KMC与客户端设备共同支持的协议栈类 型, 因此 KMC与客户端设备均能够对接收到的 KMIP消息进行正确解析; 并且, 由 于客户端设备和 KMC之间通过自动协商, 选择协议栈类型, 因此不需要手动配置, 便于维护。 如图 4所示为本发明协议栈类型协商方法的另一个实施例,该实施例中第一协商 设备为客户端设备, 第二协商设备为 KMC, 其中由 KMC单方选择协议栈类型, 再 将选择的协议栈类型发送给该客户端设备, 同时采用由 KMC设置的公私钥对协议栈 类型协商时所传输的信息进行加密和解密处理, 其具体处理流程如下: According to the foregoing process, in the embodiment of the present invention, the protocol stack type negotiated by the first negotiation device and the second negotiation device is a protocol stack type supported by the two parties. Therefore, when the KMC and the client device perform a KMIP session, The protocol stack type adopted by the two parties is the protocol stack type supported by the KMC and the client device. Therefore, both the KMC and the client device can correctly parse the received KMIP message; and, because the client device and the KMC pass the automatic Negotiation, select the protocol stack type, so no manual configuration is required, which is easy to maintain. As shown in FIG. 4, another embodiment of the method for negotiating the protocol stack type of the present invention is as follows: in this embodiment, the first negotiation device is a client device, and the second negotiation device is a KMC, where the KMC unilaterally selects a protocol stack type, and then The selected protocol stack type is sent to the client device, and the information transmitted by the protocol stack type is encrypted and decrypted by using the public and private keys set by the KMC. The specific processing flow is as follows:
步骤 401, 客户端设备使用 KMC公钥对待发送的协商请求消息进行加密。  Step 401: The client device encrypts the negotiation request message to be sent by using the KMC public key.
其中, KMC可以预先设置 KMC公钥和 KMC私钥, 并公布 KMC公钥, 以及保 存 KMC私钥。  The KMC can pre-set the KMC public key and the KMC private key, publish the KMC public key, and save the KMC private key.
本发明实施例中,协商请求消息可以仅携带有该客户端设备自身支持的所有协议 栈类型 (例如, 类型一、 类型二、 类型三), 进一步还可以携带有客户端设备设置的 各协 型对应的优先级, 例如, 各协议栈类型对应的优先级如表二所示。  In the embodiment of the present invention, the negotiation request message may carry only all the protocol stack types supported by the client device (for example, type one, type two, and type three), and may further carry each type of cooperation set by the client device. The corresponding priority, for example, the priority corresponding to each protocol stack type is shown in Table 2.
Figure imgf000014_0001
后续 KMC可以根据接收到的协商请求消息中携带的客户端设备支持的所有协议 栈类型, 从 KMC支持的所有协议栈类型中, 选择出 KMC与客户端设备共同支持的 协议栈类型。 由于 KMC与客户端设备共同支持的协议栈类型可能有多个, 若协商请 求消息中还携带有客户端设备设置的各协议栈类型对应的优先级, 则 KMC可以根据 预先设定的优先级策略, 从 KMC与客户端设备共同支持的协议栈类型中, 选择出一 个协议栈类型。
Figure imgf000014_0001
The subsequent KMC can select the protocol stack type supported by the KMC and the client device from all the protocol stack types supported by the KMC according to all protocol stack types supported by the client device carried in the received negotiation request message. The number of protocol stacks supported by the KMC and the client device may be multiple. If the negotiation request message carries the priority corresponding to each protocol stack type set by the client device, the KMC may be based on a preset priority policy. Select a protocol stack type from the protocol stack type supported by the KMC and the client device.
步骤 402, 客户端设备向 KMC发送步骤 401加密后的协商请求消息。  Step 402: The client device sends the negotiation request message encrypted in step 401 to the KMC.
步骤 403, KMC使用 KMC私钥对接收到的加密后的协商请求消息进行解密。 步骤 404, KMC根据协商请求消息所携带的客户端设备支持的所有协议栈类型, 结合该 KMC自身支持的所有协议栈类型, 确定出 KMC与客户端设备共同支持的所 有协议栈类型。  Step 403: The KMC decrypts the received encrypted negotiation request message by using the KMC private key. Step 404: The KMC determines, according to all protocol stack types supported by the client device carried in the negotiation request message, all the protocol stack types supported by the KMC and the client device according to all protocol stack types supported by the KMC.
步骤 405, KMC从确定出的 KMC与客户端设备共同支持的所有协议栈类型中, 选取一个协议栈类型。  Step 405: The KMC selects a protocol stack type from all the protocol stack types supported by the determined KMC and the client device.
其中, KMC可以采取如下任意一种方式选取一个协议栈类型: 从 KMC与客户 端设备共同支持的所有协议栈类型中, 随机选择出一个协议栈类型; 根据 KMC预先 设定的协议栈类型优先级, 从 KMC与客户端设备共同支持的所有协议栈类型中, 根 据预先设定的策略选择出一个协议栈类型,例如, 预先设定选取一个优先级最高的协 议栈类型, 或预先设定选取一个优先级最低的协议栈类型; 根据接收到的协商请求消 息中携带的由客户端设备预先设定的协议栈类型优先级, 从 KMC与客户端设备共同 支持的所有协议栈类型中, 根据预先设定的策略选择一个协议栈类型, 例如, 预先设 定选取一个优先级最高的协议栈类型, 或预先设定选取一个优先级最低的协议栈类 型。 The KMC may select a protocol stack type in any of the following ways: From the protocol stack types supported by the KMC and the client device, randomly select a protocol stack type; Set the protocol stack type priority. From all the protocol stack types supported by the KMC and the client device, select a protocol stack type according to a preset policy. For example, preset a protocol stack with the highest priority. Type, or pre-set to select a protocol stack type with the lowest priority; according to the protocol stack type priority preset by the client device carried in the received negotiation request message, all supported by the KMC and the client device In the protocol stack type, a protocol stack type is selected according to a preset policy, for example, a protocol stack type with the highest priority is selected in advance, or a protocol stack type with the lowest priority is selected in advance.
本发明实施例中, 当 KMC和客户端设备都预先设置了协议栈类型优先级时, 可 以都预先设置相同的协议栈类型优先级, 或者, 当 KMC预先设置的协议栈类型优先 级与客户端设备预先设置的协议栈类型优先级不同时, 可以预先约定采用 KMC预先 设置的协议栈类型优先级,或者预先约定采用客户端设备预先设置的协议栈类型优先 级。  In the embodiment of the present invention, when both the KMC and the client device have the protocol stack type priority set in advance, the same protocol stack type priority may be preset in advance, or the protocol stack type priority and the client preset by the KMC are used. When the priority of the protocol stack type preset by the device is different, the priority of the protocol stack type preset by the KMC may be pre-agreed, or the protocol stack type priority preset by the client device may be pre-agreed.
步骤 406, KMC使用 KMC私钥对待发送的第一协商响应消息进行加密,第一协 商响应消息中携带有步骤 405选取的一个协议栈类型。  Step 406: The KMC encrypts the first negotiation response message to be sent by using the KMC private key, and the first negotiation response message carries a protocol stack type selected in step 405.
步骤 407, KMC将加密后的第一协商响应消息发送给客户端设备。  Step 407: The KMC sends the encrypted first negotiation response message to the client device.
步骤 408, 客户端设备使用 KMC公钥对接收到的加密后的第一协商响应消息进 行解密。  Step 408: The client device decrypts the received encrypted first negotiation response message by using the KMC public key.
其中, 客户端设备可以从第一协商响应消息中, 直接获得 KMC选取的该客户端 设备与上述 KMC共同支持的一个协议栈类型, 后续客户端设备可以使用该协议栈类 型与 KMC进行 KMIP会话。  The client device may directly obtain a protocol stack type supported by the KMC and the KMC supported by the KMC from the first negotiation response message, and the subsequent client device may use the protocol stack type to perform a KMIP session with the KMC.
此外, 采用公私钥机制对协议栈类型协商时所传输的信息进行加密和解密处理 时, 设置公私钥对的主体还可以为客户端设备, 其中, 客户端设备可以预先设置客户 端公钥和客户端私钥, 并公布客户端公钥, 以及保存客户端私钥。后续客户端设备可 以利用所述客户端私钥对待发送给所述 KMC的消息进行加密, 以及利用所述客户端 私钥对从所述 KMC接收到的消息进行解密, 相应的, KMC利用所述客户端公钥对 从所述客户端设备接收到的消息进行解密,以及利用所述客户端公钥对待发送给所述 客户端设备的消息进行加密。 具体的, 客户端设备采用客户端私钥对发送给 KMC的 协商请求消息进行加密, KMC采用客户端公钥对接收到的加密后的协商请求消息进 行解密; 当 KMC向客户端设备返回第一协商响应消息时, 采用客户端公钥对待发送 的第一协商响应消息进行加密,客户端设备采用客户端私钥对接收到的加密后的第一 协商响应消息进行解密。 如图 5所示为本发明协议栈类型协商方法的另一个实施例,该实施例中第一协商 设备为客户端设备, 第二协商设备为 KMC, 其中由 KMC和客户端设备双方共同选 择协议栈类型,同时采用由客户端设备设置的公私钥对协议栈类型协商时所传输的信 息进行加密和解密处理, 其具体处理流程如下: In addition, when the information transmitted by the protocol stack type is encrypted and decrypted by using the public-private key mechanism, the main body of the public-private key pair may also be a client device, wherein the client device may pre-set the client public key and the client. End the private key, and publish the client public key, and save the client private key. The subsequent client device may encrypt the message to be sent to the KMC by using the client private key, and decrypt the message received from the KMC by using the client private key, and accordingly, the KMC utilizes the The client public key decrypts the message received from the client device and encrypts the message to be sent to the client device using the client public key. Specifically, the client device encrypts the negotiation request message sent to the KMC by using the client private key, and the KMC decrypts the received encrypted negotiation request message by using the client public key; when the KMC returns the first to the client device When the response message is negotiated, the first negotiation response message to be sent by the client public key is encrypted, and the client device decrypts the received encrypted first negotiation response message by using the client private key. As shown in FIG. 5, the protocol stack type negotiation method of the present invention is another embodiment. In this embodiment, the first negotiation device is a client device, and the second negotiation device is a KMC, where the KMC and the client device jointly select a protocol. The stack type uses the public-private key set by the client device to encrypt and decrypt the information transmitted during the negotiation of the protocol stack type. The specific processing flow is as follows:
步骤 501, 客户端设备使用客户端私钥对待发送的协商请求消息进行加密, 协商 请求消息携带有该客户端设备自身支持的所有协议栈类型。  Step 501: The client device encrypts the negotiation request message to be sent by using the client private key, and the negotiation request message carries all protocol stack types supported by the client device.
其中, 客户端设备可以预先设置客户端公钥和客户端私钥, 并公布客户端公钥, 以及保存客户端私钥。  The client device may preset the client public key and the client private key, advertise the client public key, and save the client private key.
步骤 502, 客户端设备向 KMC发送步骤 501加密后的协商请求消息。  Step 502: The client device sends the negotiation request message encrypted in step 501 to the KMC.
步骤 503, KMC使用客户端公钥对接收到的加密后的协商请求消息进行解密。 其中, 系统中可以存在多个客户端设备分别与 KMC进行 KMIP会话, 各客户端 设备可以分别设置客户端公钥和客户端私钥, 并公布客户端公钥, 以及保存客户端私 钥, KMC接收到客户端设备公布的客户端公钥后, 可以将客户端公钥与客户端设备 的标识对应存储, 以便后续接收到该客户端设备所发送的协商请求消息后,根据协商 请求消息中携带的客户端设备的标识,在预先存储的客户端公钥与客户端设备的标识 的对应关系中, 查找客户端设备的标识所对应的客户端公钥, 并用查找到的客户端公 钥对协商请求消息进行解密, KMC中存储的客户端公钥与客户端设备的标识的对应 关系 表三所示。  Step 503: The KMC decrypts the received encrypted negotiation request message by using the client public key. The system may have multiple client devices respectively performing KMIP sessions with the KMC, and each client device may separately set the client public key and the client private key, and advertise the client public key, and save the client private key, KMC. After receiving the client public key advertised by the client device, the client public key may be stored in association with the identifier of the client device, so as to receive the negotiation request message sent by the client device, and then carry the message according to the negotiation request message. The identifier of the client device, in the corresponding relationship between the pre-stored client public key and the identifier of the client device, find the client public key corresponding to the identifier of the client device, and negotiate with the found client public key pair The request message is decrypted, and the correspondence between the client public key stored in the KMC and the identifier of the client device is shown in Table 3.
Figure imgf000016_0001
步骤 504, KMC根据协商请求消息所携带的客户端设备支持的所有协议栈类型, 结合该 KMC自身支持的所有协议栈类型, 选择出 KMC与客户端设备共同支持的所 有协议栈类型。
Figure imgf000016_0001
Step 504: The KMC selects all protocol stack types supported by the KMC and the client device according to all protocol stack types supported by the client device carried by the negotiation request message and all protocol stack types supported by the KMC.
步骤 505, KMC使用客户端公钥对待发送的第一协商响应消息进行加密, 第一 协商响应消息中携带有 KMC与客户端设备共同支持的所有协议栈类型。  Step 505: The KMC encrypts the first negotiation response message to be sent by using the client public key. The first negotiation response message carries all protocol stack types supported by the KMC and the client device.
本发明实施例中, 第一协商响应消息可以仅携带有 KMC与客户端设备共同支持 的所有协议栈类型, 进一步还可以携带有 KMC设置的各协议栈类型对应的优先级。 此外, 第一协商响应消息中也可以仅携带有 KMC支持的所有协议栈类型, 后续 可以由客户端设备根据第一协商响应消息所携带的 KMC支持的所有协议栈类型, 结 合该客户端设备自身支持的所有协议栈类型, 选择出 KMC与客户端设备共同支持的 所有协议栈类型, 第一协商响应消息中进一步还可以携带有 KMC设置的各协议栈类 型对应的优先级。 In the embodiment of the present invention, the first negotiation response message may only carry all the protocol stack types supported by the KMC and the client device, and may further carry the priority corresponding to each protocol stack type set by the KMC. In addition, the first negotiation response message may also carry only all protocol stack types supported by the KMC, and may be combined by the client device according to all protocol stack types supported by the KMC carried by the first negotiation response message, and the client device itself. All the types of protocol stacks supported by the KMC and the client device are selected. The first negotiation response message may further carry the priority corresponding to each protocol stack type set by the KMC.
步骤 506, KMC将加密后的第一协商响应消息发送给客户端设备。  Step 506: The KMC sends the encrypted first negotiation response message to the client device.
步骤 507, 客户端设备使用客户端私钥对接收到的加密后的第一协商响应消息进 行解密。  Step 507: The client device decrypts the received encrypted first negotiation response message by using the client private key.
KMC 与客户端设备共同支持的协议栈类型可以只有一个, 也可以有多个, 当 KMC 与客户端设备共同支持的协议栈类型大于一个时, 客户端设备还可以从 KMC 与客户端设备共同支持的所有协议栈类型中, 预先选择出一个协议栈类型, 并将选择 出的该协议栈类型发送给 KMC, 以便客户端设备与 KMC进行 KMIP会话时, 双方 都使用选择出的该协议栈类型进行 KMIP会话, 因此,本发明实施例还可以包括多个 可选步骤, 如下步骤 508至步骤 511。  The protocol stack supported by the KMC and the client device can be one or more. When the KMC and the client device support more than one protocol stack, the client device can also support the KMC and the client device. In all protocol stack types, a protocol stack type is pre-selected, and the selected protocol stack type is sent to the KMC, so that when the client device performs a KMIP session with the KMC, both parties use the selected protocol stack type. The KMIP session, therefore, the embodiment of the present invention may further include multiple optional steps, as follows, step 508 to step 511.
步骤 508, 客户端设备从第一协商响应消息所携带的 KMC与客户端设备共同支 持的所有协议栈类型中, 选择一个协议栈类型。  Step 508: The client device selects a protocol stack type from all protocol stack types supported by the KMC and the client device carried by the first negotiation response message.
其中, 客户端设备在选择协议栈类型时, 可以采用如下任意一种选取方式: 从 KMC与客户端设备共同支持的所有协议栈类型中, 随机选择出一个协议栈类型; 从The client device may adopt any one of the following methods when selecting a protocol stack type: randomly select a protocol stack type from all protocol stack types supported by the KMC and the client device;
KMC与客户端设备共同支持的所有协议栈类型中, 根据客户端设备预先设置的协议 栈类型优先级选取一个协议栈类型; 从 KMC与客户端设备共同支持的所有协议栈类 型中, 根据第一协商响应消息中携带的 KMC预先设置的协议栈类型优先级选取一个 协议栈类型。 Among all the protocol stack types supported by the KMC and the client device, a protocol stack type is selected according to the protocol stack type priority set by the client device; from all protocol stack types supported by the KMC and the client device, according to the first The priority of the protocol stack type preset by the KMC carried in the negotiation response message is selected as a protocol stack type.
步骤 509, 客户端设备使用客户端私钥对待发送的第二协商响应消息进行加密, 第二协商响应消息中携带有步骤 508选择出的一个协议栈类型。  Step 509: The client device encrypts the second negotiation response message to be sent by using the client private key, and the second negotiation response message carries a protocol stack type selected in step 508.
步骤 510, 客户端设备将加密后的第二协商响应消息发送给 KMC。  Step 510: The client device sends the encrypted second negotiation response message to the KMC.
步骤 511, KMC利用客户端公钥对加密后的第二协商响应消息进行解密, 后续 该 KMC在与客户端设备进行 KMIP会话时, 使用第二协商响应消息中所携带的该协 议栈类型与该客户端设备进行 KMIP会话。  Step 511: The KMC decrypts the encrypted second negotiation response message by using the client public key, and the KMC uses the protocol stack type carried in the second negotiation response message when the KMC performs a KMIP session with the client device. The client device performs a KMIP session.
此外, 采用公私钥机制对协议栈类型协商时所传输的信息进行加密和解密处理 时, 设置公私钥对的主体还可以为 KMC, 具体的加密解密处理过程此处不再赘述。 如图 6所示为本发明协议栈类型协商方法的另一个实施例,该实施例中第一协商 设备为客户端设备, 第二协商设备为 KMC, 其中由 KMC单方选择协议栈类型, 再 将选择的协议栈类型发送给客户端设备,同时采用对称密钥对协议栈类型协商时所传 输的信息进行加密和解密处理并引入随机数增强加解密的健壮性,以确保协议栈类型 协商过程信息没有遭到篡改, 其具体处理流程如下: In addition, when the public-private key mechanism is used to encrypt and decrypt the information transmitted during the negotiation of the protocol stack type, the main body of the public-private key pair may also be a KMC. The specific encryption and decryption processing process is not described here. As shown in FIG. 6 , another embodiment of the method for negotiating a protocol stack type according to the present invention is as follows: in this embodiment, the first negotiation device is a client device, and the second negotiation device is a KMC, where the KMC unilaterally selects a protocol stack type, and then The selected protocol stack type is sent to the client device, and the information transmitted by the protocol stack type is encrypted and decrypted by using the symmetric key, and the robustness of the random number enhanced encryption and decryption is introduced to ensure the protocol stack type negotiation process information. It has not been tampered with, and its specific processing flow is as follows:
步骤 601, 客户端设备与 KMC双方共享对称密钥 Key。  Step 601: The client device and the KMC share a symmetric key Key.
步骤 602, 客户端设备向 KMC发送协商请求消息。  Step 602: The client device sends a negotiation request message to the KMC.
本发明实施例中, 协商请求消息携带有 2部分内容: Contentl , Content2。  In the embodiment of the present invention, the negotiation request message carries two parts of content: Contentl, Content2.
Contentl可以仅包含该客户端设备自身支持的所有协议栈类型,进一步还可以包 含客户端设备设置的各协议栈类型对应的优先级。  Contentl may contain only all protocol stack types supported by the client device itself, and may further include the priority corresponding to each protocol stack type set by the client device.
Content2为执行加密函数 encryptFunc (ClientRandl , Contentl , Key) 后得到的 密文输出。 其中参数 ClientRandl是客户端设备产生的随机数, 它与参数 Contentl同 为加密算法中的明文输入,参数 Key是步骤 601中的对称密钥 Key,在函数 encryptFunc 中作为加密密钥。  Content2 is the ciphertext output obtained after executing the encryption function encryptFunc (ClientRandl, Contentl, Key). The parameter ClientRandl is a random number generated by the client device. It is the same as the parameter Contentl as the plaintext input in the encryption algorithm. The parameter Key is the symmetric key Key in step 601, and is used as the encryption key in the function encryptFunc.
步骤 603, KMC确定协商请求消息的合法性。  Step 603: The KMC determines the validity of the negotiation request message.
其中, KMC首先执行解密函数 decryptFunc (步骤 602携带的 Content2, Key) 得到明文输出。 其中参数 Key是步骤 601中的对称密钥 Key, 在函数 decryptFunc中 作为解密密钥。 如果解密失败, 说明协商请求消息不合法 (可能已遭篡改), 则终止 协商。 如果解密成功, 得到 ClientRandl ' , Contentl ' 。 KMC再比对 Contentl ' 与 步骤 602中携带的 Contentl , 如果二者不一致, 说明协商请求消息不合法(可能已遭 篡改), 则终止协商。 如果二者一致, 说明协商请求消息合法, 则继续协商。  The KMC first performs a decryption function decryptFunc (Content2, Key carried in step 602) to obtain a plaintext output. The parameter Key is the symmetric key Key in step 601, and is used as the decryption key in the function decryptFunc. If the decryption fails, indicating that the negotiation request message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get ClientRandl ' , Contentl '. The KMC then compares Contentl ' with the Contentl carried in step 602. If the two are inconsistent, indicating that the negotiation request message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the negotiation request message is valid, continue to negotiate.
步骤 604, KMC根据协商请求消息所携带的 Contentl中的客户端设备支持的所 有协议栈类型, 结合该 KMC自身支持的所有协议栈类型, 确定出 KMC与客户端设 备共同支持的所有协议栈类型。  Step 604: The KMC determines, according to all protocol stack types supported by the client device in the Content1 carried in the negotiation request message, and all protocol stack types supported by the KMC, to determine all protocol stack types supported by the KMC and the client device.
步骤 605, KMC从确定出的 KMC与客户端设备共同支持的所有协议栈类型中选 取一个协议栈类型。  Step 605: The KMC selects a protocol stack type from all the protocol stack types supported by the determined KMC and the client device.
其中, KMC可以采取如下任意一种方式选取一个协议栈类型: 从 KMC与客户 端设备共同支持的所有协议栈类型中, 随机选择出一个协议栈类型; 根据协商请求消 息中携带的客户端设备预先设置的协议栈类型优先级, 从 KMC与客户端设备共同支 持的所有协议栈类型中, 根据预先设定的策略选择一个协议栈类型, 例如, 预先设定 选取一个优先级最高的协议栈类型, 或预先设定选取一个优先级最低的协议栈类型; 从 KMC与客户端设备共同支持的所有协议栈类型中, 根据 KMC预先设置的协议栈 类型优先级, 依照预先设定的策略选择一个协议栈类型, 例如, 预先设定选取一个优 先级最高的协议栈类型, 或预先设定选取一个优先级最低的协议栈类型。 The KMC can select a protocol stack type in any of the following ways: From the protocol stack types supported by the KMC and the client device, a protocol stack type is randomly selected; according to the client device carried in the negotiation request message. The protocol stack type priority is set. From all the protocol stack types supported by the KMC and the client device, a protocol stack type is selected according to a preset policy, for example, a protocol stack type with the highest priority is selected in advance. Or pre-set to select a protocol stack type with the lowest priority; From all protocol stack types supported by the KMC and the client device, according to the protocol stack type priority preset by the KMC, a protocol stack type is selected according to a preset policy, for example, a protocol with the highest priority is selected in advance. Stack type, or pre-set to select a protocol stack type with the lowest priority.
步骤 606, KMC将第一协商响应消息发送给客户端设备, 第一协商响应消息中 携带有 2部分内容: Content3和 Content4。  Step 606: The KMC sends a first negotiation response message to the client device, where the first negotiation response message carries two parts of content: Content3 and Content4.
Content3为步骤 605选取的一个协议栈类型。  Content3 is a protocol stack type selected in step 605.
Content4为执行加密函数 encryptFunc (随机数组合, Content3 , Key) 得到的密 文输出。 其中参数 "随机数组合"可以仅包含步骤 603中解密得到的 ClientRandl ' , 进一步还可以包含 KMC生成的随机数 KMCRandl。 两个随机数可通过与 /或 /连接等 方式组合。 "随机数组合"与 Content3同为加密算法中的明文输入, 参数 Key是步骤 601中的对称密钥 Key, 在函数 encryptFunc中作为加密密钥。  Content4 is the ciphertext output obtained by executing the encryption function encryptFunc (random number combination, Content3, Key). The parameter "random number combination" may only include the ClientRandl ' decrypted in step 603, and may further include the random number KMCRand1 generated by the KMC. Two random numbers can be combined by means of / or / connection. The "random number combination" is the same as the plaintext input in the encryption algorithm, and the parameter Key is the symmetric key Key in step 601, and is used as the encryption key in the function encryptFunc.
步骤 607, 客户端设备确定第一协商响应消息的合法性。  Step 607: The client device determines validity of the first negotiation response message.
其中, 客户端设备首先执行解密函数 decryptFunc (步骤 606携带的 Contents Key)得到明文输出。如果解密失败,说明第一协商响应消息不合法(可能已遭篡改), 则终止协商。 如果解密成功, 得到随机数组合' , Content3 ' 。 客户端设备再比对 Contents ' 与步骤 606中携带的 Content3, 如果二者不一致, 说明第一协商响应消息 不合法(可能已遭篡改), 则终止协商。 如果二者一致, 说明第一协商响应消息合法, 则选取 Content3中的这个协议栈类型为协商后的协议栈类型。 如图 7所示为本发明协议栈类型协商方法的另一个实施例,该实施例中第一协商 设备为客户端设备, 第二协商设备为 KMC, 其中由 KMC和客户端设备双方共同选 择协议栈类型, 再由客户端设备将最终选择的协议栈类型发送给 KMC, 同时采用对 称密钥对协议栈类型协商时所传输的信息进行加密和解密处理,并引入随机数增强加 解密健壮性, 以确保协议栈类型协商过程信息没有遭到篡改, 其具体处理流程如下: 步骤 701, 客户端设备与 KMC双方共享对称密钥 Key。 The client device first performs a decryption function decryptFunc (Contents Key carried in step 606) to obtain a plaintext output. If the decryption fails, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get the random number combination ', Cont en t3 '. The client device compares Contents ' with Content3 carried in step 606. If the two are inconsistent, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the first negotiation response message is valid, the protocol stack type in Cont en t3 is selected as the negotiated protocol stack type. As shown in FIG. 7 , another embodiment of the method for negotiating a protocol stack of the present invention is as follows: in this embodiment, the first negotiation device is a client device, and the second negotiation device is a KMC, where the KMC and the client device jointly select a protocol. The stack type, the client device sends the finally selected protocol stack type to the KMC, and uses the symmetric key to encrypt and decrypt the information transmitted during the negotiation of the protocol stack type, and introduces random number enhancement encryption and decryption robustness. To ensure that the protocol stack negotiation process information has not been tampered with, the specific processing procedure is as follows: Step 701: The client device and the KMC share the symmetric key Key.
步骤 702, 客户端设备向 KMC发送协商请求消息。  Step 702: The client device sends a negotiation request message to the KMC.
本发明实施例中, 协商请求消息携带有 2部分内容: Contentl , Content2。  In the embodiment of the present invention, the negotiation request message carries two parts of content: Contentl, Content2.
Contentl可以仅包含该客户端设备自身支持的所有协议栈类型,进一步还可以包 含客户端设备设置的各协议栈类型对应的优先级。  Contentl may contain only all protocol stack types supported by the client device itself, and may further include the priority corresponding to each protocol stack type set by the client device.
Content2为执行加密函数 encryptFunc (ClientRandl , Contentl , Key) 后得到的 密文输出。 其中参数 ClientRandl是客户端设备产生的随机数, 它与参数 Contentl同 为加密算法中的明文输入,参数 Key是步骤 701中的对称密钥 Key,在函数 encryptFunc 中作为加密密钥。 Content2 is the ciphertext output obtained after executing the encryption function encryptFunc (ClientRandl, Contentl, Key). The parameter ClientRandl is a random number generated by the client device, which is the same as the parameter Contentl. For the plaintext input in the encryption algorithm, the parameter Key is the symmetric key Key in step 701, and is used as the encryption key in the function encryptFunc.
步骤 703, KMC确定协商请求消息的合法性。  Step 703: The KMC determines the validity of the negotiation request message.
其中, KMC首先执行解密函数 decryptFunc (步骤 702携带的 Content2, Key) 得到明文输出。 其中参数 Key是步骤 701中的对称密钥 Key, 在函数 decryptFunc中 作为解密密钥。 如果解密失败, 说明协商请求消息不合法 (可能已遭篡改), 则终止 协商。 如果解密成功, 得到 ClientRandl ' , Content 1 ' 。 KMC再比对 Content 与 步骤 702中携带的 Contentl , 如果二者不一致, 说明协商请求消息不合法(可能已遭 篡改), 则终止协商。 如果二者一致, 说明协商请求消息合法, 则继续协商。  The KMC first performs the decryption function decryptFunc (Content2, Key carried in step 702) to obtain the plaintext output. The parameter Key is the symmetric key Key in step 701, and is used as the decryption key in the function decryptFunc. If the decryption fails, indicating that the negotiation request message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get ClientRandl ' , Content 1 '. The KMC then compares the Content with the Contentl carried in step 702. If the two are inconsistent, indicating that the negotiation request message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the negotiation request message is valid, continue to negotiate.
步骤 704, KMC根据协商请求消息所携带的 Contentl中的客户端设备支持的所 有协议栈类型, 结合该 KMC自身支持的所有协议栈类型, 选择出 KMC与客户端设 备共同支持的所有协议栈类型。  Step 704: The KMC selects all protocol stack types supported by the KMC and the client device according to all protocol stack types supported by the client device in the Content1 carried in the negotiation request message, and all protocol stack types supported by the KMC.
步骤 705, KMC将第一协商响应消息发送给客户端设备。  Step 705: The KMC sends the first negotiation response message to the client device.
本发明实施例中, 第一协商响应消息携带有 2部分内容: Content3, Content4。 Content3可以仅包含 KMC与客户端设备共同支持的所有协议栈类型, 进一步还 可以包含 KMC设置的各协议栈类型对应的优先级。  In the embodiment of the present invention, the first negotiation response message carries two parts of content: Content3, Content4. Content3 can contain only all the protocol stack types supported by the KMC and the client device, and can further include the priority corresponding to each protocol stack type set by the KMC.
Content4为执行加密函数 encryptFunc (随机数组合, Content3, Key) 后得到的 密文输出。其中参数"随机数组合"可以仅包含步骤 703中解密得到的 ClientRandl ' , 进一步还可以包含 KMC产生的随机数 KMCRandl。 两个随机数可通过与 /或 /连接等 方式组合。 "随机数组合"与 Content3同为加密算法中的明文输入, 参数 Key是步骤 701 中的对称密钥 Key, 在函数 encryptFunc中作为加密密钥。 此外, 第一协商响应 消息中 Content3也可以仅包含 KMC支持的所有协议栈类型,后续可以由客户端设备 根据第一协商响应消息所携带的 KMC支持的所有协议栈类型, 结合该客户端设备自 身支持的所有协议栈类型, 选择出 KMC与客户端设备共同支持的所有协议栈类型, 第一协商响应消息中 Content3进一步还可以携带有 KMC设置的各协议栈类型对应的 优先级。 Content4 is the ciphertext output obtained after executing the encryption function encryptFunc (random number combination, Content3, Key). The parameter "random number combination" may include only the ClientRand1 ' obtained by decrypting in step 703, and may further include the random number KMCRand1 generated by the KMC. Two random numbers can be combined by means of / or / connection. The "random number combination" is the same as the plaintext input in the encryption algorithm, and the parameter Key is the symmetric key Key in step 701, and is used as the encryption key in the function encryptFunc. In addition, the Cont en t3 in the first negotiation response message may also include only all protocol stack types supported by the KMC, and may be combined with the client device according to all protocol stack types supported by the KMC carried by the first negotiation response message. The protocol stack type supported by the device itself is selected by the KMC and the client device. The Cont en t3 in the first negotiation response message may further carry the priority corresponding to each protocol stack type set by the KMC.
KMC 与客户端设备共同支持的协议栈类型可以只有一个, 也可以有多个, 当 KMC 与客户端设备共同支持的协议栈类型大于一个时, 客户端设备还可以从 KMC 与客户端设备共同支持的所有协议栈类型中, 预先选择出一个协议栈类型, 并将选择 出的该协议栈类型发送给 KMC, 以便客户端设备与 KMC进行 KMIP会话时, 双方 都使用选择出的该协议栈类型进行 KMIP会话, 因此,本发明实施例还包括多个可选 步骤, 如下步骤 707, 步骤 708和步骤 709。 The protocol stack supported by the KMC and the client device can be one or more. When the KMC and the client device support more than one protocol stack, the client device can also support the KMC and the client device. In all protocol stack types, a protocol stack type is pre-selected, and the selected protocol stack type is sent to the KMC, so that when the client device performs a KMIP session with the KMC, both parties use the selected protocol stack type. KMIP session, therefore, the embodiment of the present invention further includes multiple optional Steps, as follows, step 707, step 708 and step 709.
步骤 706, 客户端设备确定第一协商响应消息的合法性。  Step 706: The client device determines validity of the first negotiation response message.
其中, 客户端设备首先执行解密函数 decryptFunc (步骤 705携带的 Contents Key)得到明文输出。如果解密失败,说明第一协商响应消息不合法(可能已遭篡改), 则终止协商。 如果解密成功, 得到随机数组合' , Content3 ' 。 客户端设备再比对 Contents ' 与步骤 705中携带的 Content3, 如果二者不一致, 说明第一协商响应消息 不合法(可能已遭篡改), 则终止协商。 如果二者一致, 说明第一协商响应消息合法, 则继续协商。 步骤 707, 客户端设备从第一协商响应消息所携带的 Content3中 KMC 与客户端设备共同支持的所有协议栈类型中, 选择一个协议栈类型。 The client device first performs a decryption function decryptFunc (Contents Key carried in step 705) to obtain a plaintext output. If the decryption fails, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get the random number combination ', Cont en t3 '. The client device compares Contents ' with Content3 carried in step 705. If the two are inconsistent, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, the first negotiation response message is valid, and the negotiation is continued. Step 707: The client device selects a protocol stack type from all protocol stack types supported by the KMC and the client device in the Cont en t3 carried in the first negotiation response message.
其中, 客户端设备在选择协议栈类型时, 可以采用如下任意一种选取方式: 从 Wherein, when the client device selects the protocol stack type, any one of the following selection methods may be adopted:
KMC与客户端设备共同支持的所有协议栈类型中, 随机选择出一个协议栈类型; 从 Among all the protocol stack types supported by the KMC and the client device, a protocol stack type is randomly selected;
KMC与客户端设备共同支持的所有协议栈类型中, 根据客户端设备预先设置的协议 栈类型优先级, 根据预先设定的策略选择一个协议栈类型, 例如, 预先设定选取一个 优先级最高的协议栈类型, 或预先设定选取一个优先级最低的协议栈类型; 从 KMC 与客户端设备共同支持的所有协议栈类型中, 根据第一协商响应消息中携带的 KMC 预先设置的协议栈类型优先级, 根据预先设定的策略选择一个协议栈类型, 例如, 预 先设定选取一个优先级最高的协议栈类型,或预先设定选取一个优先级最低的协议栈 类型。 Among all the protocol stack types supported by the KMC and the client device, according to the protocol stack type priority preset by the client device, a protocol stack type is selected according to a preset policy, for example, a preset with the highest priority is selected. The protocol stack type, or a protocol stack type with the lowest priority is selected in advance; from all the protocol stack types supported by the KMC and the client device, the protocol stack type preset according to the KMC carried in the first negotiation response message takes precedence. Level, select a protocol stack type according to a preset policy, for example, pre-set to select a protocol stack type with the highest priority, or pre-set to select a protocol stack type with the lowest priority.
步骤 708, 客户端设备将第二协商响应消息发送给 KMC, 第二协商响应消息中 携带有 2部分内容: Content5, Content6。  Step 708: The client device sends a second negotiation response message to the KMC, where the second negotiation response message carries two parts: Content5, Content6.
Content5为步骤 707选取的一个协议栈类型。  Content5 is a protocol stack type selected in step 707.
Content6为执行加密函数 encryptFunc (随机数组合, Content5, Key) 得到的密 文输出。 其中参数 "随机数组合" 中可仅包含协商请求消息中的 ClientRandl , 也可 以仅包含客户端设备重新生成的随机数 ClientRand2, 进一步还可以包含步骤 705中 Content4中由 KMC生成的随机数 KMCRandl。 两个随机数可通过与 /或 /连接等方式 组合。 "随机数组合"与 Content5同为加密算法中的明文输入, 参数 Key是步骤 701 中的对称密钥 Key, 在函数 encryptFunc中作为加密密钥。  Content6 is the ciphertext output obtained by executing the encryption function encryptFunc (random number combination, Content5, Key). The parameter "random number combination" may include only the ClientRand1 in the negotiation request message, or only the random number ClientRand2 regenerated by the client device, and may further include the random number KMCRand1 generated by the KMC in Content4 in step 705. Two random numbers can be combined by means of / or / connection. The "random number combination" is the same as the plaintext input in the encryption algorithm, and the parameter Key is the symmetric key Key in step 701, and is used as the encryption key in the function encryptFunc.
步骤 709, KMC确定第二协商响应消息的合法性。  Step 709: The KMC determines the validity of the second negotiation response message.
其中, KMC首先执行解密函数 decryptFunc (步骤 708携带的 Content6, Key) 得到明文输出。 如果解密失败, 说明第二协商响应消息不合法 (可能已遭篡改), 则 终止协商。 如果解密成功, 得到随机数组合' , Content5 ' 。 KMC再比对 Content5 ' 与步骤 708中携带的 Content5, 如果二者不一致, 说明第二协商响应消息不合法(可 能已遭篡改), 则终止协商。 如果二者一致, 说明第二协商响应消息合法, 则选取 Content6中的这个协议栈类型为协商后的协议栈类型。 The KMC first executes the decryption function decryptFunc (Content6, Key carried in step 708) to obtain the plaintext output. If the decryption fails, indicating that the second negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get the random number combination ', Content5'. KMC compares Content5 ' With Content5 carried in step 708, if the two are inconsistent, indicating that the second negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the second negotiation response message is valid, the protocol stack type in Content6 is selected as the negotiated protocol stack type.
后续该 KMC在与客户端设备进行 KMIP会话时, 可以使用第二协商响应消息中 所携带的该协议栈类型与该客户端设备进行 KMIP会话。 下面介绍第一协商设备为 KMC, 即由 KMC发起协商请求的实施例。  The KMC may perform a KMIP session with the client device by using the protocol stack type carried in the second negotiation response message when performing a KMIP session with the client device. The following describes an embodiment in which the first negotiation device is a KMC, that is, a negotiation request is initiated by the KMC.
如图 8所示为本发明协议栈类型协商方法的另一个实施例,该实施例中第一协商 设备为 KMC,第二协商设备为客户端设备,其中由客户端设备单方选择协议栈类型, 再将选择的协议栈类型发送给该 KMC, 同时采用由 KMC设置的公私钥对协议栈类 型协商时所传输的信息进行加密和解密处理, 其具体处理流程如下:  As shown in FIG. 8 , another embodiment of the method for negotiating a protocol stack type of the present invention is: in this embodiment, the first negotiation device is a KMC, and the second negotiation device is a client device, where the client device unilaterally selects a protocol stack type. Then, the selected protocol stack type is sent to the KMC, and the information transmitted by the protocol stack type is encrypted and decrypted by using the public and private keys set by the KMC. The specific processing flow is as follows:
步骤 801, KMC使用 KMC私钥对待发送的协商请求消息进行加密。  Step 801: The KMC encrypts the negotiation request message to be sent by using the KMC private key.
其中, KMC可以预先设置 KMC公钥和 KMC私钥, 并公布 KMC公钥, 以及保 存 KMC私钥。  The KMC can pre-set the KMC public key and the KMC private key, publish the KMC public key, and save the KMC private key.
本发明实施例中, 协商请求消息可以仅携带有该 KMC自身支持的所有协议栈类 型, 进一步还可以携带有由 KMC设置的各协议栈类型对应的优先级。  In the embodiment of the present invention, the negotiation request message may carry only all the protocol stack types supported by the KMC, and may further carry the priority corresponding to each protocol stack type set by the KMC.
步骤 802, KMC向客户端设备发送步骤 801加密后的协商请求消息。  Step 802: The KMC sends the negotiation request message encrypted in step 801 to the client device.
步骤 803, 客户端设备使用 KMC公钥对接收到的加密后的协商请求消息进行解 密。  Step 803: The client device decrypts the received encrypted negotiation request message by using the KMC public key.
步骤 804,客户端设备根据协商请求消息所携带的 KMC支持的所有协议栈类型, 结合该客户端设备自身支持的所有协议栈类型, 确定出 KMC与客户端设备共同支持 的所有协议栈类型。  Step 804: The client device determines, according to all protocol stack types supported by the KMC carried in the negotiation request message, all protocol stack types supported by the KMC and the client device, in combination with all protocol stack types supported by the client device.
步骤 805, 客户端设备从确定出的 KMC与客户端设备共同支持的所有协议栈类 型中, 选取一个协议栈类型。  Step 805: The client device selects a protocol stack type from all the protocol stack types supported by the determined KMC and the client device.
其中, 客户端设备可以采用如下任意一种方式选取一个协议栈类型: 从 KMC与 客户端设备共同支持的所有协议栈类型中, 随机选取出一个协议栈类型; 根据客户端 设备预先设定的协议栈类型优先级, 从 KMC与客户端设备共同支持的所有协议栈类 型中,根据预先设定的策略选取出一个协议栈类型; 根据接收到的协商请求消息中携 带的由 KMC预先设定的协议栈类型优先级, 从 KMC与客户端设备共同支持的所有 协议栈类型中, 根据预先设定的策略选取一个协议栈类型。  The client device may select a protocol stack type by using any one of the following methods: From the protocol stack types supported by the KMC and the client device, randomly select a protocol stack type; according to a protocol preset by the client device The stack type priority, from all the protocol stack types supported by the KMC and the client device, select a protocol stack type according to a preset policy; according to the protocol preset by the KMC carried in the received negotiation request message Stack type priority. From all protocol stack types supported by KMC and client devices, select a protocol stack type according to a preset policy.
步骤 806, 客户端设备使用 KMC公钥对待发送的第一协商响应消息进行加密, 第一协商响应消息中携带有步骤 805选取的一个协议栈类型。 Step 806: The client device encrypts the first negotiation response message to be sent by using the KMC public key. The first negotiation response message carries a protocol stack type selected in step 805.
步骤 807, 客户端设备将加密后的第一协商响应消息发送给 KMC。  Step 807: The client device sends the encrypted first negotiation response message to the KMC.
步骤 808,KMC使用 KMC私钥对接收到的加密后的第一协商响应消息进行解密。 其中, KMC可以从第一协商响应消息中, 直接获得客户端设备选取的该客户端 设备与上述 KMC共同支持的一个协议栈类型, 后续 KMC可以使用该协议栈类型与 客户端设备进行 KMIP会话。  Step 808: The KMC decrypts the received encrypted first negotiation response message by using the KMC private key. The KMC can obtain a protocol stack type supported by the client device and the KMC jointly supported by the client device from the first negotiation response message, and the KMC can use the protocol stack type to perform a KMIP session with the client device.
此外, 采用公私钥机制对协议栈类型协商时所传输的信息进行加密和解密处理 时, 设置公私钥对的主体还可以为客户端设备, 其中, 客户端设备可以预先设置客户 端公钥和客户端私钥, 并公布客户端公钥, 以及保存客户端私钥。后续客户端设备可 以利用所述客户端私钥对待发送给所述 KMC的消息进行加密, 以及利用所述客户端 私钥对从所述 KMC接收到的消息进行解密, 相应的, KMC利用所述客户端公钥对 从所述客户端设备接收到的消息进行解密,以及利用所述客户端公钥对待发送给所述 客户端设备的消息进行加密。 具体的, KMC采用客户端公钥对发送给客户端设备的 协商请求消息进行加密,客户端设备采用客户端私钥对接收到的加密后的协商请求消 息进行解密; 当客户端设备向 KMC返回第一协商响应消息时,采用客户端私钥对待 发送的第一协商响应消息进行加密, KMC采用客户端公钥对接收到的加密后的第一 协商响应消息进行解密。 如图 9所示为本发明协议栈类型协商方法的另一个实施例,该实施例中第一协商 设备为 KMC, 第二协商设备为客户端设备, 其中由客户端设备和 KMC双方共同选 择协议栈类型,同时采用由客户端设备设置的公私钥对协议栈类型协商时所传输的信 息进行加密和解密处理, 其具体处理流程如下:  In addition, when the information transmitted by the protocol stack type is encrypted and decrypted by using the public-private key mechanism, the main body of the public-private key pair may also be a client device, wherein the client device may pre-set the client public key and the client. End the private key, and publish the client public key, and save the client private key. The subsequent client device may encrypt the message to be sent to the KMC by using the client private key, and decrypt the message received from the KMC by using the client private key, and accordingly, the KMC utilizes the The client public key decrypts the message received from the client device and encrypts the message to be sent to the client device using the client public key. Specifically, the KMC encrypts the negotiation request message sent to the client device by using the client public key, and the client device decrypts the received encrypted negotiation request message by using the client private key; when the client device returns to the KMC When the first negotiation response message is used, the first negotiation response message to be sent by the client private key is encrypted, and the KMC decrypts the received encrypted first negotiation response message by using the client public key. As shown in FIG. 9 , another embodiment of the method for negotiating a protocol stack type according to the present invention is as follows: in this embodiment, the first negotiation device is a KMC, and the second negotiation device is a client device, where the client device and the KMC jointly select a protocol. The stack type uses the public-private key set by the client device to encrypt and decrypt the information transmitted during the negotiation of the protocol stack type. The specific processing flow is as follows:
步骤 901, KMC使用客户端公钥对待发送的协商请求消息进行加密, 协商请求 消息携带有该 KMC自身支持的所有协议栈类型。  Step 901: The KMC encrypts the negotiation request message to be sent by using the client public key, and the negotiation request message carries all protocol stack types supported by the KMC.
本发明实施例中, 协商请求消息可以仅携带有该 KMC自身支持的所有协议栈类 型, 进一步还可以携带有 KMC设置的各协议栈类型对应的优先级。  In the embodiment of the present invention, the negotiation request message may carry only all the protocol stack types supported by the KMC, and may further carry the priority corresponding to each protocol stack type set by the KMC.
其中, 客户端设备可以预先设置客户端公钥和客户端私钥, 并公布客户端公钥, 以及保存客户端私钥。  The client device may preset the client public key and the client private key, advertise the client public key, and save the client private key.
本发明实施例中, 当存在多个客户端设备需要分别与 KMC进行 KMIP会话时, 各客户端设备可以分别设置客户端公钥和客户端私钥, 并公布客户端公钥, 以及保存 客户端私钥, KMC接收到客户端设备公布的客户端公钥后, 可以将客户端公钥与客 户端设备的标识对应存储, 以便在于客户端设备进行协议栈类型协商时,在预先存储 的客户端公钥与客户端设备的标识的对应关系中,查找客户端设备的标识所对应的客 户端公钥, 并用查找到的客户端公钥对待发送的协商请求消息进行加密。 In the embodiment of the present invention, when there are multiple client devices that need to perform a KMIP session with the KMC respectively, each client device may separately set a client public key and a client private key, and advertise the client public key, and save the client. The private key, after receiving the client public key published by the client device, the KMC can contact the client public key with the client. The identifier of the client device is correspondingly stored, so that the client corresponding to the identifier of the client device is found in the correspondence between the pre-stored client public key and the identifier of the client device when the client device performs protocol stack type negotiation. The public key, and the negotiation request message to be sent is encrypted by the found client public key.
步骤 902, KMC向客户端设备发送步骤 901加密后的协商请求消息。  Step 902: The KMC sends the negotiation request message encrypted in step 901 to the client device.
步骤 903, 客户端设备使用客户端私钥对接收到的加密后的协商请求消息进行解 密。  Step 903: The client device decrypts the received encrypted negotiation request message by using the client private key.
步骤 904,客户端设备根据协商请求消息所携带的 KMC支持的所有协议栈类型, 结合该客户端设备自身支持的所有协议栈类型, 选择出 KMC与客户端设备共同支持 的所有协议栈类型。  Step 904: The client device selects all protocol stack types supported by the KMC and the client device according to all protocol stack types supported by the KMC carried by the negotiation request message and all protocol stack types supported by the client device.
步骤 905, 客户端设备使用客户端私钥对待发送的第一协商响应消息进行加密, 第一协商响应消息中携带有 KMC与客户端设备共同支持的所有协议栈类型。  Step 905: The client device encrypts the first negotiation response message to be sent by using the client private key, where the first negotiation response message carries all protocol stack types supported by the KMC and the client device.
本发明实施例中, 第一协商响应消息可以仅携带有 KMC与客户端设备共同支持 的所有协议栈类型,进一步还可以携带有由客户端设备设置的各协议栈类型对应的优 先级。  In the embodiment of the present invention, the first negotiation response message may only carry all the protocol stack types supported by the KMC and the client device, and may further carry the priority corresponding to each protocol stack type set by the client device.
此外, 第一协商响应消息中也可以仅携带有客户端设备支持的所有协议栈类型, 后续可以由 KMC 根据第一协商响应消息所携带的客户端设备支持的所有协议栈类 型, 结合该 KMC自身支持的所有协议栈类型, 选择出 KMC与客户端设备共同支持 的所有协议栈类型,第一协商响应消息中进一步还可以携带有客户端设备设置的各协 议栈类型对应的优先级。  In addition, the first negotiation response message may also carry only all protocol stack types supported by the client device, and may be combined with the KMC itself according to all protocol stack types supported by the client device carried by the first negotiation response message. All the types of protocol stacks supported by the KMC and the client device are selected. The first negotiation response message may further carry the priority corresponding to each protocol stack type set by the client device.
步骤 906, 客户端设备将加密后的第一协商响应消息发送给 KMC。  Step 906: The client device sends the encrypted first negotiation response message to the KMC.
步骤 907, KMC使用客户端公钥对接收到的加密后的第一协商响应消息进行解 密。  Step 907: The KMC decrypts the received encrypted first negotiation response message by using the client public key.
其中, KMC与客户端设备共同支持的协议栈类型可以只有一个, 也可以有多个, 当 KMC与客户端设备共同支持的协议栈类型大于一个时, KMC还可以从 KMC与客 户端设备共同支持的所有协议栈类型中, 预先选择出一个协议栈类型, 后续 KMC在 与该客户端设备进行 KMIP会话时,使用选择出的该协议栈类型与该客户端设备进行 KMIP会话, 因此, 本发明实施例还包括多个可选步骤, 如下步骤 908至步骤 911。  The KMC and the client device can support only one protocol type or multiple. When the KMC and the client device support more than one protocol stack type, the KMC can also support the KMC and the client device. In all the protocol stack types, a protocol stack type is pre-selected, and the subsequent KMC performs a KMIP session with the client device by using the selected protocol stack type when performing a KMIP session with the client device. Therefore, the present invention implements The example also includes a plurality of optional steps, as follows step 908 to step 911.
步骤 908, KMC从第一协商响应消息所携带的 KMC与客户端设备共同支持的所 有协议栈类型中, 选择一个协议栈类型。  Step 908: The KMC selects a protocol stack type from all protocol stack types supported by the KMC and the client device carried by the first negotiation response message.
其中, KMC 在选择协议栈类型时, 可以采用如下任意一种选取方式: 从 KMC 与客户端设备共同支持的所有协议栈类型中,随机选择出一个协议栈类型;根据 KMC 预先设定的协议栈类型优先级,从 KMC与客户端设备共同支持的所有协议栈类型中, 根据预先设定的策略选择一个协议栈类型;根据接收到的第一协商响应消息中携带的 由客户端设备预先设定的协议栈类型优先级, 从 KMC与客户端设备共同支持的所有 协议栈类型中, 根据预先设定的策略选择一个协议栈类型。 The KMC may select any of the following methods when selecting the protocol stack type: From the protocol stack types supported by the KMC and the client device, a protocol stack type is randomly selected; according to the KMC Pre-set protocol stack type priority, from all protocol stack types supported by the KMC and the client device, selecting a protocol stack type according to a preset policy; according to the received first negotiation response message The pre-set protocol stack type priority of the client device. From all protocol stack types supported by the KMC and the client device, a protocol stack type is selected according to a preset policy.
步骤 909, KMC使用客户端公钥对待发送的第二协商响应消息进行加密, 第二 协商响应消息中携带有步骤 908选择出的一个协议栈类型。  Step 909: The KMC encrypts the second negotiation response message to be sent by using the client public key, and the second negotiation response message carries a protocol stack type selected by step 908.
步骤 910, KMC将加密后的第二协商响应消息发送给客户端设备。  Step 910: The KMC sends the encrypted second negotiation response message to the client device.
步骤 911, 客户端设备利用客户端私钥对加密后的第二协商响应消息进行解密, 后续该客户端设备在与 KMC进行 KMIP会话时, 使用第二协商响应消息中所携带的 该协议栈类型与该 KMC进行 KMIP会话。  Step 911: The client device decrypts the encrypted second negotiation response message by using the client private key, and then the client device uses the protocol stack type carried in the second negotiation response message when performing KMIP session with the KMC. A KMIP session with the KMC.
此外, 采用公私钥机制对协议栈类型协商时所传输的信息进行加密和解密处理 时, 设置公私钥对的主体还可以为 KMC, 具体的加密解密处理过程此处不再赘述。 如图 10所示为本发明协议栈类型协商方法的另一个实施例, 该实施例中第一协 商设备为 KMC, 第二协商设备为客户端设备, 其中由客户端设备单方选择协议栈类 型, 再将选择的协议栈类型发送给 KMC, 同时采用对称密钥对协议栈类型协商时所 传输的信息进行加密和解密处理, 并引入随机数增强加解密健壮性, 以确保协议栈类 型协商过程信息没有遭到篡改, 其具体处理流程如下:  In addition, when the public-private key mechanism is used to encrypt and decrypt the information transmitted during the negotiation of the protocol stack type, the main body of the public-private key pair may also be a KMC. The specific encryption and decryption processing will not be repeated here. As shown in FIG. 10, the protocol stack type negotiation method of the present invention is another embodiment. In this embodiment, the first negotiation device is a KMC, and the second negotiation device is a client device, where the client device unilaterally selects a protocol stack type. Then, the selected protocol stack type is sent to the KMC, and the information transmitted by the protocol stack type is encrypted and decrypted by using the symmetric key, and the random number enhanced encryption and decryption robustness is introduced to ensure the protocol stack type negotiation process information. It has not been tampered with, and its specific processing flow is as follows:
步骤 1001, KMC与客户端设备双方共享对称密钥 Key。  Step 1001: The KMC shares the symmetric key Key with both client devices.
步骤 1002, KMC向客户端设备发送协商请求消息。  Step 1002: The KMC sends a negotiation request message to the client device.
本发明实施例中, 协商请求消息携带有 2部分内容: Contentl , Content2 In the embodiment of the present invention, the negotiation request message carries two parts of content: Contentl, Content2
Contentl 可以仅包含该 KMC 自身支持的所有协议栈类型, 进一步还可以包含 KMC设置的各协议栈类型对应的优先级。 Contentl can contain only all the protocol stack types supported by the KMC itself, and can further include the priority corresponding to each protocol stack type set by the KMC.
Content2为执行加密函数 encryptFunc (KMCRandl , Contentl , Key) 后得到的 密文输出。 其中参数 KMCRandl是 KMC产生的随机数, 它与参数 Contentl同为加 密算法中的明文输入, 参数 Key是步骤 1001中的对称密钥 Key, 在函数 encryptFunc 中作为加密密钥。  Content2 is the ciphertext output obtained after executing the encryption function encryptFunc (KMCRandl , Contentl , Key). The parameter KMCRandl is a random number generated by KMC. It is the same as the parameter Contentl as the plaintext input in the encryption algorithm. The parameter Key is the symmetric key Key in step 1001, and is used as the encryption key in the function encryptFunc.
步骤 1003, 客户端设备确定协商请求消息的合法性。  Step 1003: The client device determines the validity of the negotiation request message.
其中, 客户端设备首先执行解密函数 decryptFunc (步骤 1002携带的 Content2, Key)得到明文输出。其中参数 Key是步骤 1001中的对称密钥 Key,在函数 decryptFunc 中作为解密密钥。 如果解密失败, 说明协商请求消息不合法 (可能已遭篡改), 则终 止协商。如果解密成功,得到 KMCRandl ' , Content 1 ' 。客户端设备再比对 Contentl ' 与步骤 1002中携带的 Contentl , 如果二者不一致, 说明协商请求消息不合法 (可能 已遭篡改), 则终止协商。 如果二者一致, 说明协商请求消息合法, 则继续协商。 The client device first performs a decryption function decryptFunc (Content2, Key carried in step 1002) to obtain a plaintext output. The parameter Key is the symmetric key Key in step 1001 and is used as the decryption key in the function decryptFunc. If the decryption fails, indicating that the negotiation request message is invalid (may have been tampered with), then the end Negotiation. If the decryption is successful, get KMCRandl ' , Content 1 '. The client device compares Contentl ' with Contentl carried in step 1002. If the two are inconsistent, indicating that the negotiation request message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the negotiation request message is valid, continue to negotiate.
步骤 1004, 客户端设备根据协商请求消息所携带的 Contentl中 KMC支持的所 有协议栈类型, 结合该客户端设备自身支持的所有协议栈类型, 确定出 KMC与客户 端设备共同支持的所有协议栈类型。  Step 1004: The client device determines, according to all protocol stack types supported by the KMC in Contentl carried in the negotiation request message, and all protocol stack types supported by the client device, to determine all protocol stack types supported by the KMC and the client device. .
步骤 1005,客户端设备从确定出的 KMC与客户端设备共同支持的所有协议栈类 型中选取一个协议栈类型。  Step 1005: The client device selects a protocol stack type from all protocol stack types supported by the determined KMC and the client device.
其中, 客户端设备可以采取如下任意一种方式选取一个协议栈类型: 从 KMC与 客户端设备共同支持的所有协议栈类型中, 随机选择出一个协议栈类型; 根据客户端 设备预先设置的协议栈类型优先级, 从 KMC与客户端设备共同支持的所有协议栈类 型中, 根据预先设定的策略选择一个协议栈类型, 例如, 预先设定选取一个优先级最 高的协议栈类型, 或预先设定选取一个优先级最低的协议栈类型; 从 KMC与客户端 设备共同支持的所有协议栈类型中, 根据协商请求消息中携带的 KMC预先设置的协 议栈类型优先级, 依照预先设定的策略选择一个协议栈类型, 例如, 预先设定选取一 个优先级最高的协议栈类型, 或预先设定选取一个优先级最低的协议栈类型。  The client device may select a protocol stack type in any of the following ways: From all protocol stack types supported by the KMC and the client device, randomly select a protocol stack type; according to a protocol stack preset by the client device. Type priority, from all protocol stack types supported by the KMC and the client device, select a protocol stack type according to a preset policy, for example, preset a protocol stack type with the highest priority, or preset Select a protocol stack type with the lowest priority; from all the protocol stack types supported by the KMC and the client device, select a protocol stack type priority set by the KMC carried in the negotiation request message, and select one according to a preset policy. The protocol stack type, for example, is preset to select a protocol stack type with the highest priority, or preset to select a protocol stack type with the lowest priority.
步骤 1006, 客户端设备将第一协商响应消息发送给 KMC, 第一协商响应消息中 携带有 2部分内容: Content3, Content4。  Step 1006: The client device sends a first negotiation response message to the KMC, where the first negotiation response message carries two parts: Content3, Content4.
Content3为步骤 1005选取的一个协议栈类型。  Content3 is a protocol stack type selected in step 1005.
Content4为执行加密函数 encryptFunc (随机数组合, Content3 , Key) 得到的密 文输出。其中参数"随机数组合" 可以仅包含步骤 1103中解密得到的 KMCRandl ' , 进一步还可以包含客户端设备生成的随机数 ClientRandl。 两个随机数可通过与 /或 / 连接等方式组合。 "随机数组合"与 Content3同为加密算法中的明文输入, 参数 Key 是步骤 1001中的对称密钥 Key, 在函数 encryptFunc中作为加密密钥。  Content4 is the ciphertext output obtained by executing the encryption function encryptFunc (random number combination, Content3, Key). The parameter "random number combination" may only include the KMCRandl ' decrypted in step 1103, and may further include a random number ClientRandl generated by the client device. Two random numbers can be combined by means of / or / connection. The "random number combination" is the same as the plaintext input in the encryption algorithm, and the parameter Key is the symmetric key Key in step 1001, and is used as the encryption key in the function encryptFunc.
步骤 1007, KMC确定第一协商响应消息的合法性。  Step 1007: The KMC determines the validity of the first negotiation response message.
其中, KMC首先执行解密函数 decryptFunc (步骤 1006携带的 Content4, Key) 得到明文输出。 如果解密失败, 说明第一协商响应消息不合法 (可能已遭篡改), 则 终止协商。 如果解密成功, 得到随机数组合' , Content3 ' 。 KMC再比对 Content3 ' 与步骤 1006中携带的 Content3,如果二者不一致,说明第一协商响应消息不合法(可 能已遭篡改), 则终止协商。 如果二者一致, 说明第一协商响应消息合法, 则选取 Content3中的这个协议栈类型为协商后的协议栈类型。 如图 11所示为本发明协议栈类型协商方法的另一个实施例, 该实施例中第一协 商设备为 KMC, 第二协商设备为客户端设备, 其中由客户端设备和 KMC双方共同 选择协议栈类型, 再由 KMC将最终选择的协议栈类型发送给客户端设备, 同时采用 对称密钥对协议栈类型协商时所传输的信息进行加密和解密处理,并引入随机数增强 加解密健壮性,以确保协议栈类型协商过程信息没有遭到篡改,其具体处理流程如下: 步骤 1101, KMC与客户端设备双方共享对称密钥 Key。 The KMC first performs a decryption function decryptFunc (Content4, Key carried in step 1006) to obtain a plaintext output. If the decryption fails, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get the random number combination ', Content3'. The KMC then compares Content3' with Content3 carried in step 1006. If the two are inconsistent, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the first negotiation response message is valid, the protocol stack type in Content3 is selected as the negotiated protocol stack type. As shown in FIG. 11, another embodiment of the method for negotiating a protocol stack type is the same. In this embodiment, the first negotiation device is a KMC, and the second negotiation device is a client device, where the client device and the KMC jointly select a protocol. The stack type, and then the KMC sends the finally selected protocol stack type to the client device, and uses the symmetric key to encrypt and decrypt the information transmitted during the protocol stack type negotiation, and introduces random number enhancement encryption and decryption robustness. To ensure that the protocol stack negotiation process information has not been tampered with, the specific processing procedure is as follows: Step 1101: The KMC and the client device share the symmetric key Key.
步骤 1102, KMC向客户端设备发送协商请求消息。  Step 1102: The KMC sends a negotiation request message to the client device.
本发明实施例中, 协商请求消息携带有 2部分内容: Contentl , Content2。  In the embodiment of the present invention, the negotiation request message carries two parts of content: Contentl, Content2.
Contentl 可以仅包含该 KMC 自身支持的所有协议栈类型, 进一步还可以包含 KMC设置的各协议栈类型对应的优先级。  Contentl can contain only all the protocol stack types supported by the KMC itself, and can further include the priority corresponding to each protocol stack type set by the KMC.
Content2为执行加密函数 encryptFunc (KMCRandl , Contentl , Key) 后得到的 密文输出。 其中参数 KMCRandl是 KMC产生的随机数, 它与参数 Contentl同为加 密算法中的明文输入, 参数 Key是步骤 1101中的对称密钥 Key, 在函数 encryptFunc 中作为加密密钥。  Content2 is the ciphertext output obtained after executing the encryption function encryptFunc (KMCRandl , Contentl , Key). The parameter KMCRandl is a random number generated by KMC, which is the same as the parameter Contentl as the plaintext input in the encryption algorithm. The parameter Key is the symmetric key Key in step 1101, and is used as the encryption key in the function encryptFunc.
步骤 1103, 客户端确定协商请求消息的合法性。  Step 1103: The client determines the validity of the negotiation request message.
其中, 客户端设备首先执行解密函数 decryptFunc (步骤 1102携带的 Content2, Key)得到明文输出。其中参数 Key是步骤 1101中的对称密钥 Key,在函数 decryptFunc 中作为解密密钥。 如果解密失败, 说明协商请求消息不合法 (可能已遭篡改), 则终 止协商。如果解密成功,得到 KMCRandl ' , Contentl ' 。客户端设备再比对 Contentl ' 与步骤 1102中携带的 Contentl , 如果二者不一致, 说明协商请求消息不合法 (可能 已遭篡改), 则终止协商。 如果二者一致, 说明协商请求消息合法, 则继续协商。  The client device first performs a decryption function decryptFunc (Content2, Key carried in step 1102) to obtain a plaintext output. The parameter Key is the symmetric key Key in step 1101 and is used as the decryption key in the function decryptFunc. If the decryption fails, indicating that the negotiation request message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get KMCRandl ' , Contentl '. The client device then compares Contentl ' with the Contentl carried in step 1102. If the two are inconsistent, indicating that the negotiation request message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the negotiation request message is valid, continue to negotiate.
步骤 1104, 客户端设备根据协商请求消息所携带的 Contentl 中 KMC支持的所 有协议栈类型, 结合该客户端设备自身支持的所有协议栈类型, 选择出 KMC与客户 端设备共同支持的所有协议栈类型。  Step 1104: The client device selects all protocol stack types supported by the KMC and the client device according to all protocol stack types supported by the KMC in the Contentl carried in the negotiation request message, and all protocol stack types supported by the client device. .
步骤 1105, 客户端设备将第一协商响应消息发送给 KMC。  Step 1105: The client device sends a first negotiation response message to the KMC.
本发明实施例中, 第一协商响应消息携带有 2部分内容: Content3, Content4。 Content3可以仅包含 KMC与客户端设备共同支持的所有协议栈类型, 进一步还 可以包含该客户端设备设置的各协议栈类型对应的优先级。  In the embodiment of the present invention, the first negotiation response message carries two parts of content: Content3, Content4. Content3 can contain only all protocol stack types supported by the KMC and the client device, and can further include the priority corresponding to each protocol stack type set by the client device.
Content4为执行加密函数 encryptFunc (随机数组合, Content3, Key) 后得到的 密文输出。其中参数"随机数组合"可以仅包含步骤 1103中解密得到的 KMCRandl ' , 进一步还可以包含客户端设备产生的随机数 ClientRandl。 两个随机数可通过与 /或 / 连接等方式组合。 "随机数组合"与 Content3同为加密算法中的明文输入, 参数 Key 是步骤 1101中的对称密钥 Key, 在函数 encryptFunc中作为加密密钥。 Content4 is the ciphertext output obtained after executing the encryption function encryptFunc (random number combination, Content3, Key). The parameter "random number combination" may include only the KMCRandl ' decrypted in step 1103, and may further include a random number ClientRand1 generated by the client device. Two random numbers can pass and / or / A combination of connections and the like. The "random number combination" is the same as the plaintext input in the encryption algorithm, and the parameter Key is the symmetric key Key in step 1101, and is used as the encryption key in the function encryptFunc.
此外, 第一协商响应消息中 Content3 也可以仅携带有客户端设备支持的所有协 议栈类型, 后续可以由 KMC根据第一协商响应消息所携带的客户端设备支持的所有 协议栈类型, 结合该 KMC自身支持的所有协议栈类型, 选择出 KMC与客户端设备 共同支持的所有协议栈类型, 第一协商响应消息中 Content3 进一步还可以携带有客 户端设备设置的各协议栈类型对应的优先级。 In addition, the Cont en t3 in the first negotiation response message may also carry only all protocol stack types supported by the client device, and may be combined by the KMC according to all protocol stack types supported by the client device carried by the first negotiation response message. The protocol stack type supported by the KMC itself is selected by the protocol stack type supported by the KMC and the client device. The Cont en t3 in the first negotiation response message may further carry the protocol stack type corresponding to the client device. priority.
其中, KMC与客户端设备共同支持的协议栈类型可以只有一个, 也可以有多个, 当 KMC与客户端设备共同支持的协议栈类型大于一个时, KMC还可以从 KMC与客 户端设备共同支持的所有协议栈类型中, 预先选择出一个协议栈类型, 后续 KMC在 与该客户端设备进行 KMIP会话时,使用选择出的该协议栈类型与该客户端设备进行 KMIP会话, 因此, 本发明实施例还包括多个可选步骤, 如下步骤 1107, 步骤 1108 和步骤 1109。  The KMC and the client device can support only one protocol type or multiple. When the KMC and the client device support more than one protocol stack type, the KMC can also support the KMC and the client device. In all the protocol stack types, a protocol stack type is pre-selected, and the subsequent KMC performs a KMIP session with the client device by using the selected protocol stack type when performing a KMIP session with the client device. Therefore, the present invention implements The example also includes a plurality of optional steps, as follows, step 1107, step 1108, and step 1109.
步骤 1106, KMC确定第一协商响应消息的合法性。  Step 1106: The KMC determines the validity of the first negotiation response message.
其中, KMC首先执行解密函数 decryptFunc (步骤 1105携带的 Content4, Key ) 得到明文输出。 如果解密失败, 说明第一协商响应消息不合法 (可能已遭篡改), 则 终止协商。 如果解密成功, 得到随机数组合' , Content3 ' 。 KMC再比对 Content3 ' 与步骤 1105中携带的 Content3,如果二者不一致,说明第一协商响应消息不合法(可 能已遭篡改), 则终止协商。 如果二者一致, 说明第一协商响应消息合法, 则继续协 商。  The KMC first performs the decryption function decryptFunc (Content4, Key carried in step 1105) to obtain the plaintext output. If the decryption fails, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get the random number combination ', Content3'. The KMC then compares Content3' with the Content3 carried in step 1105. If the two are inconsistent, indicating that the first negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the first negotiation response message is valid, continue to negotiate.
步骤 1107, KMC从第一协商响应消息所携带的 KMC与客户端设备共同支持的 所有协议栈类型中, 选择一个协议栈类型。  Step 1107: The KMC selects a protocol stack type from all protocol stack types supported by the KMC and the client device carried by the first negotiation response message.
其中, KMC 在选择协议栈类型时, 可以采用如下任意一种选取方式: 从 KMC 与客户端设备共同支持的所有协议栈类型中,随机选择出一个协议栈类型;根据 KMC 预先设置的协议栈类型优先级,从 KMC与客户端设备共同支持的所有协议栈类型中, 根据预先设定的策略选择出一个协议栈类型,例如, 预先设定选取一个优先级最高的 协议栈类型, 或预先设定选取一个优先级最低的协议栈类型; 根据接收到的第一协商 响应消息中携带的由客户端设备预先设定的协议栈类型优先级, 从 KMC与客户端设 备共同支持的所有协议栈类型中, 根据预先设定的策略选择一个协议栈类型, 例如, 预先设定选取一个优先级最高的协议栈类型,或预先设定选取一个优先级最低的协议 栈类型。 步骤 1108, KMC将第二协商响应消息发送给客户端设备, 第二协商响应消息中 携带有 2部分内容: Content5, Content6。 When the KMC selects the protocol stack type, it can adopt any of the following selection methods: From the protocol stack types supported by the KMC and the client device, a protocol stack type is randomly selected; according to the protocol stack type preset by the KMC Priority, from all the protocol stack types supported by the KMC and the client device, select a protocol stack type according to a preset policy, for example, preset a protocol stack type with the highest priority, or preset Selecting a protocol stack type with the lowest priority; according to the protocol stack type priority preset by the client device carried in the received first negotiation response message, from all protocol stack types supported by the KMC and the client device Select a protocol stack type according to a preset policy, for example, pre-set to select a protocol stack type with the highest priority, or pre-set to select a protocol stack type with the lowest priority. Step 1108: The KMC sends a second negotiation response message to the client device, where the second negotiation response message carries two parts: Content5, Content6.
Content5为步骤 1107选取的一个协议栈类型。  Content5 is a protocol stack type selected in step 1107.
Content6为执行加密函数 encryptFunc (随机数组合, Content5, Key) 得到的密 文输出。 其中参数 "随机数组合" 中可仅包含协商请求消息中的 KMCRandl, 也可 以仅包含 KMC 重新生成的随机数 KMCRand2, 进一步还可以包含步骤 1105 中 Content4中由客户端设备生成的随机数 ClientRandl。两个随机数可通过与 /或 /连接等 方式组合。 "随机数组合 "与 Content5同为加密算法中的明文输入, 参数 Key是步骤 1101中的对称密钥 Key, 在函数 encryptFunc中作为加密密钥。 Content6 is the ciphertext output obtained by executing the encryption function encryptFunc (random number combination, Content5, Key). The parameter "random number combination" may include only the KMCRand1 in the negotiation request message, or only the KMC regenerated KMCRand2, and may further include the random number ClientRand1 generated by the client device in Content1 in step 1105. Two random numbers can be combined by means of / or / connection. The "random number combination" and Cont en t5 are the plaintext input in the encryption algorithm, and the parameter Key is the symmetric key Key in step 1101, and is used as the encryption key in the function encryptFunc.
步骤 1109, 客户端设备确定第二协商响应消息的合法性。  Step 1109: The client device determines validity of the second negotiation response message.
其中, 客户端设备首先执行解密函数 decryptFunc (步骤 1108携带的 Content6, Key)得到明文输出。如果解密失败,说明第二协商响应消息不合法(可能已遭篡改), 则终止协商。 如果解密成功, 得到随机数组合' , Contents' 。 客户端设备再比对 Contents ' 与步骤 1108中携带的 Content5,如果二者不一致,说明第二协商响应消息 不合法(可能已遭篡改), 则终止协商。 如果二者一致, 说明第二协商响应消息合法, 则选取 Contents 中的这个协议栈类型为协商后的协议栈类型。 后续该客户端设备在 与 KMC进行 KMIP会话时, 可以使用第二协商响应消息中所携带的该协议栈类型与 该 KMC进行 KMIP会话。 与本发明协议栈类型协商方法的实施例相对应,本发明还提供了协议栈类型协商 装置的实施例。  The client device first performs a decryption function decryptFunc (Content6, Key carried in step 1108) to obtain a plaintext output. If the decryption fails, indicating that the second negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the decryption is successful, get the random number combination ', Contents'. The client device compares the Contents ' with the Content5 carried in step 1108. If the two are inconsistent, indicating that the second negotiation response message is invalid (may have been tampered with), the negotiation is terminated. If the two are consistent, indicating that the second negotiation response message is valid, the protocol stack type in Contents is selected as the negotiated protocol stack type. The client device may perform a KMIP session with the KMC by using the protocol stack type carried in the second negotiation response message when performing a KMIP session with the KMC. Corresponding to the embodiment of the protocol stack type negotiation method of the present invention, the present invention also provides an embodiment of the protocol stack type negotiation apparatus.
如图 12所示为本发明协议栈类型协商装置的一个实施例, 所述装置设置于与第 二协商设备进行协议栈类型协商的第一协商设备中, 包括:  An embodiment of the protocol stack type negotiation device of the present invention is shown in FIG. 12, where the device is configured in a first negotiation device that performs protocol stack type negotiation with the second negotiation device, and includes:
协商请求消息发送单元 1201, 用于向第二协商设备发送协商请求消息, 所述协 商请求消息中携带有所述第一协商设备支持的协议栈类型,以使所述第二协商设备根 据所述协商请求消息中携带的所述第一协商设备支持的协议栈类型,选取所述第二协 商设备与所述第一协商设备共同支持的协议栈类型;  The negotiation request message sending unit 1201 is configured to send a negotiation request message to the second negotiation device, where the negotiation request message carries the protocol stack type supported by the first negotiation device, so that the second negotiation device is configured according to the Selecting a protocol stack type supported by the first negotiation device that is carried in the negotiation request message, and selecting a protocol stack type supported by the second negotiation device and the first negotiation device;
第一协商响应消息接收单元 1202, 用于接收所述第二协商设备根据所述协商请 求消息发送单元 1201发送的协商请求消息反馈的第一协商响应消息;  The first negotiation response message receiving unit 1202 is configured to receive a first negotiation response message that is sent by the second negotiation device according to the negotiation request message sent by the negotiation request message sending unit 1201;
协议栈类型获得单元 1203, 用于根据所述第一协商响应消息接收单元 1202接收 的第一协商响应消息,获得所述第二协商设备与所述第一协商设备共同支持的协议栈 类型。 The protocol stack type obtaining unit 1203 is configured to obtain, according to the first negotiation response message received by the first negotiation response message receiving unit 1202, a protocol stack supported by the second negotiation device and the first negotiation device. Types of.
采用本发明实施例所提供的协议栈类型协商装置, 客户端设备在与 KMC 进行 KMIP会话之前, 不是随意选择协议栈类型来进行 KMIP会话, 而是一方作为第一协 商设备, 另一方作为第二协商设备,先通过设置于第一协商设备内的协议栈类型协商 装置中的协商请求消息发送单元 1201 向第二协商设备发送携带有第一协商设备支持 的协议栈类型的协商请求消息, 然后由第一协商响应消息接收单元 1202接收第二协 商设备反馈的第一协商响应消息, 再由协议栈类型获得单元 1203通过第一协商响应 消息, 获得第二协商设备与第一协商设备共同支持的协议栈类型, 即获得 KMC与客 户端设备共同支持的协议栈类型。 由上可见, 本发明实施例中, 第一协商设备与第二 协商设备协商好的协议栈类型为第二协商设备与第一协商设备共同支持的协议栈类 型, 因此, 后续当 KMC与客户端设备进行 KMIP会话时, 双方所采用的协议栈类型 是 KMC与客户端设备共同支持的协议栈类型, 因此 KMC与客户端设备均能够对接 收到的 KMIP消息进行正确解析; 并且, 客户端设备和 KMC之间通过自动协商, 选 择协议栈类型, 因此不需要手动配置, 便于维护。  With the protocol stack type negotiation device provided by the embodiment of the present invention, before the KMIP session with the KMC, the client device does not randomly select the protocol stack type to perform the KMIP session, but one party serves as the first negotiation device, and the other party acts as the second. The negotiation device sends a negotiation request message carrying the protocol stack type supported by the first negotiation device to the second negotiation device through the negotiation request message sending unit 1201 in the protocol stack type negotiation device, which is set in the first negotiation device, and then The first negotiation response message receiving unit 1202 receives the first negotiation response message fed back by the second negotiation device, and the protocol stack type obtaining unit 1203 obtains the protocol supported by the second negotiation device and the first negotiation device by using the first negotiation response message. The stack type, that is, the type of protocol stack that is supported by the KMC and the client device. It can be seen that, in the embodiment of the present invention, the protocol stack type negotiated by the first negotiation device and the second negotiation device is a protocol stack type supported by the second negotiation device and the first negotiation device, and therefore, the KMC and the client are subsequently When the device performs a KMIP session, the protocol stack type used by the two parties is the protocol stack type supported by the KMC and the client device. Therefore, both the KMC and the client device can correctly parse the received KMIP message; and, the client device and The KMC chooses the protocol stack type through auto-negotiation, so it does not need to be manually configured for easy maintenance.
在上述本发明协议栈类型协商装置的一个具体的实施例中,所述第一协商响应消 息接收单元 1202所接收的第一协商响应消息中携带第二协商设备确定的双方共同支 持至少一个协议栈类型;  In a specific embodiment of the foregoing protocol stack type negotiation apparatus of the present invention, the first negotiation response message received by the first negotiation response message receiving unit 1202 carries the second negotiation device and the two parties jointly support at least one protocol stack. Types of;
所述协议栈类型获得单元 1203 具体用于: 从所述第一协商响应消息接收单元 1202 所接收的第一协商响应消息中, 选择一个所述第二协商设备与所述第一协商设 备共同支持的协议栈类型。  The protocol stack type obtaining unit 1203 is specifically configured to: select, from the first negotiation response message received by the first negotiation response message receiving unit 1202, one of the second negotiation device and the first negotiation device to support Protocol stack type.
可选地, 在上述具体的实施例中, 所述第一协商响应消息接收单元 1202所接收 的第一协商响应消息中还携带所述第二协商设备预先设置的协议栈类型优先级; 所述协议栈类型获得单元 1203具体用于: 根据所述第二协商设备预先设置的协 议栈类型优先级, 从所述第一协商响应消息接收单元 1202所接收的第一协商响应消 息中携带的所述第二协商设备确定的双方共同支持的至少一个协议栈类型,选择一个 所述第二协商设备与所述第一协商设备共同支持的协议栈类型。  Optionally, in the foregoing specific embodiment, the first negotiation response message received by the first negotiation response message receiving unit 1202 further carries a protocol stack type priority preset by the second negotiation device; The protocol stack type obtaining unit 1203 is specifically configured to: according to the protocol stack type priority set by the second negotiation device, the first negotiation response message received by the first negotiation response message receiving unit 1202 At least one protocol stack type supported by the two parties determined by the second negotiation device, and a protocol stack type supported by the second negotiation device and the first negotiation device is selected.
在上述本发明协议栈类型协商装置的另一个具体的实施例中,所述协商请求消息 发送单元 1201所发送的协商请求消息还携带所述第一协商设备预先设置的协议栈类 型优先级;  In another specific embodiment of the foregoing protocol stack type negotiation apparatus of the present invention, the negotiation request message sent by the negotiation request message sending unit 1201 further carries a protocol stack type priority set in advance by the first negotiation device;
所述第一协商响应消息接收单元 1202所接收的第一协商响应消息携带所述第二 协商设备选取的双方共同支持的一个协议栈类型,其中,所述双方共同支持的一个协 议栈类型为所述第二协商设备根据所述协商请求消息发送单元 1201所发送的协商请 求消息中携带的所述第一协商设备支持的协议栈类型和所述第一协商设备预先设置 的协议栈类型优先级,选取的一个所述第二协商设备与所述第一协商设备共同支持的 协议栈类型。 The first negotiation response message received by the first negotiation response message receiving unit 1202 carries a protocol stack type supported by the two parties selected by the second negotiation device, where the two parties jointly support one protocol. The stack type is a protocol stack type supported by the first negotiation device and a protocol preset by the first negotiation device, which are carried by the second negotiation device according to the negotiation request message sent by the negotiation request message sending unit 1201. The stack type priority, the selected one of the protocol stack types supported by the second negotiation device and the first negotiation device.
在上述本发明协议栈类型协商装置的另一个具体的实施例中,所述第一协商响应 消息接收单元 1202所接收的第一协商响应消息中携带所述第二协商设备支持的协议 栈类型;  In another specific embodiment of the protocol stack type negotiation apparatus of the present invention, the first negotiation response message received by the first negotiation response message receiving unit 1202 carries the protocol stack type supported by the second negotiation device;
所述协议栈类型获得单元 1203具体用于: 根据所述第一协商响应消息接收单元 1202 接收的第一协商响应消息中携带的所述第二协商设备支持的协议栈类型, 选取 所述第二协商设备与所述第一协商设备共同支持的协议栈类型。  The protocol stack type obtaining unit 1203 is specifically configured to: select, according to the protocol stack type supported by the second negotiation device, in the first negotiation response message received by the first negotiation response message receiving unit 1202, Negotiating the type of protocol stack supported by the device and the first negotiation device.
可选地, 在上述具体的实施例中, 所述第一协商响应消息接收单元 1202所接收 的第一协商响应消息还携带所述第二协商设备预先设置的协议栈类型优先级;  Optionally, in the foregoing specific embodiment, the first negotiation response message received by the first negotiation response message receiving unit 1202 further carries a protocol stack type priority preset by the second negotiation device;
所述协议栈类型获得单元 1203具体用于: 根据所述第一协商响应消息接收单元 1202 所接收的第一协商响应消息中携带的所述第二协商设备预先设置的协议栈类型 优先级以及所述第二协商设备支持的协议栈类型,确定一个所述第二协商设备与所述 第一协商设备共同支持的协议栈类型。 如图 13所示为本发明协议栈类型协商装置的另一个实施例, 所述装置设置于与 第二协商设备进行协议栈类型协商的第一协商设备中, 包括:  The protocol stack type obtaining unit 1203 is specifically configured to: prior to the protocol stack type priority set by the second negotiation device carried in the first negotiation response message received by the first negotiation response message receiving unit 1202, Determining a protocol stack type supported by the second negotiation device, and determining a protocol stack type supported by the second negotiation device and the first negotiation device. As shown in FIG. 13 is another embodiment of the protocol stack type negotiation device of the present invention. The device is configured in a first negotiation device that performs protocol stack type negotiation with the second negotiation device, and includes:
协商请求消息发送单元 1301, 用于向第二协商设备发送协商请求消息, 所述协 商请求消息中携带有所述第一协商设备支持的协议栈类型;  The negotiation request message sending unit 1301 is configured to send a negotiation request message to the second negotiation device, where the negotiation request message carries the protocol stack type supported by the first negotiation device;
第一协商响应消息接收单元 1302, 用于接收所述第二协商设备根据所述协商请 求消息发送单元 1301所发送的协商请求消息反馈的第一协商响应消息;  The first negotiation response message receiving unit 1302 is configured to receive a first negotiation response message that is sent by the second negotiation device according to the negotiation request message sent by the negotiation request message sending unit 1301;
协议栈类型获得单元 1303, 用于根据所述第一协商响应消息接收单元 1302所接 收的第一协商响应消息,获得所述第二协商设备与所述第一协商设备共同支持的协议 栈类型;  a protocol stack type obtaining unit 1303, configured to obtain, according to the first negotiation response message received by the first negotiation response message receiving unit 1302, a protocol stack type supported by the second negotiation device and the first negotiation device;
第二协商响应消息发送单元 1304, 用于向所述第二协商设备发送第二协商响应 消息,所述第二协商响应消息中携带第一协商设备最终选取的双方共同支持的一个协 议栈类型。 如图 14所示为本发明协议栈类型协商装置的另一个实施例, 所述装置设置于与 第二协商设备进行协议栈类型协商的第一协商设备中, 包括: The second negotiation response message sending unit 1304 is configured to send a second negotiation response message to the second negotiation device, where the second negotiation response message carries a protocol stack type commonly supported by the two parties selected by the first negotiation device. FIG. 14 is another embodiment of a protocol stack type negotiation apparatus according to the present invention, where the apparatus is disposed in The first negotiation device that negotiates the protocol stack type by the second negotiation device includes:
密钥交互单元 1401, 用于在协商请求消息发送单元 1402向第二协商设备发送协 商请求消息之前, 与所述第二协商设备之间交互密钥信息, 以使所述第一协商设备与 所述第二协商设备根据所述密钥信息采用公私钥加解密机制进行协议栈类型协商; 协商请求消息发送单元 1402, 用于向第二协商设备发送根据所述密钥交互单元 The key interaction unit 1401 is configured to exchange key information with the second negotiation device before the negotiation request message sending unit 1402 sends the negotiation request message to the second negotiation device, so that the first negotiation device and the device The second negotiation device uses the public-private key encryption and decryption mechanism to perform protocol stack type negotiation according to the key information. The negotiation request message sending unit 1402 is configured to send, according to the key interaction unit, the second negotiation device.
1401 交互的密钥信息加密后的所述协商请求消息, 所述协商请求消息中携带有所述 第一协商设备支持的协议栈类型; The negotiation request message after the encrypted key information is encrypted, where the negotiation request message carries the protocol stack type supported by the first negotiation device;
第一协商响应消息接收单元 1403, 用于接收所述第二协商设备根据所述协商请 求消息反馈的加密后的第一协商响应消息, 以及根据所述密钥交互单元 1401交互的 密钥信息对所述加密后的第一协商响应消息进行解密, 得到第一协商响应消息; 协议栈类型获得单元 1404, 用于根据所述第一协商响应消息接收单元 1403所接 收的第一协商响应消息,获得所述第二协商设备与所述第一协商设备共同支持的协议 栈类型。  The first negotiation response message receiving unit 1403 is configured to receive the encrypted first negotiation response message that is fed back by the second negotiation device according to the negotiation request message, and the key information pair that is exchanged according to the key interaction unit 1401. Decrypting the encrypted first negotiation response message to obtain a first negotiation response message; the protocol stack type obtaining unit 1404 is configured to obtain, according to the first negotiation response message received by the first negotiation response message receiving unit 1403, The protocol stack type supported by the second negotiation device and the first negotiation device.
在上述密钥交互单元 1401的一个实施例中, 密钥交互单元 1401具体包括: 密钥设置子单元, 用于在所述协商请求消息发送单元 1402向第二协商设备发送 协商请求消息之前, 预先设置第一协商设备私钥和第一协商设备公钥;  In an embodiment of the key interaction unit 1401, the key interaction unit 1401 specifically includes: a key setting subunit, configured to advance the negotiation request message sending unit 1402 before sending the negotiation request message to the second negotiation device. Setting a first negotiation device private key and a first negotiation device public key;
私钥存储子单元, 用于存储所述密钥设置子单元所设置的第一协商设备私钥; 公钥发送子单元,用于将所述密钥设置子单元所设置的第一协商设备公钥发送给 所述第二协商设备;  a private key storage sub-unit, configured to store a first negotiation device private key set by the key setting sub-unit; a public key sending sub-unit, configured to set the first negotiation device set by the key setting sub-unit Sending a key to the second negotiation device;
所述协商请求消息发送单元 1402, 具体用于向第二协商设备发送经过所述私钥 存储子单元所存储的第一协商设备私钥加密后的所述协商请求消息,所述协商请求消 息中携带有所述第一协商设备支持的所有协议栈类型;  The negotiation request message sending unit 1402 is specifically configured to send, to the second negotiation device, the negotiation request message that is encrypted by the first negotiation device private key stored by the private key storage subunit, where the negotiation request message is included. Carrying all protocol stack types supported by the first negotiation device;
所述第一协商响应消息接收单元 1403, 具体用于接收所述第二协商设备根据所 述协商请求消息反馈的经过所述公钥发送子单元所发送的第一协商设备公钥加密后 的第一协商响应消息,所述第一协商响应消息中携带有所述第二协商设备支持的协议 栈类型,以及利用所述私钥存储子单元所存储的第一协商设备私钥对所述加密后的第 一协商响应消息进行解密, 得到第一协商响应消息。  The first negotiation response message receiving unit 1403 is configured to receive, after the second negotiation device encrypts, the first negotiation device public key that is sent by the public key sending subunit, according to the negotiation request message, a negotiation response message, the first negotiation response message carries a protocol stack type supported by the second negotiation device, and the first negotiation device private key stored by the private key storage subunit is used to encrypt the The first negotiation response message is decrypted to obtain a first negotiation response message.
在上述密钥交互单元 1401的另一个实施例中, 密钥交互单元 1401具体用于: 在 协商请求消息发送单元 1402向第二协商设备发送协商请求消息之前, 获得所述第二 协商设备预先设置的第二协商设备公钥。  In another embodiment of the key interaction unit 1401, the key interaction unit 1401 is specifically configured to: before the negotiation request message sending unit 1402 sends a negotiation request message to the second negotiation device, obtain the second negotiation device to preset The second negotiated device public key.
所述协商请求消息发送单元 1402, 具体用于从所述密钥交互单元 1401获取所述 第二协商设备公钥,以及向第二协商设备发送经过所述第二协商设备公钥加密后的所 述协商请求消息,所述协商请求消息中携带有所述第一协商设备支持的所有协议栈类 型; The negotiation request message sending unit 1402 is specifically configured to acquire the information from the key interaction unit 1401. The second negotiation device public key, and the negotiation request message that is encrypted by the second negotiation device public key is sent to the second negotiation device, where the negotiation request message carries all the protocols supported by the first negotiation device. Stack type
所述第一协商响应消息接收单元 1403, 具体用于接收所述第二协商设备根据所 述协商请求消息反馈的经过第二协商设备私钥加密后的第一协商响应消息,所述第一 协商响应消息中携带有所述第二协商设备支持的协议栈类型,以及利用所述密钥交互 单元 1401获取的所述第二协商设备公钥, 对所述加密后的第一协商响应消息进行解 密, 得到第一协商响应消息。 如图 15所示为本发明协议栈类型协商装置的另一个实施例, 所述装置设置于与 第二协商设备进行协议栈类型协商的第一协商设备中, 包括:  The first negotiation response message receiving unit 1403 is configured to receive, by the second negotiation device, a first negotiation response message that is encrypted by the second negotiation device private key, which is fed back according to the negotiation request message, the first negotiation The response message carries the protocol stack type supported by the second negotiation device, and decrypts the encrypted first negotiation response message by using the second negotiation device public key acquired by the key interaction unit 1401. , get the first negotiation response message. As shown in FIG. 15, another embodiment of the protocol stack type negotiation apparatus of the present invention is provided, where the apparatus is configured in a first negotiation device that performs protocol stack type negotiation with the second negotiation device, and includes:
密钥共享单元 1501, 用于与所述第二协商设备共享对称密钥;  a key sharing unit 1501, configured to share a symmetric key with the second negotiation device;
加密单元 1502, 用于所述第一协商设备在向第二协商设备发送消息之前, 根据 所述密钥共享单元 1501所共享的对称密钥和获得的随机数对发送给所述第二协商设 备的消息进行加密, 得到消息密文;  The encryption unit 1502 is configured to send, by the first negotiation device, the symmetric key shared by the key sharing unit 1501 and the obtained random number pair to the second negotiation device before sending the message to the second negotiation device. The message is encrypted to obtain a message ciphertext;
协商请求消息发送单元 1503, 用于向第二协商设备发送协商请求消息, 所述协 商请求消息中携带有所述第一协商设备支持的协议栈类型,以使所述第二协商设备根 据所述协商请求消息中携带的所述第一协商设备支持的协议栈类型,选取所述第二协 商设备与所述第一协商设备共同支持的协议栈类型;  The negotiation request message sending unit 1503 is configured to send a negotiation request message to the second negotiation device, where the negotiation request message carries the protocol stack type supported by the first negotiation device, so that the second negotiation device is configured according to the Selecting a protocol stack type supported by the first negotiation device that is carried in the negotiation request message, and selecting a protocol stack type supported by the second negotiation device and the first negotiation device;
密文发送单元 1504, 用于在发送所述消息时同时发送所述加密单元 1502得到的 消息密文, 以使所述第二协商设备对接收到的所述消息密文进行解密得到消息明文, 将所述消息明文与接收到的消息进行比较, 当比较结果相同时, 继续进行协议栈类型 协商;  The ciphertext sending unit 1504 is configured to send the message ciphertext obtained by the encryption unit 1502 at the same time when the message is sent, so that the second negotiation device decrypts the received message ciphertext to obtain a message plaintext. Comparing the plaintext of the message with the received message, and continuing the protocol stack type negotiation when the comparison result is the same;
第一协商响应消息接收单元 1505, 用于接收所述第二协商设备根据所述协商请 求消息发送单元 1503发送的协商请求消息反馈的第一协商响应消息;  The first negotiation response message receiving unit 1505 is configured to receive a first negotiation response message that is sent by the second negotiation device according to the negotiation request message sent by the negotiation request message sending unit 1503.
解密单元 1506, 用于所述第一协商设备接收到第二协商设备在发送消息的同时 发送的消息密文后, 根据所述密钥共享单元 1501所共享的对称密钥对所述消息密文 进行解密, 得到消息明文, 其中, 所述消息密文为所述第二协商设备根据所述对称密 钥和获得的随机数对发送给所述第一协商设备的消息进行加密, 所得到的消息密文; 比较单元 1507, 用于将所述解密单元 1506得到的消息明文与接收到的消息进行 比较, 当比较结果相同时, 继续进行协议栈类型协商; 协议栈类型获得单元 1508, 用于根据所述第一协商响应消息接收单元 1505接收 的第一协商响应消息,获得所述第二协商设备与所述第一协商设备共同支持的协议栈 类型。 如图 16所示为本发明协议栈类型协商装置的另一个实施例, 所述装置设置于与 第一协商设备进行协议栈类型协商的第二协商设备中, 包括: The decryption unit 1506 is configured to: after the first negotiation device receives the message ciphertext sent by the second negotiation device while sending the message, pair the message ciphertext according to the symmetric key shared by the key sharing unit 1501 Decrypting, obtaining a message plaintext, wherein the message ciphertext is that the second negotiation device encrypts the message sent to the first negotiation device according to the symmetric key and the obtained random number, and the obtained message is obtained. The ciphertext comparison unit 1507 is configured to compare the message plaintext obtained by the decryption unit 1506 with the received message, and continue to perform protocol stack type negotiation when the comparison result is the same; The protocol stack type obtaining unit 1508 is configured to obtain, according to the first negotiation response message received by the first negotiation response message receiving unit 1505, a protocol stack type supported by the second negotiation device and the first negotiation device. As shown in FIG. 16 is another embodiment of the protocol stack type negotiation device of the present invention. The device is configured in a second negotiation device that performs protocol stack type negotiation with the first negotiation device, and includes:
协商请求消息接收单元 1601, 用于接收第一协商设备发送的协商请求消息, 所 述协商请求消息中携带有所述第一协商设备支持的协议栈类型;  The negotiation request message receiving unit 1601 is configured to receive a negotiation request message sent by the first negotiation device, where the negotiation request message carries a protocol stack type supported by the first negotiation device;
协议栈类型获得单元 1602, 用于根据所述协商请求消息接收单元 1601所接收的 协商请求消息中携带的所述第一协商设备支持的协议栈类型,选取所述第二协商设备 与所述第一协商设备共同支持的协议栈类型;  The protocol stack type obtaining unit 1602 is configured to select, according to the protocol stack type supported by the first negotiation device that is carried in the negotiation request message received by the negotiation request message receiving unit 1601, the second negotiation device and the first a protocol stack type that is commonly supported by the negotiation device;
第一协商响应消息发送单元 1603, 用于根据所述协商请求消息接收单元 1601接 收的协商请求消息向所述第一协商设备反馈第一协商响应消息,以使所述第一协商设 备根据所述第一协商响应消息,获得所述第二协商设备与所述第一协商设备共同支持 的协议栈类型。  The first negotiation response message sending unit 1603 is configured to feed back a first negotiation response message to the first negotiation device according to the negotiation request message received by the negotiation request message receiving unit 1601, so that the first negotiation device is configured according to the The first negotiation response message obtains a protocol stack type supported by the second negotiation device and the first negotiation device.
在本发明上述协议栈类型协商装置的一个具体的实施例中,所述第一协商响应消 息发送单元 1603所发送的第一协商响应消息中携带所述第二协商设备支持的协议栈 类型,以使所述第一协商设备根据所述第一协商响应消息中携带的所述第二协商设备 支持的协议栈类型,选取所述第二协商设备与所述第一协商设备共同支持的协议栈类 型。  In a specific embodiment of the protocol stack type negotiation apparatus of the present invention, the first negotiation response message sent by the first negotiation response message sending unit 1603 carries the protocol stack type supported by the second negotiation device, And causing the first negotiation device to select a protocol stack type supported by the second negotiation device and the first negotiation device according to the protocol stack type supported by the second negotiation device that is carried in the first negotiation response message .
可选地, 在上述具体的实施例中, 所述第一协商响应消息发送单元 1603所发送 的第一协商响应消息还携带所述第二协商设备预先设置的协议栈类型优先级,以使所 述第一协商设备根据所述第一协商响应消息中携带的所述第二协商设备预先设置的 协议栈类型优先级以及所述第二协商设备支持的协议栈类型,确定一个所述第二协商 设备与所述第一协商设备共同支持的协议栈类型。 如图 17所示为本发明协议栈类型协商装置的另一个实施例, 所述装置设置于与 第一协商设备进行协议栈类型协商的第二协商设备中, 包括:  Optionally, in the foregoing specific embodiment, the first negotiation response message sent by the first negotiation response message sending unit 1603 further carries a protocol stack type priority preset by the second negotiation device, so that Determining, by the first negotiation device, a second negotiation according to a protocol stack type priority preset by the second negotiation device and a protocol stack type supported by the second negotiation device, which are carried in the first negotiation response message. The type of protocol stack supported by the device and the first negotiation device. As shown in FIG. 17, another embodiment of the protocol stack type negotiation apparatus of the present invention is provided, where the apparatus is disposed in a second negotiation device that performs protocol stack type negotiation with the first negotiation device, and includes:
协商请求消息接收单元 1701, 用于接收第一协商设备发送的协商请求消息, 所 述协商请求消息中携带有所述第一协商设备支持的协议栈类型;  The negotiation request message receiving unit 1701 is configured to receive a negotiation request message sent by the first negotiation device, where the negotiation request message carries a protocol stack type supported by the first negotiation device;
协议栈类型获得单元 1702, 用于根据所述协商请求消息接收单元 1701所接收的 协商请求消息中携带的所述第一协商设备支持的协议栈类型,选取所述第二协商设备 与所述第一协商设备共同支持的协议栈类型; a protocol stack type obtaining unit 1702, configured to receive according to the negotiation request message receiving unit 1701 Selecting a protocol stack type supported by the first negotiation device that is carried in the negotiation request message, and selecting a protocol stack type supported by the second negotiation device and the first negotiation device;
协议栈类型确定单元 1703, 用于确定双方共同支持的至少一个协议栈类型; 第一协商响应消息发送单元 1704, 用于根据所述协商请求消息接收单元 1701接 收的协商请求消息向所述第一协商设备反馈第一协商响应消息,所述第一协商响应消 息中携带有所述协议栈类型确定单元 1703所确定出的双方共同支持的至少一个协议 栈类型, 以使所述第一协商设备从所述第一协商响应消息中,选择一个所述第二协商 设备与所述第一协商设备共同支持的协议栈类型。  The protocol stack type determining unit 1703 is configured to determine at least one protocol stack type that is supported by the two parties. The first negotiation response message sending unit 1704 is configured to send, according to the negotiation request message received by the negotiation request message receiving unit 1701, the first The negotiation device feeds back a first negotiation response message, where the first negotiation response message carries at least one protocol stack type that is jointly supported by the protocol stack type determining unit 1703, so that the first negotiation device is In the first negotiation response message, a protocol stack type supported by the second negotiation device and the first negotiation device is selected.
在上述本发明协议栈类型协商装置的一个具体的实施例中,所述第一协商响应消 息发送单元 1704所发送的第一协商响应消息中还携带所述第二协商设备预先设置的 协议栈类型优先级,以使所述第一协商设备根据所述第二协商设备预先设置的协议栈 类型优先级,从所述第一协商响应消息中携带的所述第二协商设备确定的双方共同支 持的至少一个协议栈类型,选择一个所述第二协商设备与所述第一协商设备共同支持 的协议栈类型。 如图 18所示为本发明协议栈类型协商装置的另一个实施例, 所述装置设置于与 第一协商设备进行协议栈类型协商的第二协商设备中, 包括:  In a specific embodiment of the protocol stack type negotiation apparatus of the present invention, the first negotiation response message sent by the first negotiation response message sending unit 1704 further carries a protocol stack type preset by the second negotiation device. a priority level, so that the first negotiation device supports the two mutually agreed by the second negotiation device that is carried in the first negotiation response message according to the protocol stack type priority set by the second negotiation device. At least one protocol stack type, selecting a protocol stack type supported by the second negotiation device and the first negotiation device. As shown in FIG. 18, another embodiment of the protocol stack type negotiation device of the present invention is provided. The device is configured in a second negotiation device that performs protocol stack type negotiation with the first negotiation device, and includes:
协商请求消息接收单元 1801, 用于接收第一协商设备发送的协商请求消息, 所 述协商请求消息中携带有所述第一协商设备支持的协议栈类型和所述第一协商设备 预先设置的协议栈类型优先级;  The negotiation request message receiving unit 1801 is configured to receive a negotiation request message sent by the first negotiation device, where the negotiation request message carries a protocol stack type supported by the first negotiation device and a protocol preset by the first negotiation device. Stack type priority;
协议栈类型获得单元 1802, 用于根据所述协商请求消息接收单元 1801所接收的 协商请求消息中携带的所述第一协商设备支持的所有协议栈类型,选取所述第二协商 设备与所述第一协商设备共同支持的协议栈类型;  a protocol stack type obtaining unit 1802, configured to select, according to all protocol stack types supported by the first negotiation device that are carried in the negotiation request message received by the negotiation request message receiving unit 1801, the second negotiation device and the The type of protocol stack supported by the first negotiation device;
选取单元 1803, 用于根据所述协商请求消息中携带的所述第一协商设备支持的 协议栈类型和所述第一协商设备预先设置的协议栈类型优先级,选取一个所述第二协 商设备与所述第一协商设备共同支持的协议栈类型;  The selecting unit 1803 is configured to select one of the second negotiation devices according to the protocol stack type supported by the first negotiation device and the protocol stack type priority set by the first negotiation device that are carried in the negotiation request message. a protocol stack type supported by the first negotiation device;
第一协商响应消息发送单元 1804, 用于根据所述协商请求消息接收单元 1801接 收的协商请求消息向所述第一协商设备反馈第一协商响应消息,所述第一协商响应消 息中携带有所述选取单元 1803选取的双方共同支持的一个协议栈类型. 如图 19所示为本发明协议栈类型协商装置的另一个实施例, 所述装置设置于与 第一协商设备进行协议栈类型协商的第二协商设备中, 包括: The first negotiation response message sending unit 1804 is configured to feed back a first negotiation response message to the first negotiation device according to the negotiation request message received by the negotiation request message receiving unit 1801, where the first negotiation response message carries Another type of protocol stack supported by the two selected by the selecting unit 1803. As shown in FIG. 19, another embodiment of the protocol stack type negotiating apparatus of the present invention is provided. The second negotiation device that negotiates the protocol stack type by the first negotiation device includes:
协商请求消息接收单元 1901, 用于接收第一协商设备发送的协商请求消息, 所 述协商请求消息中携带有所述第一协商设备支持的协议栈类型;  The negotiation request message receiving unit 1901 is configured to receive a negotiation request message sent by the first negotiation device, where the negotiation request message carries a protocol stack type supported by the first negotiation device;
协议栈类型获得单元 1902, 用于根据所述协商请求消息接收单元 1901所接收的 协商请求消息中携带的所述第一协商设备支持的协议栈类型,选取所述第二协商设备 与所述第一协商设备共同支持的协议栈类型;  The protocol stack type obtaining unit 1902 is configured to select, according to the protocol stack type supported by the first negotiation device that is carried in the negotiation request message received by the negotiation request message receiving unit 1901, the second negotiation device and the first a protocol stack type that is commonly supported by the negotiation device;
第一协商响应消息发送单元 1903, 用于根据所述协商请求消息接收单元 1901接 收的协商请求消息向所述第一协商设备反馈第一协商响应消息,以使所述第一协商设 备根据所述第一协商响应消息,获得所述第二协商设备与所述第一协商设备共同支持 的协议栈类型;  The first negotiation response message sending unit 1903 is configured to feed back a first negotiation response message to the first negotiation device according to the negotiation request message received by the negotiation request message receiving unit 1901, so that the first negotiation device is configured according to the a first negotiation response message, obtaining a protocol stack type supported by the second negotiation device and the first negotiation device;
第二协商响应消息接收单元 1904, 用于接收所述第一协商设备所发送的第二协 商响应消息,所述第二协商响应消息中携带第一协商设备最终选取的双方共同支持的 一个协议栈类型。 如图 20所示为本发明协议栈类型协商装置的另一个实施例, 所述装置设置于与 第一协商设备进行协议栈类型协商的第二协商设备中, 包括:  The second negotiation response message receiving unit 1904 is configured to receive a second negotiation response message sent by the first negotiation device, where the second negotiation response message carries a protocol stack jointly supported by the first selected device by the first negotiation device. Types of. As shown in FIG. 20, another embodiment of the protocol stack type negotiation apparatus of the present invention is provided. The apparatus is configured in a second negotiation device that performs protocol stack type negotiation with the first negotiation device, and includes:
密钥交互单元 2001, 用于在协商请求消息接收单元 2002接收第一协商设备发送 的协商请求消息之前, 与所述第一协商设备之间交互密钥信息, 以使所述第一协商设 备与所述第二协商设备根据所述密钥信息采用公私钥加解密机制进行协议栈类型协 商。  The key interaction unit 2001 is configured to: before the negotiation request message receiving unit 2002 receives the negotiation request message sent by the first negotiation device, exchange key information with the first negotiation device, so that the first negotiation device and the The second negotiating device performs protocol stack type negotiation by using a public-private key encryption and decryption mechanism according to the key information.
协商请求消息接收单元 2002, 用于接收第一协商设备发送的根据所述密钥交互 单元 2001交互的密钥信息加密后的协商请求消息, 利用所述密钥信息对所述加密后 的协商请求消息进行解密, 得到协商请求消息;  The negotiation request message receiving unit 2002 is configured to receive a negotiation request message that is encrypted by the key information exchanged by the key interaction unit 2001 and sent by the first negotiation device, and use the key information to perform the encrypted negotiation request. The message is decrypted to obtain a negotiation request message;
协议栈类型获得单元 2003, 用于根据所述协商请求消息接收单元 2002接收的协 商请求消息中携带的所述第一协商设备支持的协议栈类型,选取所述第二协商设备与 所述第一协商设备共同支持的协议栈类型;  The protocol stack type obtaining unit 2003 is configured to select the second negotiation device and the first according to the protocol stack type supported by the first negotiation device that is carried in the negotiation request message received by the negotiation request message receiving unit 2002. Negotiating the type of protocol stack supported by the device;
第一协商响应消息发送单元 2004, 用于向所述第一协商设备反馈根据所述密钥 交互单元 2001交互的密钥信息加密后的第一协商响应消息, 以使所述第一协商设备 根据所述第一协商响应消息,获得所述第二协商设备与所述第一协商设备共同支持的 协议栈类型。  The first negotiation response message sending unit 2004 is configured to feed back, to the first negotiation device, a first negotiation response message that is encrypted according to the key information exchanged by the key interaction unit 2001, so that the first negotiation device is configured according to the first negotiation device. The first negotiation response message obtains a protocol stack type supported by the second negotiation device and the first negotiation device.
上述密钥交互单元 2001的一个实施例中, 密钥交互单元 2001具体包括: 密钥设置子单元, 用于在协商请求消息接收单元 2002接收第一协商设备发送的 协商请求消息之前, 预先设置第二协商设备私钥和第二协商设备公钥; In an embodiment of the key interaction unit 2001, the key interaction unit 2001 specifically includes: a key setting subunit, configured to preset a second negotiation device private key and a second negotiation device public key before the negotiation request message receiving unit 2002 receives the negotiation request message sent by the first negotiation device;
私钥存储子单元, 用于存储所述密钥设置子单元所设置的第二协商设备私钥; 公钥发送子单元,用于将所述密钥设置子单元所设置的第二协商设备公钥发送给 所述第一协商设备。  a private key storage subunit, configured to store a second negotiating device private key set by the key setting subunit; a public key sending subunit, configured to set a second negotiating device set by the key setting subunit The key is sent to the first negotiation device.
在上述密钥交互单元 2001的另一个实施例中, 密钥交互单元 2001具体用于: 在 协商请求消息接收单元 2002接收第一协商设备发送的协商请求消息之前, 获得所述 第一协商设备预先设置的第一协商设备公钥。 如图 21所示为本发明协议栈类型协商装置的另一个实施例, 所述装置设置于与 第一协商设备进行协议栈类型协商的第二协商设备中, 包括:  In another embodiment of the key interaction unit 2001, the key interaction unit 2001 is specifically configured to: obtain the first negotiation device in advance before the negotiation request message receiving unit 2002 receives the negotiation request message sent by the first negotiation device. The first negotiated device public key is set. As shown in FIG. 21, another embodiment of the protocol stack type negotiation device of the present invention is provided. The device is configured in a second negotiation device that performs protocol stack type negotiation with the first negotiation device, and includes:
密钥共享单元 2101, 用于与所述第一协商设备共享对称密钥;  a key sharing unit 2101, configured to share a symmetric key with the first negotiation device;
协商请求消息接收单元 2102, 用于接收第一协商设备发送的协商请求消息, 所 述协商请求消息中携带有所述第一协商设备支持的协议栈类型;  The negotiation request message receiving unit 2102 is configured to receive a negotiation request message sent by the first negotiation device, where the negotiation request message carries a protocol stack type supported by the first negotiation device;
解密单元 2103, 用于所述第二协商设备接收到第一协商设备在发送消息的同时 发送的消息密文后, 根据所述密钥共享单元 2101所共享的对称密钥对所述消息密文 进行解密, 得到消息明文, 其中, 所述消息密文为所述第一协商设备根据所述对称密 钥和获得的随机数对发送给所述第一协商设备的消息进行加密, 所得到的消息密文; 比较单元 2104, 用于将所述解密单元 2103得到的消息明文与接收到的消息进行 比较, 当比较结果相同时, 继续进行协议栈类型协商;  The decryption unit 2103 is configured to: after the second negotiation device receives the message ciphertext sent by the first negotiation device while sending the message, pair the message ciphertext according to the symmetric key shared by the key sharing unit 2101 Decrypting, obtaining a message plaintext, wherein the message ciphertext is that the first negotiation device encrypts a message sent to the first negotiation device according to the symmetric key and the obtained random number, and the obtained message is obtained. The ciphertext comparison unit 2104 is configured to compare the message plaintext obtained by the decryption unit 2103 with the received message, and continue to perform protocol stack type negotiation when the comparison result is the same;
协议栈类型获得单元 2105, 用于根据所述协商请求消息接收单元 2102所接收的 协商请求消息中携带的所述第一协商设备支持的协议栈类型,选取所述第二协商设备 与所述第一协商设备共同支持的协议栈类型;  The protocol stack type obtaining unit 2105 is configured to select, according to the protocol stack type supported by the first negotiation device that is carried in the negotiation request message received by the negotiation request message receiving unit 2102, the second negotiation device and the first a protocol stack type that is commonly supported by the negotiation device;
加密单元 2106, 用于所述第二协商设备在向第一协商设备发送消息之前, 根据 所述密钥共享单元 2101所共享的对称密钥和获得的随机数对发送给所述第一协商设 备的消息进行加密, 得到消息密文;  The encryption unit 2106 is configured to send, by the second negotiation device, the symmetric key shared by the key sharing unit 2101 and the obtained random number pair to the first negotiation device before sending the message to the first negotiation device. The message is encrypted to obtain a message ciphertext;
第一协商响应消息发送单元 2107, 用于向所述第一协商设备反馈第一协商响应 消息, 以使所述第一协商设备根据所述第一协商响应消息, 获得所述第二协商设备与 所述第一协商设备共同支持的协议栈类型;  The first negotiation response message sending unit 2107 is configured to feed back the first negotiation response message to the first negotiation device, so that the first negotiation device obtains the second negotiation device according to the first negotiation response message. a protocol stack type commonly supported by the first negotiation device;
密文发送单元 2108, 用于在发送所述消息时同时发送所述加密单元 2106得到的 消息密文, 以使所述第一协商设备对接收到的所述消息密文进行解密得到消息明文, 将所述消息明文与接收到的消息进行比较, 当比较结果相同时, 继续进行协议栈类型 协商。 The ciphertext sending unit 2108 is configured to send the message ciphertext obtained by the encryption unit 2106 at the same time when the message is sent, so that the first negotiation device decrypts the received message ciphertext to obtain a message plaintext. The plaintext of the message is compared with the received message, and when the comparison result is the same, the protocol stack type negotiation is continued.
专业人员还可以进一步应能意识到,结合本文中所公开的实施例描述的各示例的 单元及算法步骤, 能够以电子硬件、 计算机软件或者二者的结合来实现, 为了清楚地 说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组 成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和 设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的 功能, 但是这种实现不应认为超出本发明实施例的范围。  A person skilled in the art will further appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both, in order to clearly illustrate hardware and software. Interchangeability, the composition and steps of the various examples have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the embodiments of the invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执 行的软件模块, 或者二者的结合来实施。  The steps of a method or algorithm described in connection with the embodiments disclosed herein can be implemented directly in hardware, a software module executed by a processor, or a combination of both.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明实 施例。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文 中所定义的一般原理可以在不脱离本发明实施例的精神或范围的情况下,在其他实施 例中实现。 因此, 本发明实施例将不会被限制于本文所示的这些实施例, 而是要符合 与本文所公开的原理和新颖特点相一致的最宽的范围。  The above description of the disclosed embodiments enables those skilled in the art to make or use the embodiments of the invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the embodiments of the invention. . Therefore, the embodiments of the invention are not to be limited to the embodiments shown herein, but are to be accorded to the broadest scope of the principles and novel features disclosed herein.
以上所述仅为本发明实施例的较佳实施例而已, 并不用以限制本发明实施例, 凡 在本发明实施例的精神和原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含 在本发明实施例的保护范围之内。  The above are only the preferred embodiments of the present invention, and are not intended to limit the embodiments of the present invention, and any modifications, equivalents, improvements, etc. made within the spirit and principles of the embodiments of the present invention are It should be included in the scope of protection of the embodiments of the present invention.

Claims

权 利 要 求 Rights request
1、 一种协议栈类型协商方法, 其特征在于, 包括:  A protocol stack type negotiation method, which is characterized in that:
第一协商设备向第二协商设备发送协商请求消息,所述协商请求消息中携带 有所述第一协商设备支持的协议栈类型,以使所述第二协商设备根据所述协商请 求消息中携带的所述第一协商设备支持的协议栈类型,选取所述第二协商设备与 所述第一协商设备共同支持的协议栈类型;  The first negotiation device sends a negotiation request message to the second negotiation device, where the negotiation request message carries the protocol stack type supported by the first negotiation device, so that the second negotiation device carries the message according to the negotiation request message. The protocol stack type supported by the first negotiation device, and the protocol stack type supported by the second negotiation device and the first negotiation device are selected;
接收所述第二协商设备根据所述协商请求消息反馈的第一协商响应消息; 根据所述第一协商响应消息,获得所述第二协商设备与所述第一协商设备共 同支持的协议栈类型。  Receiving a first negotiation response message that is sent by the second negotiation device according to the negotiation request message; and obtaining, according to the first negotiation response message, a protocol stack type supported by the second negotiation device and the first negotiation device .
2、 根据权利要求 1所述的方法, 其特征在于, 2. The method of claim 1 wherein
所述第一协商响应消息中携带所述第二协商设备确定的双方共同支持的至 少一个协议栈类型;  The first negotiation response message carries at least one protocol stack type jointly supported by the two parties determined by the second negotiation device;
所述根据所述第一协商响应消息,获得所述第二协商设备与所述第一协商设 备共同支持的协议栈类型, 包括:  And obtaining, according to the first negotiation response message, a protocol stack type supported by the second negotiation device and the first negotiation device, including:
从所述第一协商响应消息中,选择一个所述第二协商设备与所述第一协商设 备共同支持的协议栈类型。  And selecting, by the first negotiation response message, a protocol stack type supported by the second negotiation device and the first negotiation device.
3、 根据权利要求 2所述的方法, 其特征在于, 所述第一协商响应消息中还 携带所述第二协商设备预先设置的协议栈类型优先级; The method according to claim 2, wherein the first negotiation response message further carries a protocol stack type priority preset by the second negotiation device;
贝 U, 根据所述第二协商设备预先设置的协议栈类型优先级, 从所述第一协商 响应消息中携带的所述第二协商设备确定的双方共同支持的至少一个协议栈类 型, 选择一个所述第二协商设备与所述第一协商设备共同支持的协议栈类型。  Selecting, according to the protocol stack type priority set by the second negotiation device, at least one protocol stack type jointly supported by the second negotiation device carried in the first negotiation response message, selecting one The protocol stack type supported by the second negotiation device and the first negotiation device.
4、 根据权利要求 1所述的方法, 其特征在于, 4. The method of claim 1 wherein:
所述协商请求消息还携带所述第一协商设备预先设置的协议栈类型优先级; 所述第一协商响应消息携带所述第二协商设备选取的双方共同支持的一个 协议栈类型, 其中, 所述双方共同支持的一个协议栈类型为所述第二协商设备根 据所述协商请求消息中携带的所述第一协商设备支持的协议栈类型和所述第一 协商设备预先设置的协议栈类型优先级,选取的一个所述第二协商设备与所述第 一协商设备共同支持的协议栈类型。 The negotiation request message further carries a protocol stack type priority set by the first negotiation device; the first negotiation response message carries a protocol stack type commonly supported by the two selected devices by the second negotiation device, where A protocol stack type that is jointly supported by the two parties is that the second negotiation device takes precedence according to the protocol stack type supported by the first negotiation device and the protocol stack type preset by the first negotiation device that are carried in the negotiation request message. Level, the selected one of the protocol stack types supported by the second negotiation device and the first negotiation device.
5、 根据权利要求 1所述的方法, 其特征在于, 所述第一协商响应消息中携 带所述第二协商设备支持的协议栈类型; The method according to claim 1, wherein the first negotiation response message carries a protocol stack type supported by the second negotiation device;
所述根据所述第一协商响应消息,获得所述第二协商设备与所述第一协商设 备共同支持的协议栈类型, 包括:  And obtaining, according to the first negotiation response message, a protocol stack type supported by the second negotiation device and the first negotiation device, including:
根据所述第一协商响应消息中携带的所述第二协商设备支持的协议栈类型, 选取所述第二协商设备与所述第一协商设备共同支持的协议栈类型。  Determining, according to the protocol stack type supported by the second negotiation device that is carried in the first negotiation response message, a protocol stack type supported by the second negotiation device and the first negotiation device.
6、 根据权利要求 5所述的方法, 其特征在于, 所述第一协商响应消息还携 带所述第二协商设备预先设置的协议栈类型优先级; The method according to claim 5, wherein the first negotiation response message further carries a protocol stack type priority preset by the second negotiation device;
则根据所述第一协商响应消息中携带的所述第二协商设备预先设置的协议 栈类型优先级以及所述第二协商设备支持的协议栈类型,确定一个所述第二协商 设备与所述第一协商设备共同支持的协议栈类型。  Determining, according to the protocol stack type priority preset by the second negotiation device that is carried in the first negotiation response message, and the protocol stack type supported by the second negotiation device, determining the second negotiation device and the The protocol stack type supported by the first negotiation device.
7、 根据权利要求 1至 6任意一项所述的方法, 其特征在于, 所述方法还包 括: The method according to any one of claims 1 to 6, wherein the method further comprises:
向所述第二协商设备发送第二协商响应消息,所述第二协商响应消息中携带 第一协商设备最终选取的双方共同支持的一个协议栈类型。  And sending, by the second negotiation device, a second negotiation response message, where the second negotiation response message carries a protocol stack type supported by the two parties finally selected by the first negotiation device.
8、 根据权利要求 1至 7中任一权利要求所述的方法, 其特征在于, 所述第 一协商设备向第二协商设备发送协商请求消息之前, 还包括: The method according to any one of claims 1 to 7, wherein before the sending, by the first negotiation device, the negotiation request message to the second negotiation device, the method further includes:
与所述第二协商设备之间交互密钥信息,以使所述第一协商设备与所述第二 协商设备根据所述密钥信息采用公私钥加解密机制进行协议栈类型协商。  The key information is exchanged with the second negotiation device, so that the first negotiation device and the second negotiation device perform protocol stack type negotiation by using a public-private key encryption and decryption mechanism according to the key information.
9、 根据权利要求 1至 7中任一权利要求所述的方法, 其特征在于, 还包括: 所述第一协商设备向第二协商设备发送协商请求消息之前,与所述第二协商 设备共享对称密钥; The method according to any one of claims 1 to 7, further comprising: before the first negotiation device sends a negotiation request message to the second negotiation device, sharing with the second negotiation device Symmetric key
所述第一协商设备在向第二协商设备发送消息之前,根据所述对称密钥和获 得的随机数对发送给所述第二协商设备的消息进行加密, 得到消息密文, 以及在 发送所述消息时同时发送所述消息密文,以使所述第二协商设备对接收到的所述 消息密文进行解密得到消息明文, 将所述消息明文与接收到的消息进行比较, 当 比较结果相同时, 继续进行协议栈类型协商;  Before sending the message to the second negotiation device, the first negotiation device encrypts the message sent to the second negotiation device according to the symmetric key and the obtained random number, obtains the message ciphertext, and sends the message Sending the message ciphertext at the same time, so that the second negotiation device decrypts the received message ciphertext to obtain a message plaintext, and compares the message plaintext with the received message, when comparing the result When the same, continue the protocol stack type negotiation;
所述第一协商设备接收到第二协商设备在发送消息的同时发送的消息密文 后, 根据所述对称密钥对所述消息密文进行解密, 得到消息明文, 将所述消息明 文与接收到的消息进行比较, 当比较结果相同时, 继续进行协议栈类型协商, 其 中,所述消息密文为所述第二协商设备根据所述对称密钥和获得的随机数对发送 给所述第一协商设备的消息进行加密, 所得到的消息密文。 Receiving, by the first negotiation device, a message ciphertext sent by the second negotiation device while sending the message After the ciphertext is decrypted according to the symmetric key, the message plaintext is obtained, and the plaintext of the message is compared with the received message. When the comparison result is the same, the protocol stack type negotiation is continued, where The message ciphertext is used by the second negotiation device to encrypt the message sent to the first negotiation device according to the symmetric key and the obtained random number, and the obtained message ciphertext.
10、一种协议栈类型协商装置, 所述装置设置于与第二协商设备进行协议栈 类型协商的第一协商设备中, 其特征在于, 包括: A protocol stack type negotiation device, wherein the device is configured in a first negotiation device that negotiates a protocol stack with the second negotiation device, and is characterized by:
协商请求消息发送单元, 用于向第二协商设备发送协商请求消息, 所述协商 请求消息中携带有所述第一协商设备支持的协议栈类型,以使所述第二协商设备 根据所述协商请求消息中携带的所述第一协商设备支持的协议栈类型,选取所述 第二协商设备与所述第一协商设备共同支持的协议栈类型;  a negotiation request message sending unit, configured to send a negotiation request message to the second negotiation device, where the negotiation request message carries a protocol stack type supported by the first negotiation device, so that the second negotiation device is configured according to the negotiation a protocol stack type supported by the first negotiation device that is carried in the request message, and a protocol stack type supported by the second negotiation device and the first negotiation device is selected;
第一协商响应消息接收单元,用于接收所述第二协商设备根据所述协商请求 消息发送单元发送的协商请求消息反馈的第一协商响应消息;  a first negotiation response message receiving unit, configured to receive a first negotiation response message that is sent by the second negotiation device according to the negotiation request message sent by the negotiation request message sending unit;
协议栈类型获得单元,用于根据所述第一协商响应消息接收单元接收的第一 协商响应消息,获得所述第二协商设备与所述第一协商设备共同支持的协议栈类 型。  And a protocol stack type obtaining unit, configured to obtain, according to the first negotiation response message received by the first negotiation response message receiving unit, a protocol stack type supported by the second negotiation device and the first negotiation device.
11、 根据权利要求 10所述的装置, 其特征在于, 11. Apparatus according to claim 10 wherein:
所述第一协商响应消息接收单元所接收的第一协商响应消息中携带所述第 二协商设备确定的双方共同支持的至少一个协议栈类型;  The first negotiation response message received by the first negotiation response message receiving unit carries at least one protocol stack type jointly supported by the two parties determined by the second negotiation device;
所述协议栈类型获得单元具体用于:从所述第一协商响应消息接收单元所接 收的第一协商响应消息中,选择一个所述第二协商设备与所述第一协商设备共同 支持的协议栈类型。  The protocol stack type obtaining unit is configured to: select, from the first negotiation response message received by the first negotiation response message receiving unit, a protocol supported by the second negotiation device and the first negotiation device Stack type.
12、 根据权利要求 11所述的装置, 其特征在于, 12. Apparatus according to claim 11 wherein:
所述第一协商响应消息接收单元所接收的第一协商响应消息中还携带所述 第二协商设备预先设置的协议栈类型优先级;  The first negotiation response message received by the first negotiation response message receiving unit further carries a protocol stack type priority preset by the second negotiation device;
所述协议栈类型获得单元具体用于:根据所述第二协商设备预先设置的协议 栈类型优先级,从所述第一协商响应消息接收单元所接收的第一协商响应消息中 携带的所述第二协商设备确定的双方共同支持的至少一个协议栈类型,选择一个 所述第二协商设备与所述第一协商设备共同支持的协议栈类型。 The protocol stack type obtaining unit is specifically configured to: according to the protocol stack type priority set by the second negotiation device, the first negotiation response message received by the first negotiation response message receiving unit At least one protocol stack type supported by the two parties determined by the second negotiation device, and a protocol stack type supported by the second negotiation device and the first negotiation device is selected.
13、 根据权利要求 10所述的装置, 其特征在于, 13. Apparatus according to claim 10 wherein:
所述协商请求消息发送单元所发送的协商请求消息还携带所述第一协商设 备预先设置的协议栈类型优先级;  The negotiation request message sent by the negotiation request message sending unit further carries a protocol stack type priority preset by the first negotiation device;
所述第一协商响应消息接收单元所接收的第一协商响应消息携带所述第二 协商设备选取的双方共同支持的一个协议栈类型, 其中, 所述双方共同支持的一 个协议栈类型为所述第二协商设备根据所述协商请求消息发送单元所发送的协 商请求消息中携带的所述第一协商设备支持的协议栈类型和所述第一协商设备 预先设置的协议栈类型优先级,选取的一个所述第二协商设备与所述第一协商设 备共同支持的协议栈类型。  The first negotiation response message received by the first negotiation response message receiving unit carries a protocol stack type supported by the two parties selected by the second negotiation device, where one protocol stack type supported by the two parties is the The second negotiation device selects a protocol stack type supported by the first negotiation device and a protocol stack type priority preset by the first negotiation device, which are carried in the negotiation request message sent by the negotiation request message sending unit. A protocol stack type supported by the second negotiation device and the first negotiation device.
14、 根据权利要求 10所述的装置, 其特征在于, 所述第一协商响应消息接 收单元所接收的第一协商响应消息中携带所述第二协商设备支持的协议栈类型; 所述协议栈类型获得单元具体用于: The apparatus according to claim 10, wherein the first negotiation response message received by the first negotiation response message receiving unit carries a protocol stack type supported by the second negotiation device; The type obtaining unit is specifically used for:
根据所述第一协商响应消息接收单元接收的第一协商响应消息中携带的所 述第二协商设备支持的协议栈类型,选取所述第二协商设备与所述第一协商设备 共同支持的协议栈类型。  Selecting a protocol supported by the second negotiation device and the first negotiation device according to the protocol stack type supported by the second negotiation device that is carried in the first negotiation response message received by the first negotiation response message receiving unit Stack type.
15、 根据权利要求 14所述的装置, 其特征在于, 15. Apparatus according to claim 14 wherein:
所述第一协商响应消息接收单元所接收的第一协商响应消息还携带所述第 二协商设备预先设置的协议栈类型优先级;  The first negotiation response message received by the first negotiation response message receiving unit further carries a protocol stack type priority preset by the second negotiation device;
所述协议栈类型获得单元具体用于:  The protocol stack type obtaining unit is specifically configured to:
根据所述第一协商响应消息接收单元所接收的第一协商响应消息中携带的 所述第二协商设备预先设置的协议栈类型优先级以及所述第二协商设备支持的 协议栈类型,确定一个所述第二协商设备与所述第一协商设备共同支持的协议栈 类型。  Determining a protocol stack type priority preset by the second negotiation device and a protocol stack type supported by the second negotiation device, which are carried in the first negotiation response message received by the first negotiation response message receiving unit The protocol stack type supported by the second negotiation device and the first negotiation device.
16、 根据权利要求 10至 15任意一项所述的装置, 其特征在于, 所述装置还 包括: The device according to any one of claims 10 to 15, wherein the device further comprises:
第二协商响应消息发送单元,用于向所述第二协商设备发送第二协商响应消 息,所述第二协商响应消息中携带第一协商设备最终选取的双方共同支持的一个 协议栈类型。 The second negotiation response message sending unit is configured to send a second negotiation response message to the second negotiation device, where the second negotiation response message carries a protocol stack type supported by the two parties selected by the first negotiation device.
17、 根据权利要求 10至 16中任一权利要求所述的装置, 其特征在于, 还包 括: 17. Apparatus according to any one of claims 10 to 16 further comprising:
密钥交互单元,用于在所述协商请求消息发送单元向第二协商设备发送协商 请求消息之前, 与所述第二协商设备之间交互密钥信息, 以使所述第一协商设备 与所述第二协商设备根据所述密钥信息采用公私钥加解密机制进行协议栈类型 协商。  a key interaction unit, configured to exchange key information with the second negotiation device before the negotiation request message sending unit sends the negotiation request message to the second negotiation device, so that the first negotiation device and the The second negotiating device performs protocol stack type negotiation by using a public-private key encryption and decryption mechanism according to the key information.
18、 根据权利要求 10至 16中任一权利要求所述的装置, 其特征在于, 还包 括: 18. Apparatus according to any one of claims 10 to 16 further comprising:
密钥共享单元,用于在所述协商请求消息发送单元向第二协商设备发送协商 请求消息之前, 与所述第二协商设备共享对称密钥;  a key sharing unit, configured to share a symmetric key with the second negotiation device before the negotiation request message sending unit sends the negotiation request message to the second negotiation device;
加密单元, 用于所述第一协商设备在向第二协商设备发送消息之前, 根据所 述密钥共享单元所共享的对称密钥和获得的随机数对发送给所述第二协商设备 的消息进行加密, 得到消息密文;  An encryption unit, configured to send, by the first negotiation device, a message sent to the second negotiation device according to the symmetric key shared by the key sharing unit and the obtained random number pair before sending the message to the second negotiation device Encryption to obtain a message ciphertext;
密文发送单元,用于在发送所述消息时同时发送所述加密单元得到的消息密 文, 以使所述第二协商设备对接收到的所述消息密文进行解密得到消息明文, 将 所述消息明文与接收到的消息进行比较, 当比较结果相同时, 继续进行协议栈类 型协商;  a ciphertext sending unit, configured to simultaneously send a message ciphertext obtained by the ciphering unit when the message is sent, so that the second negotiating device decrypts the received message ciphertext to obtain a message plaintext, The plaintext of the message is compared with the received message, and when the comparison result is the same, the protocol stack type negotiation is continued;
解密单元,用于所述第一协商设备接收到第二协商设备在发送消息的同时发 送的消息密文后,根据所述密钥共享单元所共享的对称密钥对所述消息密文进行 解密, 得到消息明文, 其中, 所述消息密文为所述第二协商设备根据所述对称密 钥和获得的随机数对发送给所述第一协商设备的消息进行加密,所得到的消息密 文;  a decryption unit, configured to: after the first negotiation device receives the message ciphertext sent by the second negotiation device while sending the message, decrypt the message ciphertext according to the symmetric key shared by the key sharing unit Obtaining a message, wherein the message ciphertext is that the second negotiation device encrypts the message sent to the first negotiation device according to the symmetric key and the obtained random number, and the obtained message ciphertext ;
比较单元, 用于将所述解密单元得到的消息明文与接收到的消息进行比较, 当比较结果相同时, 继续进行协议栈类型协商。  The comparing unit is configured to compare the plaintext of the message obtained by the decrypting unit with the received message, and when the comparison result is the same, continue the protocol stack type negotiation.
19、 一种协议栈类型协商方法, 其特征在于, 包括: 19. A protocol stack type negotiation method, comprising:
第二协商设备接收第一协商设备发送的协商请求消息,所述协商请求消息中 携带有所述第一协商设备支持的协议栈类型;  The second negotiation device receives the negotiation request message sent by the first negotiation device, where the negotiation request message carries the protocol stack type supported by the first negotiation device;
根据所述协商请求消息中携带的所述第一协商设备支持的协议栈类型,选取 所述第二协商设备与所述第一协商设备共同支持的协议栈类型;  Determining, according to the protocol stack type supported by the first negotiation device that is carried in the negotiation request message, a protocol stack type supported by the second negotiation device and the first negotiation device;
根据所述协商请求消息向所述第一协商设备反馈第一协商响应消息,以使所 述第一协商设备根据所述第一协商响应消息,获得所述第二协商设备与所述第一 协商设备共同支持的协议栈类型。 And feeding back, by using the negotiation request message, the first negotiation response message to the first negotiation device, so that The first negotiation device obtains a protocol stack type supported by the second negotiation device and the first negotiation device according to the first negotiation response message.
20、 根据权利要求 19所述的方法, 其特征在于, 在所述根据所述协商请求 消息向所述第一协商设备反馈第一协商响应消息之前, 还包括: The method according to claim 19, further comprising: before the feeding back the first negotiation response message to the first negotiation device according to the negotiation request message,
确定双方共同支持的至少一个协议栈类型;  Determining at least one protocol stack type supported by both parties;
所述第一协商响应消息中携带所述双方共同支持的至少一个协议栈类型,以 使所述第一协商设备从所述第一协商响应消息中,选择一个所述第二协商设备与 所述第一协商设备共同支持的协议栈类型。  The first negotiation response message carries at least one protocol stack type supported by the two parties, so that the first negotiation device selects one of the second negotiation device from the first negotiation response message, and the The protocol stack type supported by the first negotiation device.
21、 根据权利要求 20所述的方法, 其特征在于, 21. The method of claim 20, wherein
所述第一协商响应消息中还携带所述第二协商设备预先设置的协议栈类型 优先级,以使所述第一协商设备根据所述第二协商设备预先设置的协议栈类型优 先级,从所述第一协商响应消息中携带的所述第二协商设备确定的双方共同支持 的至少一个协议栈类型,选择一个所述第二协商设备与所述第一协商设备共同支 持的协议栈类型。。  The first negotiation response message further carries a protocol stack type priority set by the second negotiation device, so that the first negotiation device selects a protocol stack type priority preset according to the second negotiation device. And selecting, by the second negotiation device, the type of the protocol stack supported by the second negotiation device and the first negotiation device. .
22、 根据权利要求 19所述的方法, 其特征在于: 22. The method of claim 19, wherein:
所述协商请求消息还携带所述第一协商设备预先设置的协议栈类型优先级; 所述根据所述协商请求消息向所述第一协商设备反馈第一协商响应消息之 前, 还包括:  The negotiation request message further carries a protocol stack type priority set by the first negotiation device, and the method further includes: before the feeding back the first negotiation response message to the first negotiation device according to the negotiation request message,
根据所述协商请求消息中携带的所述第一协商设备支持的协议栈类型和所 述第一协商设备预先设置的协议栈类型优先级,选取一个所述第二协商设备与所 述第一协商设备共同支持的协议栈类型;  Determining, according to the protocol stack type supported by the first negotiation device and the protocol stack type priority set by the first negotiation device, the second negotiation device and the first negotiation The type of protocol stack supported by the device;
所述第一协商响应消息携带所述第二协商设备选取的双方共同支持的一个 协议栈类型。  The first negotiation response message carries a protocol stack type supported by the two parties selected by the second negotiation device.
23、 根据权利要求 19所述的方法, 其特征在于, 所述第一协商响应消息中 携带所述第二协商设备支持的协议栈类型,以使所述第一协商设备根据所述第一 协商响应消息中携带的所述第二协商设备支持的协议栈类型,选取所述第二协商 设备与所述第一协商设备共同支持的协议栈类型。 The method according to claim 19, wherein the first negotiation response message carries a protocol stack type supported by the second negotiation device, so that the first negotiation device is configured according to the first negotiation. Selecting a protocol stack type supported by the second negotiation device and the first negotiation device by using the protocol stack type supported by the second negotiation device that is carried in the response message.
24、 根据权利要求 23所述的方法, 其特征在于, 所述第一协商响应消息还 携带所述第二协商设备预先设置的协议栈类型优先级,以使所述第一协商设备根 据所述第一协商响应消息中携带的所述第二协商设备预先设置的协议栈类型优 先级以及所述第二协商设备支持的协议栈类型,确定一个所述第二协商设备与所 述第一协商设备共同支持的协议栈类型。 The method according to claim 23, wherein the first negotiation response message further carries a protocol stack type priority preset by the second negotiation device, so that the first negotiation device is configured according to the Determining, by the second negotiation device, the protocol stack type priority set by the second negotiation device and the protocol stack type supported by the second negotiation device, determining one of the second negotiation device and the first negotiation device The type of protocol stack that is commonly supported.
25、 根据权利要求 19至 24任意一项所述的方法, 其特征在于, 所述方法还 包括: The method according to any one of claims 19 to 24, wherein the method further comprises:
接收所述第一协商设备发送的第二协商响应消息,所述第二协商响应消息中 携带第一协商设备最终选取的双方共同支持的一个协议栈类型。  And receiving, by the first negotiation device, a second negotiation response message, where the second negotiation response message carries a protocol stack type that is jointly supported by the first selected device by the first negotiation device.
26、 根据权利要求 19至 25中任一权利要求所述的方法, 其特征在于, 所述 第二协商设备接收第一协商设备发送的协商请求消息之前, 还包括: The method according to any one of claims 19 to 25, wherein before the receiving, by the second negotiation device, the negotiation request message sent by the first negotiation device, the method further includes:
与所述第一协商设备之间交互密钥信息,以使所述第一协商设备与所述第二 协商设备根据所述密钥信息采用公私钥加解密机制进行协议栈类型协商。  The key information is exchanged with the first negotiation device, so that the first negotiation device and the second negotiation device perform protocol stack type negotiation by using a public-private key encryption and decryption mechanism according to the key information.
27、 根据权利要求 19至 25中任一权利要求所述的方法, 其特征在于, 还包 括: The method according to any one of claims 19 to 25, further comprising:
所述第二协商设备接收第一协商设备发送的协商请求消息之前,与所述第一 协商设备共享对称密钥;  Before receiving the negotiation request message sent by the first negotiation device, the second negotiation device shares a symmetric key with the first negotiation device;
所述第二协商设备接收到第一协商设备在发送消息的同时发送的消息密文 后, 根据所述对称密钥对所述消息密文进行解密, 得到消息明文, 将所述消息明 文与接收到的消息进行比较, 当比较结果相同时, 继续进行协议栈类型协商, 其 中,所述消息密文为所述第一协商设备根据所述对称密钥和获得的随机数对发送 给所述第一协商设备的消息进行加密, 所得到的消息密文;  Receiving, by the second negotiation device, the message ciphertext sent by the first negotiation device at the same time as the message is sent, decrypting the message ciphertext according to the symmetric key, obtaining a message plaintext, and clearing the message and receiving the message The obtained message is compared, and when the comparison result is the same, the protocol stack type negotiation is continued, where the message ciphertext is sent by the first negotiation device according to the symmetric key and the obtained random number pair to the first The message of the negotiating device is encrypted, and the obtained message ciphertext;
所述第二协商设备在向第一协商设备发送消息之前,根据所述对称密钥和获 得的随机数对发送给所述第一协商设备的消息进行加密, 得到消息密文, 以及在 发送所述消息时同时发送所述消息密文,以使所述第一协商设备对接收到的所述 消息密文进行解密得到消息明文, 将所述消息明文与接收到的消息进行比较, 当 比较结果相同时, 继续进行协议栈类型协商。  Before sending the message to the first negotiation device, the second negotiation device encrypts the message sent to the first negotiation device according to the symmetric key and the obtained random number, obtains the message ciphertext, and sends the message Sending the message ciphertext at the same time, so that the first negotiation device decrypts the received message ciphertext to obtain a message plaintext, and compares the message plaintext with the received message, when comparing the result When the same, continue the protocol stack type negotiation.
28、一种协议栈类型协商装置, 所述装置设置于与第一协商设备进行协议栈 类型协商的第二协商设备中, 其特征在于, 包括: 28. A protocol stack type negotiation device, wherein the device is configured to perform a protocol stack with a first negotiation device The second negotiation device of the type negotiation is characterized in that it includes:
协商请求消息接收单元, 用于接收第一协商设备发送的协商请求消息, 所述 协商请求消息中携带有所述第一协商设备支持的协议栈类型;  a negotiation request message receiving unit, configured to receive a negotiation request message sent by the first negotiation device, where the negotiation request message carries a protocol stack type supported by the first negotiation device;
协议栈类型获得单元,用于根据所述协商请求消息接收单元所接收的协商请 求消息中携带的所述第一协商设备支持的协议栈类型,选取所述第二协商设备与 所述第一协商设备共同支持的协议栈类型;  a protocol stack type obtaining unit, configured to select the second negotiation device to negotiate with the first negotiation device according to a protocol stack type supported by the first negotiation device that is carried in the negotiation request message received by the negotiation request message receiving unit The type of protocol stack supported by the device;
第一协商响应消息发送单元,用于根据所述协商请求消息接收单元接收的协 商请求消息向所述第一协商设备反馈第一协商响应消息,以使所述第一协商设备 根据所述第一协商响应消息,获得所述第二协商设备与所述第一协商设备共同支 持的协议栈类型。  a first negotiation response message sending unit, configured to feed back a first negotiation response message to the first negotiation device according to the negotiation request message received by the negotiation request message receiving unit, so that the first negotiation device is configured according to the first Negotiating the response message, obtaining a protocol stack type supported by the second negotiation device and the first negotiation device.
29、 根据权利要求 28所述的装置, 其特征在于, 还包括: The device according to claim 28, further comprising:
协议栈类型确定单元, 用于确定双方共同支持的至少一个协议栈类型; 所述第一协商响应消息发送单元所发送的第一协商响应消息中携带所述协 议栈类型确定单元所确定出的双方共同支持的至少一个协议栈类型,以使所述第 一协商设备从所述第一协商响应消息中,选择一个所述第二协商设备与所述第一 协商设备共同支持的协议栈类型。  a protocol stack type determining unit, configured to determine at least one protocol stack type supported by the two parties; the first negotiation response message sent by the first negotiation response message sending unit carries the two parties determined by the protocol stack type determining unit At least one protocol stack type that is commonly supported, so that the first negotiation device selects, from the first negotiation response message, a protocol stack type supported by the second negotiation device and the first negotiation device.
30、 根据权利要求 29所述的装置, 其特征在于: 30. Apparatus according to claim 29 wherein:
所述第一协商响应消息发送单元所发送的第一协商响应消息中还携带所述 第二协商设备预先设置的协议栈类型优先级,以使所述第一协商设备根据所述第 二协商设备预先设置的协议栈类型优先级,从所述第一协商响应消息中携带的所 述第二协商设备确定的双方共同支持的至少一个协议栈类型,选择一个所述第二 协商设备与所述第一协商设备共同支持的协议栈类型。  The first negotiation response message sent by the first negotiation response message sending unit further carries the protocol stack type priority set by the second negotiation device, so that the first negotiation device is configured according to the second negotiation device. Determining a protocol stack type priority, selecting at least one protocol stack type supported by the second negotiation device that is carried by the second negotiation device, and selecting one of the second negotiation device and the first A type of protocol stack that is commonly supported by the negotiation device.
31、 根据权利要求 28所述的装置, 其特征在于: 31. Apparatus according to claim 28 wherein:
所述协商请求消息接收单元所接收的协商请求消息还携带所述第一协商设 备预先设置的协议栈类型优先级;  The negotiation request message received by the negotiation request message receiving unit further carries a protocol stack type priority preset by the first negotiation device;
所述装置还包括:  The device also includes:
选取单元,用于在所述第一协商响应消息发送单元根据所述协商请求消息接 收单元接收的协商请求消息向所述第一协商设备反馈第一协商响应消息之前,根 据所述协商请求消息中携带的所述第一协商设备支持的协议栈类型和所述第一 协商设备预先设置的协议栈类型优先级,选取一个所述第二协商设备与所述第一 协商设备共同支持的协议栈类型; a selecting unit, configured to: before the first negotiation response message sending unit returns a first negotiation response message to the first negotiation device according to the negotiation request message received by the negotiation request message receiving unit, according to the negotiation request message The protocol stack type supported by the first negotiation device and the first Negotiating the protocol stack type priority set by the device, and selecting a protocol stack type supported by the second negotiation device and the first negotiation device;
所述第一协商响应消息携带所述选取单元选取的双方共同支持的一个协议 栈类型。  The first negotiation response message carries a protocol stack type supported by the two selected by the selecting unit.
32、 根据权利要求 28所述的装置, 其特征在于, 所述第一协商响应消息发 送单元所发送的第一协商响应消息中携带所述第二协商设备支持的协议栈类型, 以使所述第一协商设备根据所述第一协商响应消息中携带的所述第二协商设备 支持的协议栈类型,选取所述第二协商设备与所述第一协商设备共同支持的协议 栈类型。 The apparatus according to claim 28, wherein the first negotiation response message sent by the first negotiation response message sending unit carries a protocol stack type supported by the second negotiation device, so that the The first negotiation device selects a protocol stack type supported by the second negotiation device and the first negotiation device according to the protocol stack type supported by the second negotiation device that is carried in the first negotiation response message.
33、 根据权利要求 32所述的装置, 其特征在于, 所述第一协商响应消息发 送单元所发送的第一协商响应消息还携带所述第二协商设备预先设置的协议栈 类型优先级,以使所述第一协商设备根据所述第一协商响应消息中携带的所述第 二协商设备预先设置的协议栈类型优先级以及所述第二协商设备支持的协议栈 类型, 确定一个所述第二协商设备与所述第一协商设备共同支持的协议栈类型。 The apparatus according to claim 32, wherein the first negotiation response message sent by the first negotiation response message sending unit further carries a protocol stack type priority preset by the second negotiation device, Determining, by the first negotiation device, a protocol stack type priority preset by the second negotiation device that is carried in the first negotiation response message, and a protocol stack type supported by the second negotiation device, The protocol stack type supported by the second negotiation device and the first negotiation device.
34、 根据权利要求 28至 33任意一项所述的装置, 其特征在于, 还包括: 第二协商响应消息接收单元,用于接收所述第一协商设备所发送的第二协商 响应消息,所述第二协商响应消息中携带第一协商设备最终选取的双方共同支持 的一个协议栈类型。 The device according to any one of claims 28 to 33, further comprising: a second negotiation response message receiving unit, configured to receive a second negotiation response message sent by the first negotiation device, where The second negotiation response message carries a protocol stack type jointly supported by the two selected by the first negotiation device.
35、 根据权利要求 28至 34中任一权利要求所述的装置, 其特征在于, 还包 括: 35. Apparatus according to any one of claims 28 to 34, further comprising:
密钥交互单元,用于在所述协商请求消息接收单元接收第一协商设备发送的 协商请求消息之前, 与所述第一协商设备之间交互密钥信息, 以使所述第一协商 设备与所述第二协商设备根据所述密钥信息采用公私钥加解密机制进行协议栈 类型协商。  a key interaction unit, configured to exchange key information with the first negotiation device before the negotiation request message receiving unit receives the negotiation request message sent by the first negotiation device, so that the first negotiation device and the The second negotiating device performs protocol stack type negotiation by using a public-private key encryption and decryption mechanism according to the key information.
36、 根据权利要求 28至 34中任一权利要求所述的装置, 其特征在于, 还包 括: 36. Apparatus according to any one of claims 28 to 34, further comprising:
密钥共享单元,用于在所述协商请求消息接收单元接收第一协商设备发送的 协商请求消息之前, 与所述第一协商设备共享对称密钥; a key sharing unit, configured to receive, by the negotiation request message receiving unit, the first negotiation device Sharing a symmetric key with the first negotiation device before negotiating the request message;
解密单元,用于所述第二协商设备接收到第一协商设备在发送消息的同时发 送的消息密文后,根据所述密钥共享单元所共享的对称密钥对所述消息密文进行 解密, 得到消息明文, 其中, 所述消息密文为所述第一协商设备根据所述对称密 钥和获得的随机数对发送给所述第一协商设备的消息进行加密,所得到的消息密 文;  a decryption unit, configured to: after the second negotiation device receives the message ciphertext sent by the first negotiation device while sending the message, decrypt the message ciphertext according to the symmetric key shared by the key sharing unit And obtaining the message plaintext, where the message ciphertext is that the first negotiation device encrypts the message sent to the first negotiation device according to the symmetric key and the obtained random number, and the obtained message ciphertext ;
比较单元, 用于将所述解密单元得到的消息明文与接收到的消息进行比较, 当比较结果相同时, 继续进行协议栈类型协商;  a comparing unit, configured to compare the plaintext of the message obtained by the decrypting unit with the received message, and continue to perform protocol stack type negotiation when the comparison result is the same;
加密单元, 用于所述第二协商设备在向第一协商设备发送消息之前, 根据所 述密钥共享单元所共享的对称密钥和获得的随机数对发送给所述第一协商设备 的消息进行加密, 得到消息密文;  An encryption unit, configured to send, by the second negotiation device, a message sent to the first negotiation device according to a symmetric key shared by the key sharing unit and a obtained random number pair before sending the message to the first negotiation device Encryption to obtain a message ciphertext;
密文发送单元,用于在发送所述消息时同时发送所述加密单元得到的消息密 文, 以使所述第一协商设备对接收到的所述消息密文进行解密得到消息明文, 将 所述消息明文与接收到的消息进行比较, 当比较结果相同时, 继续进行协议栈类 型协商。  a ciphertext sending unit, configured to send a message ciphertext obtained by the ciphering unit when the message is sent, so that the first negotiating device decrypts the received message ciphertext to obtain a message plaintext, The plaintext of the message is compared with the received message, and when the comparison result is the same, the protocol stack type negotiation is continued.
PCT/CN2012/082286 2012-09-28 2012-09-28 Protocol stack type negotiation method and device WO2014047868A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2012/082286 WO2014047868A1 (en) 2012-09-28 2012-09-28 Protocol stack type negotiation method and device
CN201280001793.8A CN103843449A (en) 2012-09-28 2012-09-28 Protocol stack type negotiation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/082286 WO2014047868A1 (en) 2012-09-28 2012-09-28 Protocol stack type negotiation method and device

Publications (1)

Publication Number Publication Date
WO2014047868A1 true WO2014047868A1 (en) 2014-04-03

Family

ID=50386844

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/082286 WO2014047868A1 (en) 2012-09-28 2012-09-28 Protocol stack type negotiation method and device

Country Status (2)

Country Link
CN (1) CN103843449A (en)
WO (1) WO2014047868A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016114688A1 (en) * 2015-01-12 2016-07-21 Telefonaktiebolaget Lm Ericsson (Publ) Communication device, gateway node and methods for preparing a point-to-point session
GB2524987B (en) * 2014-04-08 2018-09-19 Samsung Electronics Co Ltd Sharing a session key between devices
WO2023082894A1 (en) * 2021-11-10 2023-05-19 杭州萤石软件有限公司 Authentication method between terminal side device and network side device, and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1455570A (en) * 2002-05-01 2003-11-12 微软公司 Method for wireless finding warder and consulting agreement and wireless device including said agreement
CN1534935A (en) * 2003-03-31 2004-10-06 华为技术有限公司 Key distribution method based on preshared key
CN101388881A (en) * 2007-09-13 2009-03-18 华为技术有限公司 Method, network element and system for communication protocol version negotiation

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8199745B2 (en) * 2008-12-29 2012-06-12 At&T Intellectual Property I, L.P. Method and apparatus for generalized third-party call control in session initiation protocol networks
TW201117589A (en) * 2009-11-02 2011-05-16 Inventec Corp Negotiation method and negotiation system for connection protocol

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1455570A (en) * 2002-05-01 2003-11-12 微软公司 Method for wireless finding warder and consulting agreement and wireless device including said agreement
CN1534935A (en) * 2003-03-31 2004-10-06 华为技术有限公司 Key distribution method based on preshared key
CN101388881A (en) * 2007-09-13 2009-03-18 华为技术有限公司 Method, network element and system for communication protocol version negotiation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ROBERT, H. ET AL., KEY MANAGEMENT INTEROPERABILITY PROTOCOL SPECIFICATION VERSION 1.1, 4 January 2012 (2012-01-04), pages 90 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2524987B (en) * 2014-04-08 2018-09-19 Samsung Electronics Co Ltd Sharing a session key between devices
WO2016114688A1 (en) * 2015-01-12 2016-07-21 Telefonaktiebolaget Lm Ericsson (Publ) Communication device, gateway node and methods for preparing a point-to-point session
EP3245842B1 (en) * 2015-01-12 2019-11-13 Telefonaktiebolaget LM Ericsson (publ) Communication device, gateway node and methods for preparing a point-to-point session
US10742495B2 (en) 2015-01-12 2020-08-11 Telefonaktiebolaget Lm Ericsson (Publ) Communication device, gateway node and methods for preparing a point-to-point session
WO2023082894A1 (en) * 2021-11-10 2023-05-19 杭州萤石软件有限公司 Authentication method between terminal side device and network side device, and system

Also Published As

Publication number Publication date
CN103843449A (en) 2014-06-04

Similar Documents

Publication Publication Date Title
EP3541051B1 (en) Acceleration method for handshake request in content delivery network, device and edge node
US8843747B2 (en) Communication apparatus and communication system
WO2018019069A1 (en) Resource operation method and apparatus
WO2019114703A1 (en) Secure communication method, apparatus and device
US11736304B2 (en) Secure authentication of remote equipment
US9350711B2 (en) Data transmission method, system, and apparatus
WO2011023082A1 (en) Method, device and network system for negotiating encryption information
WO2009076811A1 (en) A method, a system, a client and a server for key negotiating
JP2004254027A (en) Server device, key managing device, and encryption communication method and program
CN103947176A (en) Network-assisted peer-to-peer secure communication establishment
WO2014180352A1 (en) Method, device, and system for configuring wireless device
WO2009143766A1 (en) Method, system for distributing key and method, system for online updating public key
WO2009129734A1 (en) Method, system and device for acquiring key
CN110601825B (en) Ciphertext processing method and device, storage medium and electronic device
WO2017075134A1 (en) Key management for privacy-ensured conferencing
CA3066728A1 (en) Cloud storage using encryption gateway with certificate authority identification
US20230080139A1 (en) Communication method and communications apparatus
WO2009062406A1 (en) Method, system and device for https encryption and accessing
WO2010083695A1 (en) Method and apparatus for securely negotiating session key
WO2023231817A1 (en) Data processing method and apparatus, and computer device and storage medium
CN115314214A (en) TLS protocol implementation method based on support of hardware acceleration cryptographic algorithm
US8793494B2 (en) Method and apparatus for recovering sessions
CN108040071A (en) A kind of VoIP audio-video encryptions key dynamic switching method
JP2011176395A (en) IPsec COMMUNICATION METHOD AND IPsec COMMUNICATION SYSTEM
WO2014047868A1 (en) Protocol stack type negotiation method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12885774

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12885774

Country of ref document: EP

Kind code of ref document: A1