WO2021036183A1 - 通过证书签发进行多方安全计算的方法及装置 - Google Patents

通过证书签发进行多方安全计算的方法及装置 Download PDF

Info

Publication number
WO2021036183A1
WO2021036183A1 PCT/CN2020/072112 CN2020072112W WO2021036183A1 WO 2021036183 A1 WO2021036183 A1 WO 2021036183A1 CN 2020072112 W CN2020072112 W CN 2020072112W WO 2021036183 A1 WO2021036183 A1 WO 2021036183A1
Authority
WO
WIPO (PCT)
Prior art keywords
certificate
trusted
task
computing
tls
Prior art date
Application number
PCT/CN2020/072112
Other languages
English (en)
French (fr)
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 US16/813,524 priority Critical patent/US11038699B2/en
Publication of WO2021036183A1 publication Critical patent/WO2021036183A1/zh
Priority to US17/244,854 priority patent/US11228450B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0825Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using asymmetric-key encryption or public key infrastructure [PKI], e.g. key signature or public key certificates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/083Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) involving central third party, e.g. key distribution center [KDC] or trusted third party [TTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3263Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
    • H04L9/3265Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements using certificate chains, trees or paths; Hierarchical trust model

Definitions

  • One or more embodiments of this specification relate to the field of distributed computing and secure computing, and in particular to methods and devices for multi-party secure computing.
  • the trusted computing unit in the Trusted Execution Environment is often used for trusted computing and data processing.
  • the trusted computing unit can ensure that the code execution is safe. Including the operating system or drivers, etc., the internal runtime memory and other secrets cannot be obtained.
  • a trusted computing unit can be used to run program codes and perform calculation tasks to ensure the safety of program code execution and isolation from the outside world.
  • the trusted computing unit Before the trusted computing unit communicates with other parties, such as communicating with a user terminal or communicating with other trusted computing units, a common encryption key is usually obtained through negotiation. It is impossible for anyone to crack the key except for the communicating parties. The data transmission between the two parties is encrypted by the key obtained through the negotiation. In this way, we call it that the trusted computing unit establishes a trusted channel with other parties, and can safely transmit confidential data on the trusted channel.
  • multi-party secure computing based on multiple trusted computing units.
  • some distributed tasks need to perform multiple computing tasks in multiple trusted computing units to complete cooperatively, for example, task 1, task 2, and task 3 need to be completed in cooperation.
  • the user terminal may need to communicate with multiple trusted computing units running the above multiple computing tasks to obtain computing services, and these multiple trusted computing units also need to communicate with each other to complete computing tasks.
  • a trusted channel needs to be established between the user terminal and the trusted computing unit, and between multiple trusted computing units. If key agreement is performed separately and separate trusted channels are established respectively, when the number of trusted computing units increases, the communication process of multi-party computing will become complicated and cumbersome, and the cost will be high.
  • One or more embodiments of this specification describe a method and device for multi-party secure computing, in which each trusted computing unit running each computing task in the task group and the user terminal requesting the computing service of the task group are distributed in the certificate chain. Corresponding certificates ensure secure multi-party communication and calculations between the user terminal and each trusted computing unit.
  • a method for obtaining a certificate for multi-party secure computing is provided, which is executed by a first computing unit running a first computing task, the first computing task being pre-configured to belong to a first task group, and The first task group also includes at least one other computing task; the method includes:
  • the trusted certificate generator Send a first certificate request to the trusted certificate generator, where the first certificate request includes the first group identifier of the first task group and first authentication information, where the first authentication information is used for the first computing unit Perform trusted authentication, and include the first code hash of the first calculation task;
  • a first certificate report is received from the trusted certificate generator, the first certificate report includes a first certificate chain and a first private key generated for the first group of identifiers, and the first certificate chain includes a first root A certificate and a corresponding first public key certificate, where the first public key certificate matches the first private key to form a first certificate pair;
  • the first computing unit is used as the TLS server that provides the computing service of the first computing task, the first certificate pair is set as the certificate pair of the TLS server, and the first computing unit is used as the The TLS client connected to the at least one other computing task sets the first root certificate as a trusted root certificate of the TLS client.
  • the first calculation unit is implemented as a trusted enclave.
  • the method before sending the first authentication request to the trusted certificate generator, the method further includes:
  • the unit report file including the first code hash and signature information of the first calculation unit
  • the authentication result file is included in the first certificate request as the first authentication information.
  • the method before sending the first authentication request to the trusted certificate generator, the method further includes:
  • the first computing unit before sending the first authentication request to the trusted certificate generator, performs key agreement with the trusted certificate generator to establish a trusted channel, and the trusted channel is used to send The first certificate request, and receiving the first certificate report.
  • a method for distributing a certificate to a computing unit which is executed by a trusted certificate generator, and the method includes:
  • a first certificate request is received from a first computing unit running a first computing task, where the first certificate request includes a first group identifier of the first task group, and first authentication information, where the first authentication information is used to The first calculation unit performs authentication and includes the first code hash of the first calculation task;
  • the first computing task In the case of confirming that the first computing task belongs to the first task group, obtain a first certificate chain and a first private key that are generated in advance for the first group identifier, and the first certificate chain includes a first root A certificate and a corresponding first public key certificate, where the first public key certificate matches the first private key to form a first certificate pair;
  • the first computing unit uses itself as a TLS service for providing computing services Setting the first certificate pair as the certificate pair of the TLS server and setting the first root certificate as the trusted root certificate of the TLS client and the TLS client connected with other computing tasks.
  • the first certification information is a certification result file certified by a third-party certification body, and the certification result file contains signature information of the third-party certification body;
  • the certification of the first computing unit includes:
  • the signature information is verified, and if the verification is successful, it is determined that the first computing unit has passed the authentication.
  • the first authentication information is a unit report file generated by the first calculation unit, and the unit report file includes the first code hash, and the first calculation unit Signature information; in this case, authenticating the first computing unit includes:
  • the signature information is verified, and if the verification is successful, it is determined that the first computing unit has passed the authentication.
  • the trusted certificate manager before receiving the first certificate request from the first computing unit running the first computing task, receives the first generation command from the configuration manager, and the first The generation command includes the first group identifier and a first hash list corresponding to the first group identifier, where the first hash list includes code hashes of all computing tasks belonging to the first task group; For the first group identification, the first certificate chain and the first private key are generated.
  • the first hash list including code hashes of all computing tasks belonging to the first task group;
  • the first public key certificate includes a first public key generated for the first group identification, and first signature information signed by the trusted certificate generator, wherein the The first public key and the first private key constitute a key pair;
  • the first root certificate includes a second public key generated for the first group of identifiers, and a self-signed second public key of the trusted certificate generator Second signature information;
  • the second public key is used to verify the first signature information and the second signature information.
  • the first public key certificate includes a first public key generated for the first group of identifiers, and first signature information signed by the trusted certificate generator, wherein The first public key and the first private key constitute a key pair; the first root certificate includes the first public key, and second signature information self-signed by the trusted certificate generator; A public key is used to verify the first signature information and the second signature information.
  • the trusted certificate generator before receiving the first certificate request from the first computing unit running the first computing task, the trusted certificate generator conducts key negotiation with the first computing unit to establish a trusted channel The trusted channel is used to receive the first certificate request and send the first certificate report.
  • a method for obtaining a certificate for multi-party secure computing which is executed by a user terminal, and the method includes:
  • a second certificate report is received from the trusted certificate generator, the second certificate report includes at least the first root certificate in the first certificate chain generated for the first group of identifiers, and the first certificate chain further includes A first public key certificate corresponding to the first root certificate; the first public key certificate and the matched first private key constitute a first certificate pair, which is pre-distributed to the authenticated group that runs the first task At least one computing unit of each computing task in the
  • the first root certificate is set as the trusted root certificate of the TLS client, so as to be calculated with the at least one that has the first certificate pair and functions as a TLS server Unit communication.
  • the method before sending the second certificate request to the trusted certificate generator, the method further includes:
  • the trusted certificate generator is authenticated.
  • the second certification information is a certification result file certified by a third-party certification body, and the certification result file contains signature information of the third-party certification body;
  • the authenticating the trusted certificate generator according to the second authentication information includes:
  • the signature information is verified, and if the verification is successful, it is determined that the trusted certificate generator has passed the authentication.
  • the second authentication information is a report file generated by the trusted certificate generator, and the report file includes code hash and signature information of the trusted certificate generator;
  • the authenticating the trusted certificate generator according to the second authentication information includes:
  • the signature information is verified, and if the verification is successful, it is determined that the certificate generator has passed the authentication.
  • the second certificate report further includes a first hash list corresponding to the first group identifier, and the first hash list includes all calculations belonging to the first task group The code hash of the task;
  • the method Before setting the first root certificate as the trusted root certificate of the TLS client, the method further includes determining whether the first hash list meets expectations.
  • the method further includes:
  • the second certificate report further includes the first public key certificate
  • the method further includes: encrypting user data of the user terminal by using the first public key certificate, and The encrypted user data is stored in the data platform for the at least one computing unit to decrypt and obtain by using the first certificate.
  • a method for distributing a certificate to a user terminal which is executed by a trusted certificate generator, and the method includes:
  • first certificate chain and a first private key generated in advance for the first group of identifiers the first certificate chain including a first root certificate and a first public key certificate corresponding to the first root certificate, the first public key certificate and The first private key matches to form a first certificate pair; at least the first certificate pair is pre-distributed to at least one computing unit that is authenticated and runs each computing task in the first task group;
  • the second certificate report including at least the first root certificate, so that the user terminal regards itself as the TLS client and the first root certificate as the TLS client's A trusted root certificate, so as to communicate with the at least one computing unit having the first certificate pair and acting as a TLS server.
  • the method before receiving the second certificate request sent by the user terminal, the method further includes:
  • second authentication information is provided to the user terminal for the user terminal to perform authentication.
  • providing the second authentication information to the user terminal includes:
  • the report file including the code hash and signature information of the trusted certificate generator itself;
  • providing the second authentication information to the user terminal includes:
  • the report file including the code hash and signature information of the trusted certificate generator itself;
  • the report file is provided to the user terminal as the second authentication information.
  • the second certificate report further includes a first hash list corresponding to the first group identifier, and the first hash list includes all computing tasks belonging to the first task group The code hash.
  • the second certificate report further includes the first public key certificate, so that the user terminal uses the first public key certificate to encrypt user data.
  • a fifth aspect there is provided a method for multi-party secure computing through a digital certificate, which is executed by a first computing unit running a first computing task, wherein:
  • the first computing task is pre-configured to belong to a first task group, and the first task group further includes a second computing task run by a second computing unit;
  • the first computing unit is pre-distributed with a first certificate pair and a first root certificate generated for the first task grouping, and the first certificate pair includes a first public key certificate and a matching first private key, so The first public key certificate and the first root certificate constitute a first certificate chain;
  • the first computing unit is configured as a first TLS server that provides computing services for the first computing task, and the first TLS server uses the first certificate pair as its certificate pair;
  • the computing unit is also configured as a first TLS client connected to at least the second computing unit, and the first TLS client uses the first root certificate as its trusted root certificate;
  • the method includes:
  • the first TLS server uses the first root certificate as its trusted root certificate;
  • the first application data is transmitted to the second computing unit through the second TLS trusted channel.
  • the method further includes reading second user data from a data platform, the second user data being encrypted and generated by the user terminal using the first public key certificate;
  • the method further includes:
  • the second encrypted application data is stored in a data platform for the second computing unit to decrypt and obtain by using the first certificate.
  • an apparatus for obtaining a certificate for multi-party secure computing which is deployed in a first computing unit running a first computing task, the first computing task being pre-configured to belong to a first task group, so The first task group further includes at least one other computing task; the device includes:
  • the first certificate request module is configured to send a first certificate request to the trusted certificate generator, the first certificate request including the first group identifier of the first task group, and first authentication information, the first authentication The information is used to perform trusted authentication on the first computing unit, and includes the first code hash of the first computing task;
  • the first report receiving module is configured to receive a first certificate report from the trusted certificate generator, the first certificate report including a first certificate chain and a first private key generated for the first group of identifications, the The first certificate chain includes a first root certificate and a corresponding first public key certificate, and the first public key certificate matches the first private key to form a first certificate pair;
  • the first setting module is configured to use the first computing unit as the TLS server that provides the computing service of the first computing task, and set the first certificate pair as the certificate pair of the TLS server; and
  • the first computing unit serves as a TLS client connected to the at least one other computing task, and sets the first root certificate as a trusted root certificate of the TLS client.
  • an apparatus for distributing certificates for computing units which is deployed in a trusted certificate generator, and the apparatus includes:
  • the first request receiving module is configured to receive a first certificate request from a first computing unit running a first computing task, the first certificate request including a first group identifier of the first task group, and first authentication information, the The first authentication information is used to authenticate the first computing unit, and includes the first code hash of the first computing task;
  • a unit authentication module configured to authenticate the first computing unit according to the first authentication information
  • a grouping judgment module configured to judge whether the first calculation task belongs to the first task group according to the first code hash when the authentication is passed;
  • the certificate obtaining module is configured to obtain a first certificate chain and a first private key that are generated in advance for the first group of identifiers in the case of confirming that the first computing task belongs to the first task group, and the first
  • the certificate chain includes a first root certificate and a corresponding first public key certificate, and the first public key certificate matches the first private key to form a first certificate pair;
  • the first report sending module is configured to send a first certificate report to the first calculation unit, the first certificate report including the first root certificate and the first certificate pair, so that the first calculation unit is It is a TLS server that provides computing services and a TLS client connected to other computing tasks, the first certificate pair is set as the certificate pair of the TLS server, and the first root certificate is set as the trusted root of the TLS client certificate.
  • a device for obtaining a certificate for multi-party secure computing which is deployed in a user terminal, and the device includes:
  • a second request sending module configured to send a second certificate request to the trusted certificate generator, the second certificate request including the first group identifier of the first task group that is expected to be connected;
  • a second report receiving module configured to receive a second certificate report from the trusted certificate generator, the second certificate report including at least the first root certificate in the first certificate chain generated for the first group of identifiers,
  • the first certificate chain also includes a first public key certificate corresponding to the first root certificate; the first public key certificate and the matched first private key form a first certificate pair, which is distributed in advance to certified 1. Run at least one computing unit of each computing task in the first task group;
  • the second configuration module is configured to use the user terminal as a TLS client, and set the first root certificate as the trusted root certificate of the TLS client, so as to have the first certificate pair and function as TLS
  • the at least one computing unit of the server communicates.
  • a device for distributing a certificate to a user terminal which is deployed in a trusted certificate generator, and the device includes:
  • a second request receiving module configured to receive a second certificate request sent by the user terminal, the second certificate request including the first group identifier of the first task group to which the user terminal expects to connect;
  • the certificate acquisition module is configured to acquire a first certificate chain and a first private key generated in advance for the first group of identifiers, the first certificate chain including a first root certificate and a first public key certificate corresponding to the first root certificate, and The first public key certificate matches the first private key to form a first certificate pair; at least the first certificate pair is pre-distributed to at least one of the certified calculation tasks that runs each calculation task in the first task group unit;
  • the second report sending module is configured to send a second certificate report to the user terminal, the second certificate report including at least the first root certificate, so that the user terminal regards itself as a TLS client and transfers the The first certificate serves as a trusted root certificate of the TLS client, so as to communicate with the at least one computing unit having the first certificate pair and acting as a TLS server.
  • a device for multi-party secure computing through digital certificates is provided, which is deployed in a first computing unit running a first computing task, wherein:
  • the first computing task is pre-configured to belong to a first task group, and the first task group further includes a second computing task run by a second computing unit;
  • the first computing unit is pre-distributed with a first certificate pair and a first root certificate generated for the first task grouping, and the first certificate pair includes a first public key certificate and a matching first private key, so The first public key certificate and the first root certificate constitute a first certificate chain;
  • the first computing unit is configured as a first TLS server that provides computing services for the first computing task, and the first TLS server uses the first certificate pair as its certificate pair;
  • the computing unit is also configured as a first TLS client connected to at least the second computing unit, and the first TLS client uses the first root certificate as its trusted root certificate;
  • the device includes:
  • the first handshake module is configured to use the first TLS server to perform a TLS handshake with a user terminal acting as a second TLS client to establish a first TLS trusted channel; wherein the second TLS client connects the first Root certificate as its trusted root certificate;
  • a data receiving module configured to receive first user data through the first TLS trusted channel
  • a data processing module configured to perform first processing on the first user data to obtain first application data
  • the second handshake module is configured to perform a TLS handshake between the first TLS client and the second computing unit acting as the second TLS server to establish a second TLS trusted channel; wherein the second TLS server connects the The first certificate pair is its certificate pair;
  • the data sending module is configured to transmit the first application data to the second computing unit through the second TLS trusted channel.
  • a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the methods of the first aspect to the fifth aspect.
  • a computing device including a memory and a processor, characterized in that executable code is stored in the memory, and when the processor executes the executable code, the first aspect to the The fifth aspect of the method.
  • a trusted certificate generator is used to generate and distribute certificates to achieve security authentication and verification, which facilitates multi-party secure communication and calculations between the user terminal and the trusted computing unit.
  • computing tasks are grouped in advance to form task groups.
  • the trusted certificate generator distinguishes different task groups through the group ID, and generates a set of certificate chain and a private key for a group ID.
  • the certificate chain includes the root certificate and the corresponding public key certificate, and the public key certificate matches the private key. Form a certificate pair.
  • the trusted certificate generator distributes the above-mentioned root certificate and certificate pair to each trusted computing unit that is authenticated and runs each computing task corresponding to the group ID.
  • the trusted certificate generator distributes the above-mentioned root certificate to the user terminal requesting the computing service of the task group. Therefore, a user terminal with a root certificate and a trusted computing unit with a root certificate and a certificate pair can perform multi-party secure communication through the TLS protocol.
  • Figure 1 is a schematic diagram of an implementation scenario of an embodiment disclosed in this specification
  • Fig. 2 shows a schematic diagram of a process of grouping configuration through a configuration manager according to an embodiment
  • Figure 3 shows a certificate chain and certificate pair of a digital certificate in an example
  • FIG. 4 shows a schematic diagram of a process of issuing a certificate for a computing unit according to an embodiment
  • Figure 5 shows the first certificate chain in one embodiment
  • Figure 6 shows the first certificate chain in another embodiment
  • FIG. 7 shows the state of each computing unit after performing the process shown in FIG. 4;
  • FIG. 8 shows a schematic diagram of a process of distributing a certificate to a user terminal according to an embodiment
  • FIG. 9 shows the state of the system after performing the processes shown in Figures 4 and 8;
  • FIG. 10 shows a flowchart of a method for performing multi-party security calculations in an embodiment
  • FIG. 11 shows a schematic block diagram of an apparatus for obtaining a certificate deployed in a first computing unit in an embodiment
  • Fig. 12 shows a schematic block diagram of an apparatus for distributing certificates for computing units in an embodiment
  • FIG. 13 shows a schematic block diagram of an apparatus for obtaining a certificate deployed in a user terminal in an embodiment
  • FIG. 14 shows a schematic block diagram of an apparatus for distributing certificates for user terminals in an embodiment
  • Fig. 15 shows a schematic block diagram of an apparatus for performing multi-party calculations deployed in a first calculation unit in an embodiment.
  • Fig. 1 is a schematic diagram of an implementation scenario of an embodiment disclosed in this specification.
  • the required computing tasks can be performed by the trusted computing unit in the trusted execution environment TEE.
  • the trusted computing unit may be a computing module or computing device that has a certain isolation capability to ensure computing security, such as a trusted computing enclave, for example, implemented by using technologies such as SGX or Trust Zone.
  • a trusted computing enclave for example, implemented by using technologies such as SGX or Trust Zone.
  • SGX a series of CPU instruction codes, allowing user code to create a private memory area with high access rights to form a computing enclave.
  • each trusted computing unit (for example, each enclave) performs its own computing task.
  • the trusted computing unit 11, 12, 13, 14 perform different computing tasks, task 1, task 2.
  • multiple trusted computing units running multiple computing tasks may need to work together to perform multi-party calculations.
  • task 1, task 2, and task 3 need to be coordinated to provide a set of computing services.
  • each computing task is grouped in advance, and computing tasks executing the same distributed task are divided into the same group.
  • the trusted certificate generator 20 is used to generate digital certificates and manage the digital certificates based on task groupings. Through the generation and distribution management of the certificates, the user terminal and multiple trusted computing units are encouraged to perform multi-party secure computing.
  • the trusted certificate generator 20 distinguishes each task group according to the group identifier. For a certain task group, such as the first task group, the trusted certificate generator generates a set of certificate chains and a private key for it.
  • the certificate chain includes a public key certificate and a corresponding root certificate.
  • the public key certificate is the same as the above The private keys match to form a certificate pair.
  • the trusted certificate generator distributes the root certificate and the certificate pair to each trusted computing unit that is authenticated and runs each computing task in the first task group. Therefore, multiple trusted computing units running various computing tasks in the same task group will obtain the same certificate pair and root certificate.
  • the trusted certificate generator distributes the root certificate in the above-mentioned certificate chain to the user terminal 30 requesting the computing service of the first task group.
  • a certain trusted computing unit that runs a certain computing task in the first task group, it can be used as the transport layer security protocol TLS server that provides computing services, and the above certificate pair is set as the certificate pair of the TLS server.
  • the trusted computing unit can also be used as a TLS client connected to other computing units in the same task group, and the above-mentioned root certificate can be set as the trusted root certificate of the TLS client.
  • the user terminal requesting the computing service of the first task group it can be used as a TLS client, and the root certificate distributed to the user terminal can be set as the trusted root certificate of the TLS client.
  • the TLS client Since the above certificate pair and the root certificate constitute a set of certificate chains, and the TLS client will only shake hands with the TLS server that has the corresponding certificate pair in the same certificate chain, it is guaranteed that the user terminal requesting the first task group will only communicate with The trusted computing units running each computing task in the first task group perform handshake, and the trusted computing units running each computing task in the first task group can shake hands with each other to establish a trusted channel, thereby realizing multi-party secure computing .
  • each computing task groups are set for each computing task, so that multiple computing tasks that execute the same distributed task form a task group. Assign a group ID to the formed task group. Therefore, each task group has a corresponding group ID. After that, each computing task is made to know the group identification of the task group to which it belongs, and in addition, the trusted certificate generator is made to know the grouping information, so as to generate a certificate chain for each group.
  • the above-mentioned task grouping configuration is performed by a configuration manager, and the configuration manager notifies the trusted certificate generator and each computing task of the grouping configuration information.
  • Fig. 2 shows a schematic diagram of a process of grouping configuration through a configuration manager according to an embodiment.
  • the configuration manager may receive a group configuration request or configuration operation performed by the configuration personnel, where it is instructed to classify multiple computing tasks into one task group, which is referred to as the first task group for simplicity.
  • the above-mentioned configuration personnel may be an administrator of a configuration manager, an administrator of a distributed computing system, or even a user requesting computing services.
  • the configuration manager assigns a group identifier to the first task group formed by the classification, which is called the first group identifier, and establishes the first group identifier and the above-mentioned information contained in the first task group. Correspondence of multiple computing tasks.
  • the configuration personnel can set in the configuration manager, the three computing tasks Computing tasks are classified into a task group. Therefore, the configuration manager assigns the group identifier GID1 to the task group, and establishes the corresponding relationship between the group identifier GID1 and task 1, task 2, and task 3.
  • step 202 the configuration manager notifies the multiple computing tasks included in the first task group of the above-mentioned first group identifier.
  • the group identification GID1 is notified to task 1, task 2 and task 3 respectively.
  • the configuration manager sends a configuration notification to the trusted certificate generator.
  • the notification includes a first group identifier and a first hash list corresponding to the first group identifier.
  • the list includes code hashes of all computing tasks belonging to the first task group.
  • the configuration manager can form a hash list 1 corresponding to the group ID GID1, which includes the above three calculation tasks, task 1, task 2, and The respective codes of task 3 are hashed H1, H2, and H3. Therefore, the configuration manager can send a configuration notification for the above task grouping to the trusted certificate generator, which includes the group identifier GID1 and the corresponding hash list 1: ⁇ H1, H2, H3 ⁇ .
  • steps 202 and 203 can be performed in any order.
  • the trusted certificate generator after receiving the above configuration notification, the trusted certificate generator records the corresponding relationship between the first group identifier and the first hash list for subsequent verification, and generates the corresponding certificate in the subsequent certificate issuance phase. certificate.
  • the trusted certificate generator uses the above configuration notification as a certificate generation request, and generates the certificate accordingly. Specifically, in step 204, the trusted certificate generator determines whether there is a certificate chain corresponding to the first group of identifiers; if it exists, it rejects the generation request and does not generate it again; if not, it generates the first group of identifiers for the first group of identifiers. A certificate chain and a first private key, where the first certificate chain includes a first root certificate and a corresponding first public key certificate, and the first public key certificate matches the first private key to form a first certificate pair.
  • a digital certificate is an electronic document issued by a certificate authority CA (Certificate Authority) and used to verify the legitimacy of the holder's identity to prevent impersonation by a third party.
  • a digital certificate includes holder information, holder public key, issuer information, and issuer's signature. Since the digital certificate contains the public key generated for the holder, such a digital certificate is also called a public key certificate.
  • the issuing authority will also generate a private key corresponding to the holder's public key, and the public key and the private key form a key pair for asymmetric encryption. At this time, the public key certificate and the private key form a certificate pair.
  • Fig. 3 shows the certificate chain and certificate pair of the digital certificate in an example.
  • the digital certificate 33 is a public key certificate issued by the issuing authority CA1 to the holder U1
  • the certificate 33 includes the holder U1 information, the holder U1 public key K1, the issuer CA1 information, and the issuer CA1 Signature.
  • the issuer CA1 also generates a private key k1 corresponding to the public key K1, so the certificate 33 and the private key k1 form a certificate pair.
  • the public key of the issuer CA1 can be used for verification. However, if the verifier does not trust the issuer CA1 enough, then it is necessary to go back up and obtain the certificate of CA1 to verify whether CA1 is legal and trustworthy. Therefore, it can be traced back to the certificate 32, which is a certificate issued by the issuing authority CA2 to CA1, which includes CA1 information (at this time CA1 is the certificate holder), CA1 public key, issuer CA2 information, and issuer CA2 Signature. The verifier can use the CA1 public key in the certificate 32 to verify the CA1 signature in the certificate 33. However, if the verifier still does not trust the issuing authority CA2 enough, it needs to continue to trace upwards until the final root certificate 30 is reached.
  • the root certificate is a certificate issued by the root CA itself.
  • the root CA is generally the most authoritative CA center and must be trusted.
  • the root certificate 30 includes root CA information (the root CA is both the holder and the issuer), the root CA public key, and the signature information of the root CA itself.
  • the root certificate 30 and each public key certificate form a certificate chain or trust chain, where the root certificate is issued to itself by the root CA, and the subsequent public key certificates are issued by the root CA and all levels of CA authorized by the root CA.
  • the root certificate is the starting point of the certificate chain, and the number of levels of the certificate chain depends on the actual situation.
  • the certificate generator in step 204, the certificate generator generates a first certificate chain for the first task group of the current request, and the certificate chain includes the first public key certificate generated for the first group of identifications.
  • the trusted certificate generator serves as the first root certificate self-signed by the root CA, and the first root certificate and the first public key certificate form a certificate chain.
  • the trusted certificate generator also generates a first private key, and the first private key matches the public key in the first public key certificate to form a first certificate pair.
  • Such a first certificate chain and a first private key are used for subsequent distribution to user terminals and a trusted computing unit that runs each computing task in the first task group.
  • FIG. 2 shows the process of task grouping configuration through the configuration manager.
  • task grouping configuration can also be implemented in other ways.
  • the configuration personnel can directly configure the trusted certificate generator and various computing tasks.
  • the trusted certificate generator has a configuration interface through which configuration personnel can directly input computing task grouping information to the trusted certificate generator, including the group identification of the task group and the corresponding Harbin It is hoped that the trusted certificate generator can record the above grouping information, and optionally generate a corresponding certificate chain for each group ID.
  • the configuration personnel can also configure the startup item of the computing task or the startup item of the trusted computing unit to set the group identifier of the task group to which each computing task belongs. In this way, the task grouping information is configured to each computing task and the trusted certificate generator.
  • the trusted certificate generator can issue certificates for the trusted computing unit and the user terminal respectively, so as to implement multi-party secure computing between them.
  • Fig. 4 shows a schematic diagram of a process of issuing a certificate for a computing unit according to an embodiment.
  • the trusted certificate generator distributes the digital certificate to the first computing unit running the first computing task, so as to facilitate its subsequent participation in multi-party computing related to computing services.
  • the first computing task may be any computing task, and the first computing unit may be any trusted computing unit that executes the task.
  • the first computing task is pre-configured as belonging to a certain task group, which is referred to herein as a first task group. It can be understood that the first task group may also include at least one other computing task.
  • the first computing task in FIG. 4 can be any one of task 1, task 2, and task 3.
  • the first computing unit can be any one of trusted computing units 11, 12, and 13. More specifically, it can be assumed that the first computing task is task 1, and the first computing unit is trusted computing unit 11.
  • step 401 when the first computing task is started in the first computing unit, first authentication information is generated for other parties to perform trusted authentication on the first computing unit.
  • This trusted authentication is generally implemented through remote authentication RA (Remote Attestation). Therefore, the generated authentication information is also called RA information or RA report.
  • the first computing unit generates a unit report file of the computing unit as the above-mentioned first authentication information, wherein the unit report file is used to describe the configuration status and operating status of the first computing unit itself.
  • the unit report file includes at least the code hash of the first calculation task running therein, which is called the first code hash. It can be understood that the first code hash can uniquely identify the running first computing task.
  • the unit report may also include other description information of the first computing task running therein, such as name, version, attribute information, and so on.
  • the above-mentioned unit report file also includes the signature information of the first computing unit, so as to ensure the authenticity of the unit report file and prevent forgery and tampering.
  • the signature information can be obtained through various signature methods, such as hash algorithms, encryption algorithms, and so on.
  • the signature information depends on the hardware key corresponding to the first computing unit, and the hardware key uniquely corresponds to the physical hardware. This ensures that the signature information in the unit report file is indeed generated by a trusted computing unit based on the hardware. The unit is produced.
  • the above-mentioned unit report file further includes hardware information of the first computing unit, such as CPU frequency, memory capacity, and so on.
  • the above-mentioned unit report file further includes runtime environment information of the first computing unit, so as to more comprehensively describe the current operating status.
  • the unit report file may also include other user-defined data to describe and define other information of the trusted computing unit as required.
  • the unit report file generated above can be used as the first authentication information for other parties to perform trusted authentication on the first computing unit.
  • the first calculation unit after generating the above-mentioned unit report file, the first calculation unit sends the unit report file to a third-party certification agency for authentication to obtain the authentication result file, thereby using the authentication result file as the first authentication information.
  • third-party certification bodies are credible and authoritative certification bodies with certification capabilities.
  • each trusted computing unit will be registered with the third-party certification authority before being put into use. Therefore, the third-party certification structure registers the configuration status of each trusted computing unit, so that it can be subsequently authenticated.
  • the third-party certification authority is an Intel certification server (Attestation Service).
  • the third-party certification body may be an organization that produces and deploys the corresponding computing unit or its associated organization.
  • the third-party certification authority can authenticate the security and credibility of the first computing unit based on the unit report. Specifically, the third-party certification authority first verifies whether the unit report file is authentic and tamper-free based on the signature information in the unit report file, and judges whether the first computing unit is indeed authentic based on the information registered in advance by each trusted computing unit maintained . In addition, the third-party certification agency also verifies whether the program code of the first calculation task runs in a trusted execution environment according to the relevant information of the first calculation task in the unit report file, and verifies whether the hash of the first code meets expectations.
  • the third-party organization can add its own signature to the unit report file to generate a certification result file.
  • the certification result file contains the signature information of the third-party certification authority.
  • the first computing unit may use the authentication result file as the first authentication information as a proof of the trusted computing unit.
  • step 402 the first computing unit conducts key negotiation with the trusted certificate generator to establish a trusted channel, which is also called an RA channel.
  • the first computing unit and the trusted certificate generator may adopt various key negotiation methods to determine a common key or key pair. For example, use the DH (Diffie-Hellman) key exchange method, or use the elliptic curve-based ECDH key exchange method, and so on. Using the negotiated key or key pair, a trusted channel can be established to ensure that only the two parties can obtain the data transmitted through the trusted channel.
  • DH Dynamic Hossion Initid Key
  • elliptic curve-based ECDH key exchange method elliptic curve-based ECDH key exchange method
  • step 401 and step 402 may not be limited to the sequence shown in FIG. 4, and the two may be executed in an exchange order or in parallel.
  • the first computing unit sends a request for obtaining a certificate to the trusted certificate generator, which is hereinafter referred to as a first certificate request.
  • the first certificate request includes the group identifier of the first task group to which the first computing task belongs, called the first group identifier, and the first authentication information obtained in step 401, which contains the first computing task's first Code hash.
  • the first group identifier has been notified or configured to the first computing task in the task grouping configuration stage as described above. Therefore, when the first computing task is started in the first computing unit, the previously configured first computing task can be directly obtained.
  • a set of identifiers to be included in the first certificate request is described above.
  • the trusted certificate generator After receiving the first certificate request, in step 404, the trusted certificate generator first authenticates the first computing unit based on the above-mentioned first authentication information.
  • the above-mentioned first authentication information may be a unit report file generated by the first computing unit.
  • the trusted certificate generator sends the unit report file to the above-mentioned third-party certification agency, and the third-party certification agency performs verification.
  • the certification result file is returned, which contains the signature information of the third-party certification authority. Therefore, the trusted certificate generator further verifies the signature information, and if the verification is passed, it is considered that the first computing unit has passed the verification.
  • the above-mentioned first authentication information may also be an authentication result file received by the first computing unit from a third-party authentication agency.
  • the trusted certificate generator only needs to verify the signature information in the authentication result file. If the verification is passed, it is considered that the first computing unit is verified.
  • step 405 the trusted certificate generator determines whether the first computing task belongs to the first task group according to the first code hash.
  • the trusted certificate generator will obtain the hash list corresponding to each task group through the configuration manager or through the configuration interface, including the code of all computing tasks belonging to the corresponding task group. hope. Therefore, in step 405, the trusted certificate generator can read a pre-configured first hash list corresponding to the first group of identifiers, and the first hash list includes the codes of all computing tasks belonging to the first task group. hope. Then, it is determined whether the first code hash included in the first authentication information is in the first hash list, and if so, it is confirmed that the first calculation task belongs to the first task group.
  • the trusted certificate generator can read the corresponding hash list 1: ⁇ H1, H2, H3 ⁇ obtained in the configuration phase according to the group identifier GID1. Then it is determined whether the first code hash H1 is included in the hash list 1, and based on this, it is determined whether the first calculation task belongs to the first task group.
  • the certificate request is rejected and an error message is returned. If it is confirmed that the first computing task belongs to the first task group, then continue to perform the subsequent steps.
  • step 406 the trusted certificate generator obtains the first certificate chain and the first private key generated for the first group of identifiers.
  • the trusted certificate generator has already generated the corresponding certificate chain for each task grouping respective group identification.
  • the trusted certificate generator reads the first certificate chain and the first private key generated in advance for the first group of identities.
  • the trusted certificate generator in the group configuration stage, only records the group identification of each task group and the corresponding hash list. In the certificate distribution phase, the trusted certificate generator generates a certificate chain for each group ID. Correspondingly, in step 406, the trusted certificate generator determines whether there is a certificate chain corresponding to the first group of identifiers, if it exists (for example, other computing units running other computing tasks in the same task group issued certificates before the first computing unit Request), then read the generated certificate chain as the first certificate chain. If it does not exist, the trusted certificate generator generates a first certificate chain and a first private key for the first group of identifiers.
  • the first certificate chain includes the first root certificate and the corresponding first public key certificate.
  • the first root certificate is a self-signed certificate of the trusted certificate generator as the root CA
  • the first public key certificate is the first root certificate.
  • the downstream public key certificate of the certificate matches the first private key to form a first certificate pair.
  • the first public key certificate and the first root certificate may adopt multiple formats, for example, the standard format X.509 certificate of public key certificates in cryptography is adopted.
  • the trusted certificate generator will generate different certificate chains for different task groups, that is, different group IDs.
  • the root certificate and public key certificate in a certificate chain have a corresponding relationship, and the roots in different certificate chains The certificates are different from each other.
  • the first root certificate is the starting point of the trust chain and corresponds to the first public key certificate.
  • the first public key certificate corresponds to the first root certificate in different ways.
  • the certificate 51 is the first public key certificate, which includes the first task group (for example, denoted as GID1) information as the certificate holder, and the first public key K1 (the public key generated by the group ID GID1) , The information of the certificate generator as the issuer, and the first signature information signed by the certificate generator.
  • the first private key k1 matches the first public key K1.
  • the certificate 50 is the first root certificate, which includes the information of the certificate generator (both as the certificate holder and the issuer), the second public key K2 (the external signature public key of the certificate generator), and the certificate generator self-signed The second signature information.
  • the first signature information in the first public key certificate 51 and the second signature information in the first root certificate 50 are both verified using the second public key K2.
  • the second public key K2 is generated for the first group identification of the first task group. In this way, the first root certificate 50 and the first public key certificate 51 both uniquely correspond to the first group identification.
  • FIG. 6 shows the first certificate chain in another embodiment.
  • the certificate 61 is the first public key certificate, which includes the first task group (for example, denoted as GID1) information as the certificate holder, and the first public key K1 (the public key generated by the group ID GID1) , The information of the certificate generator as the issuer, and the first signature information signed by the certificate generator.
  • the certificate 60 is the first root certificate, which includes the information of the certificate generator (both as the certificate holder and the issuer), the first public key K1, and the second signature information self-signed by the certificate generator.
  • FIG. 6 is different from FIG. 5 in that, in the first root certificate 60 of FIG. 6, the first public key K1 generated for the group ID GID1 is also used as the external signature public key of the certificate generator. Therefore, the first signature information in the first public key certificate 61 and the second signature information in the first root certificate 60 are both verified using the first public key K1. In this way, the public key generation of the certificate chain is simplified. Moreover, since the first public key K1 is generated for GID1, both the first root certificate 60 and the first public key certificate 61 uniquely correspond to the first group of identifiers.
  • the first public key certificate and the first root certificate may also be separated by more levels (such as certificates 33 and 30 in FIG. 3) to correspond to each other.
  • the trusted certificate generator obtains the first root certificate, the first public key certificate and the first private key generated for the first group of identities.
  • the trusted certificate generator sends a certificate report to the first computing unit through the previously established trusted channel, that is, the RA channel, which is called the first certificate report.
  • the first certificate report includes the first root certificate and the first certificate pair formed by the first public key certificate and the first private key. Through the RA channel, the content reported by the first certificate will not be obtained by other computing units.
  • the certificate is used to reinforce the online service interface in a TLS security protocol, so as to provide a basis for subsequent multi-party computing related to computing services.
  • TLS Transport Layer Security
  • HTTP/RPC HyperText Transfer Layer Control
  • TLS protocol can transparently run on top of the TLS protocol, and the TLS protocol performs the negotiation and authentication required to create an encrypted channel.
  • the data transmitted by the application layer protocol will be encrypted when passing through the TLS protocol to ensure the privacy of communication.
  • the TLS security protocol supports the communication mode between the client and the server.
  • the TLS client and the TLS server use certificates to perform handshake and establish an encrypted channel to strengthen the upper-layer network services, such as HTTP/RPC network services.
  • the first computing unit may use itself as the TLS server that provides the computing service of the first computing task, and set the received first certificate pair as the certificate pair of the TLS server.
  • the first computing unit also uses itself as a TLS client connected to other computing tasks, and sets the first root certificate as the trusted root certificate of the TLS client. Therefore, the first computing unit can subsequently serve as a TLS server, providing computing services of the first computing task to other TLS clients with corresponding first root certificates, and can also serve as a TLS client with other TLS clients that have a pair of first certificates.
  • the TLS server communicates and performs collaborative calculations with it. This will be described in detail later.
  • the first computing unit running the first computing task obtains the certificate and private key generated for the first task group from the trusted certificate generator. It can be understood that all other computing units can execute the process shown in FIG. 4 to obtain certificates corresponding to the task group to which the running computing task belongs.
  • FIG. 7 shows the state of each calculation unit after the process shown in FIG. 4 is executed.
  • the trusted computing units 11, 12, and 13 perform task 1, task 2, and task 3 respectively, assuming that task 1, task 2 and task 3 belong to the first task group, then the trusted computing unit 11 , 12, and 13 can obtain the first root certificate, the first public key certificate, and the first private key generated for the group identifier GID1 of the first task group.
  • the trusted computing unit 14 runs task 4 and assumes that task 4 belongs to the second task group. Therefore, the trusted computing unit 14 can obtain the second root certificate, the second public key certificate, and the second private key generated for the second task group. In this way, each computing unit can obtain the certificate and private key corresponding to the computing task it runs.
  • the trusted certificate generator also distributes corresponding certificates to the user terminal in response to the request of the user terminal, so as to facilitate the communication between the user terminal and the trusted computing unit.
  • Fig. 8 shows a schematic diagram of a process of distributing a certificate to a user terminal according to an embodiment.
  • step 801 the user terminal sends an authentication request to the trusted certificate generator, requesting RA authentication for the trusted certificate generator.
  • the trusted certificate generator provides its own RA information, called second authentication information, to the user terminal for the user terminal to perform authentication.
  • step 803 the user terminal authenticates the trusted certificate generator based on the second authentication information.
  • the trusted certificate generator generates its own report file, and the report file includes the code hash and signature information of the trusted certificate generator itself.
  • the report file also includes other configuration description information of the trusted certificate generator. Then, in step 802, the trusted certificate generator sends the report file as the above-mentioned second authentication information to the user terminal.
  • step 803 the user terminal sends the above-mentioned report file to the third-party certification agency. Similar to the foregoing, the third-party certification agency performs verification based on the signature information and code hash of the report file, and after the verification is passed, a signature is added to the report file as the verification result file. Therefore, the certification result file contains the signature information of the third-party certification authority. Therefore, the user terminal can verify the signature information, and authenticate the trusted certificate generator accordingly.
  • the trusted certificate generator after generating the above-mentioned report file, sends the report file to a third-party certification agency, and obtains a certification result file from the third-party certification agency.
  • the trusted certificate generator provides the authentication result file as second authentication information to the user terminal.
  • the user terminal only needs to verify the signature information in the authentication result file, thereby realizing the authentication of the trusted certificate generator.
  • the user terminal After the trusted certificate generator is authenticated, in step 804, the user terminal sends a certificate request to the trusted certificate generator, which is called a second certificate request.
  • the second certificate request includes the first task that the user terminal expects to connect to.
  • the first group ID of the group In a specific example, the user terminal may query the configuration manager for the group identifier of the task group that it is expected to connect to, and include it in the second certificate request.
  • the group identifier of the task group such as GID1 is included in the certificate request.
  • the trusted certificate generator After receiving the above-mentioned second certificate request, the trusted certificate generator obtains the first certificate chain and the first private key generated in advance for the first group identification in step 805, where the first certificate chain includes the first root certificate and Corresponding to the first public key certificate, the first public key certificate and the first private key form a first certificate pair.
  • the trusted certificate generator has previously distributed the first certificate pair to at least one computing unit that has been authenticated and runs each computing task in the first task group.
  • the trusted certificate generator returns a certificate report, called a second certificate report, to the user terminal, which includes at least the first root certificate in the first certificate chain.
  • the second certificate report further includes a first hash list corresponding to the first group of identifiers, and the first hash list includes code hashes of all computing tasks belonging to the first task group. .
  • the user terminal determines whether the first hash list meets expectations. Specifically, the user terminal determines whether each code hash included in the first hash list meets expectations, that is, whether each code hash is a code hash of a calculation task in a task group that is expected to be connected. Accordingly, the user terminal determines whether the task group information in the trusted certificate generator meets expectations, and whether the task program code behavior in the task group meets expectations.
  • the user terminal will consider that the task grouping information is inconsistent and refuse to trust the certificate sent by the trusted certificate generator.
  • step 808 the user terminal uses itself as the TLS client, and sets the received first root certificate as the trusted root certificate of the TLS client.
  • the TLS security protocol can be used to perform secure multi-party computing.
  • the TLS security protocol supports the communication between the client and the server. Specifically, when the first root certificate and the first public key certificate form a certificate chain, the first root certificate can be used as the only trusted root certificate of the TLS client, and it can only be paired with the first certificate.
  • the TLS server performs a handshake to establish a TLS trusted channel.
  • the TLS client with the first root certificate and the TLS server with the first certificate pair can implement the TLS handshake in the following manner.
  • the TLS client initiates a handshake request, and the TLS server returns the first public key certificate and the generated random number N1 to the TLS client.
  • the TLS client Since the TLS client has set the first root certificate as the only trusted root certificate, and the first public key certificate is the certificate in the trust chain of the first root certificate, the TLS client will consider the first public key certificate to be trusted . Then the TLS client generates another random number N2, encrypts the random number N2 with the first public key in the first public key certificate, and sends it to the TLS server.
  • the TLS server uses the first private key in the first certificate pair to decrypt the random number N2, and generates the session key used to encrypt the subsequent transmission data according to the previous random numbers N1, N2 and the agreed encryption algorithm.
  • the TLS client confirms the session key, the two parties successfully shake hands and use the session key to establish a TLS trusted channel.
  • the TLS client can exchange data with the TLS server through the TLS trusted channel.
  • the user terminal and the computing unit running the first task group can perform multi-party secure computing.
  • the first root certificate is set as a trusted root certificate
  • each computing unit that runs each computing task in the first task group can be used as a TLS server, and the first certificate is paired As a server-side certificate pair, therefore, the user terminal requesting the computing service of the first task group can establish a TLS trusted channel with each computing unit running each computing task in the first task group to perform secure communication.
  • each computing unit itself can act as a TLS client, and the first root certificate can also be set as a trusted root certificate.
  • a computing unit as a TLS client can establish TLS trust with another computing unit as a TLS server.
  • the other computing unit must be a computing unit running computing tasks in the same task group. In this way, secure multi-party calculations are realized between the user terminal and multiple computing units.
  • the user terminal only performs RA authentication on the trusted certificate generator, but does not perform RA authentication on each computing unit.
  • the trusted certificate generator will first perform RA authentication on the computing unit before distributing the certificate, and only distribute the certificate for the computing unit when the authentication is passed. Therefore, the user terminal performs RA authentication on the trusted certificate generator, which means that the trusted computing unit is indirectly authenticated with RA.
  • the respective distribution of certificates in the certificate chain is equivalent to realizing RA authentication and TLS verification at the same time, which simplifies the process of security authentication.
  • the computing service of the first task group not only needs to exchange data between multiple parties, but also needs to store and read persistent data.
  • the trusted certificate generator may further include the first public key certificate in the second certificate report returned to the user terminal. Therefore, the user terminal can use the first public key certificate to encrypt user data, and store the encrypted user data in the data platform persistently.
  • each computing unit that runs each computing task in the first task group has acquired a first certificate pair, which contains the first private key. Therefore, each of the foregoing calculation units may decrypt and obtain the foregoing user data by using the first private key in the first certificate pair.
  • each computing unit can also use the first public key in the first certificate pair to encrypt the intermediate data and store it in the data platform, and other computing units can use the first private key to decrypt the intermediate data to obtain the intermediate data. In this way, it is ensured that the data that needs to be persistently stored can only be obtained by the computing units in the same task group.
  • Fig. 9 shows the state of the system after the processes shown in Figs. 4 and 8 are executed.
  • each computing unit running each computing task in the same task group obtains the root certificate and certificate pair corresponding to the task group. For example, if task 1, task 2, and task 3 all belong to the first task group, then the trusted computing units 11, 12, and 13 that run these three computing tasks respectively obtain the first root certificate and the first root certificate generated for the first task group. The first certificate pair.
  • the trusted computing unit 14 running the computing task 4 in another task group obtains a different pair of the second root certificate and the second certificate.
  • the user terminal requesting the computing service of the first task group also obtains the first root certificate from the trusted certificate generator, where the first root certificate corresponds to the first public key certificate in the first certificate pair, which constitutes The certificate chain.
  • the user terminal may also obtain the first public key certificate, which is used to encrypt persistent data.
  • the TLS protocol can be used to perform secure calculations between the user terminal and multiple computing units.
  • the calculation unit that runs a certain calculation task in the first task group which is still called the first calculation unit, performs multi-party calculation.
  • FIG. 10 shows a flowchart of a method for performing multi-party security calculations in an embodiment. It should be noted that the method in FIG. 10 is executed by the first computing unit that runs the first computing task in the first task group, and each computing unit that runs each computing task in the first task group, as well as the user terminal, has already performed corresponding
  • the TLS settings are shown in Figure 9.
  • the first computing unit acts as a TLS server and performs a TLS handshake with a user terminal acting as a TLS client to establish a first TLS trusted channel.
  • the process of the handshake is as mentioned before, so I won't repeat it.
  • step 102 the first computing unit receives the first user data from the user terminal through the first TLS trusted channel.
  • step 103 the first computing task executed by the first computing unit performs first processing on the first user data to obtain the first application data.
  • the first computing unit acts as a TLS client and performs a TLS handshake with a second computing unit acting as a TLS server to establish a second TLS trusted channel; wherein the second computing unit is to run another computing in the first task group Task, that is, the calculation unit of the second calculation task.
  • step 105 the first computing unit transmits the above-mentioned first application data to the second computing unit through the second TLS trusted channel.
  • the first computing unit receives user data from the user terminal, and after processing it, transmits it to the second computing unit running the computing tasks in the same task group, so that at least the user terminal and the Multi-party secure transmission and calculation are realized between the unit and the second computing unit.
  • the computing service of the first task group needs to store persistent data.
  • the method of FIG. 10 further includes that the first computing unit reads second user data from the data platform, and the second user data is encrypted and generated by the user terminal using the first public key certificate. Therefore, the first computing unit can use the first private key to decrypt the second user data, thereby obtaining the corresponding data plaintext.
  • the first computing unit itself generates intermediate data and persists it for storage, and other computing units in the same task group can read the persistent data.
  • the method in FIG. 10 further includes the following steps.
  • the first calculation unit generates the second application data, and then encrypts the second application data using the first public key certificate to obtain the second encrypted application data.
  • the first computing unit then stores the second encrypted application data in the data platform for other computing units, for example, the second computing unit uses the first certificate to decrypt and obtain it.
  • the first computing unit can perform multi-party secure computing with the user terminal and with other computing units in the same task group.
  • a trusted certificate generator is used to generate and distribute certificates to achieve security authentication and verification, which facilitates multi-party secure communication and calculations between the user terminal and the trusted computing unit .
  • computing tasks are grouped in advance to form task groups.
  • the trusted certificate generator distinguishes different task groups through the group ID, and generates a set of certificate chain and a private key for a group ID.
  • the certificate chain includes the root certificate and the corresponding public key certificate, and the public key certificate matches the private key. Form a certificate pair.
  • the trusted certificate generator distributes the above-mentioned root certificate and certificate pair to each trusted computing unit that is authenticated and runs each computing task corresponding to the group ID.
  • the trusted certificate generator distributes the above-mentioned root certificate to the user terminal requesting the computing service of the task group. Therefore, a user terminal with a root certificate and a trusted computing unit with a root certificate and a certificate pair can perform multi-party secure communication through the TLS protocol.
  • a device for obtaining a certificate for multi-party secure computing the device being deployed in a first computing unit running a first computing task.
  • the first computing task is pre-configured to belong to a first task group, and the first task group further includes at least one other computing task.
  • Fig. 11 shows a schematic block diagram of an apparatus for obtaining a certificate deployed in a first computing unit in an embodiment.
  • the device 110 includes:
  • the first certificate request module 111 is configured to send a first certificate request to a trusted certificate generator, where the first certificate request includes a first group identifier of the first task group, and first authentication information.
  • the authentication information is used to perform trusted authentication on the first computing unit, and includes the first code hash of the first computing task;
  • the first report receiving module 113 is configured to receive a first certificate report from the trusted certificate generator, the first certificate report including a first certificate chain and a first private key generated for the first group of identifiers, so The first certificate chain includes a first root certificate and a corresponding first public key certificate, and the first public key certificate matches the first private key to form a first certificate pair;
  • the first setting module 115 is configured to use the first computing unit as the TLS server that provides the computing service of the first computing task, and set the first certificate pair as the certificate pair of the TLS server; and
  • the first computing unit serves as a TLS client connected to the at least one other computing task, and sets the first root certificate as a trusted root certificate of the TLS client.
  • the first calculation unit is implemented as a trusted enclave.
  • the above-mentioned apparatus 110 further includes an authentication information generating module (not shown) for generating the above-mentioned first authentication information.
  • the authentication information generating module is configured as:
  • the authentication result file is included in the first certificate request as the first authentication information.
  • the authentication information generating module is configured to:
  • the device 110 further includes a key agreement module configured to perform key agreement with the trusted certificate generator to establish a trusted channel before sending the first authentication request to the trusted certificate generator, The trusted channel is used to send the first certificate request and receive the first certificate report.
  • a key agreement module configured to perform key agreement with the trusted certificate generator to establish a trusted channel before sending the first authentication request to the trusted certificate generator, The trusted channel is used to send the first certificate request and receive the first certificate report.
  • an apparatus for distributing certificates for computing units is provided, which is deployed in a trusted certificate generator.
  • the trusted certificate generator can be implemented by any device, platform or device cluster with computing and processing capabilities.
  • Fig. 12 shows a schematic block diagram of an apparatus for distributing certificates for computing units in an embodiment. As shown in FIG. 12, the device 120 includes:
  • the first request receiving module 121 is configured to receive a first certificate request from a first computing unit running a first computing task, the first certificate request including a first group identifier of the first task group, and first authentication information, so The first authentication information is used to authenticate the first calculation unit, and includes the first code hash of the first calculation task;
  • the unit authentication module 123 is configured to authenticate the first computing unit according to the first authentication information
  • the grouping judgment module 125 is configured to judge whether the first calculation task belongs to the first task group according to the first code hash when the authentication is passed;
  • the certificate obtaining module 127 is configured to obtain a first certificate chain and a first private key that are generated in advance for the first group identifier when it is confirmed that the first computing task belongs to the first task group.
  • a certificate chain includes a first root certificate and a corresponding first public key certificate, and the first public key certificate matches the first private key to form a first certificate pair;
  • the first report sending module 129 is configured to send a first certificate report to the first calculation unit, the first certificate report including the first root certificate and the first certificate pair, so that the first calculation unit Taking itself as the TLS server providing computing services and the TLS client connecting with other computing tasks, the first certificate pair is set as the certificate pair of the TLS server, and the first root certificate is set as the trusted TLS client Root certificate.
  • the first certification information received by the first request receiving module 121 is a certification result file certified by a third-party certification authority, and the certification result file contains the signature information of the third-party certification authority; in this case,
  • the unit authentication module 123 is configured as:
  • the signature information is verified, and if the verification is successful, it is determined that the first computing unit has passed the authentication.
  • the first authentication information received by the first request receiving module 121 is a unit report file generated by the first computing unit, and the unit report file includes the first code hash and the first The signature information of a computing unit; in this case, the unit authentication module 123 is configured to:
  • the signature information is verified, and if the verification is successful, it is determined that the first computing unit has passed the authentication.
  • the device 120 further includes a certificate generation module (not shown) configured to:
  • a first generation command is received from the configuration manager, the first generation command includes the first group identifier, and a first hash list corresponding to the first group identifier, and the first hash list includes all The code hash of all calculation tasks in the first task group;
  • the first certificate chain and the first private key are generated.
  • the group determination module 125 is configured to obtain a pre-configured first hash list corresponding to the first group identifier, and the first hash list includes all items belonging to the first task group. Calculate the code hash of the task;
  • the first public key certificate includes a first public key generated for the first group identification, and first signature information signed by the trusted certificate generator, wherein the first public key And the first private key form a key pair;
  • the first root certificate includes a second public key generated for the first group of identifiers, and second signature information self-signed by the trusted certificate generator;
  • the second public key is used to verify the first signature information and the second signature information.
  • the first public key certificate includes a first public key generated for the first group identification, and first signature information signed by the trusted certificate generator, wherein the first public key The key and the first private key constitute a key pair; the first root certificate includes the first public key and the second signature information self-signed by the trusted certificate generator; the first public key is used To verify the first signature information and the second signature information.
  • the device 120 further includes a key agreement module (not shown), which is used to perform key agreement with the first computing unit to establish a trusted channel before receiving the first certificate request.
  • the communication channel is used to receive the first certificate request and send the first certificate report.
  • an apparatus for obtaining a certificate for multi-party secure computing is provided, which is deployed in a user terminal.
  • the user terminal can be implemented by any device with computing and processing capabilities.
  • Fig. 13 shows a schematic block diagram of an apparatus for obtaining a certificate deployed in a user terminal in an embodiment. As shown in FIG. 13, the device 130 includes:
  • the second request sending module 131 is configured to send a second certificate request to the trusted certificate generator, where the second certificate request includes the first group identifier of the first task group that is expected to be connected;
  • the second report receiving module 133 is configured to receive a second certificate report from the trusted certificate generator, the second certificate report including at least the first root certificate in the first certificate chain generated for the first group identification ,
  • the first certificate chain further includes a first public key certificate corresponding to the first root certificate; the first public key certificate and the matched first private key form a first certificate pair, which is distributed in advance to the authenticated , Run at least one computing unit of each computing task in the first task group;
  • the second setting module 135 is configured to use the user terminal as a TLS client, and set the first root certificate as the trusted root certificate of the TLS client, so as to have the first certificate pair and function as The at least one computing unit of the TLS server communicates.
  • the above-mentioned device 130 further includes an authentication module (not shown) configured to:
  • the trusted certificate generator is authenticated.
  • the above-mentioned second certification information is a certification result file certified by a third-party certification body, and the certification result file contains signature information of the third-party certification body; accordingly, the certification module is configured as: According to the signature information, if the verification is successful, it is determined that the trusted certificate generator has passed the authentication.
  • the second authentication information is a report file generated by the trusted certificate generator, and the report file includes the code hash and signature information of the trusted certificate generator; correspondingly, the authentication The module configuration is:
  • the signature information is verified, and if the verification is successful, it is determined that the certificate generator has passed the authentication.
  • the second certificate report further includes a first hash list corresponding to the first group identifier, and the first hash list includes code hashes of all computing tasks belonging to the first task group;
  • the device 130 further includes a hash confirmation module (not shown), configured to determine that before the second configuration module 135 sets the first root certificate as the trusted root certificate of the TLS client Describe whether the first hash list meets expectations.
  • the above-mentioned apparatus 130 further includes a communication module (not shown).
  • the communication module uses Performing a TLS handshake with the at least one computing unit to establish a TLS trusted channel; obtaining the computing service of the first task group from the at least one computing unit through the TLS trusted channel.
  • the second certificate report further includes a first public key certificate; correspondingly, the device 130 further includes an encryption module configured to encrypt user data of the user terminal by using the first public key certificate, and encrypt The user data of is stored in the data platform for the at least one computing unit to decrypt and obtain by using the first certificate.
  • an apparatus for distributing certificates to user terminals is also provided, which is deployed in a trusted certificate generator.
  • the trusted certificate generator can be implemented by any device, platform or device cluster with computing and processing capabilities.
  • Fig. 14 shows a schematic block diagram of an apparatus for distributing certificates to user terminals in an embodiment. As shown in FIG. 14, the device 140 includes:
  • the second request receiving module 141 is configured to receive a second certificate request sent by the user terminal, where the second certificate request includes the first group identifier of the first task group to which the user terminal expects to connect;
  • the certificate obtaining module 143 is configured to obtain a first certificate chain and a first private key generated in advance for the first group of identifications, the first certificate chain including a first root certificate and a first public key certificate corresponding to the first root certificate, and The first public key certificate matches the first private key to form a first certificate pair; at least the first certificate pair is pre-distributed to at least one of the authenticated computing tasks that run the first task group Computing unit
  • the second report sending module 145 is configured to send a second certificate report to the user terminal, the second certificate report including at least the first root certificate, so that the user terminal regards itself as a TLS client and transfers all certificates to the user terminal.
  • the first root certificate serves as a trusted root certificate of the TLS client, so as to communicate with the at least one computing unit that has the first certificate pair and functions as a TLS server.
  • the above-mentioned device 140 further includes an authentication information providing module (not shown). Before the second request receiving module 141 receives the second certificate request sent by the user terminal, the authentication information providing module responds to the user terminal. The authentication request is to provide the user terminal with second authentication information for the user terminal to perform authentication.
  • the authentication information providing module is configured as:
  • the report file including the code hash and signature information of the trusted certificate generator itself;
  • the authentication information providing module is configured as:
  • the report file including the code hash and signature information of the trusted certificate generator itself;
  • the report file is provided to the user terminal as the second authentication information.
  • the second certificate report sent by the second report sending module 145 further includes a first hash list corresponding to the first group of identifiers, and the first hash list includes information that belongs to the first task group. Code hash of all calculation tasks.
  • the second certificate report sent by the second report sending module 145 further includes the first public key certificate, so that the user terminal uses the first public key certificate to encrypt user data.
  • a device for multi-party secure computing through a digital certificate the device being deployed in a first computing unit running a first computing task.
  • Fig. 15 shows a schematic block diagram of an apparatus for multi-party calculation deployed in a first calculation unit in an embodiment, where:
  • the first computing task is pre-configured to belong to a first task group, and the first task group further includes a second computing task run by the second computing unit;
  • the first computing unit is pre-distributed with a first certificate pair and a first root certificate generated for the first task grouping, and the first certificate pair includes a first public key certificate and a matching first private key, so The first public key certificate and the first root certificate constitute a first certificate chain;
  • the first computing unit is configured as a first TLS server that provides computing services for the first computing task, and the first TLS server uses the first certificate pair as its certificate pair;
  • the computing unit is also configured as a first TLS client connected to at least the second computing unit, and the first TLS client uses the first root certificate as its trusted root certificate.
  • the device 150 includes:
  • the first handshake module 151 is configured to use the first TLS server to perform a TLS handshake with a user terminal acting as a second TLS client to establish a first TLS trusted channel; wherein the second TLS client connects the first TLS client One certificate as its trusted root certificate;
  • the data receiving module 153 is configured to receive first user data through the first TLS trusted channel
  • the data processing module 155 is configured to perform first processing on the first user data to obtain first application data;
  • the second handshake module 157 is configured to perform a TLS handshake between the first TLS client and the second computing unit acting as the second TLS server to establish a second TLS trusted channel; wherein the second TLS server connects all Said the first certificate pair as its certificate pair;
  • the data sending module 159 is configured to transmit the first application data to the second computing unit through the second TLS trusted channel.
  • the above-mentioned apparatus 150 further includes a data acquisition module (not shown) configured to read second user data from a data platform, and the second user data is used by the user terminal using the first public data.
  • the key certificate is encrypted and generated; the first private key is used to decrypt the second user data.
  • the above-mentioned device 150 further includes a data encryption storage module (not shown), configured to: generate second application data; use the first public key certificate to encrypt the second application data to obtain the first public key certificate. 2. Encrypting application data; storing the second encrypted application data in a data platform for the second computing unit to decrypt and obtain using the first certificate.
  • a data encryption storage module (not shown), configured to: generate second application data; use the first public key certificate to encrypt the second application data to obtain the first public key certificate. 2. Encrypting application data; storing the second encrypted application data in a data platform for the second computing unit to decrypt and obtain using the first certificate.
  • a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed in a computer, the computer is executed as described in conjunction with FIG. 4, FIG. 8 and FIG. 10. Methods.
  • a computing device including a memory and a processor, the memory stores executable code, and when the processor executes the executable code, a combination of FIGS. 4 and 8 is implemented. And the method described in Figure 10.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Engineering (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Storage Device Security (AREA)

Abstract

本说明书实施例提供一种通过分发证书实现多方安全计算的方法和装置。根据该方案,预先配置形成任务分组,并分配组标识。可信证书生成器针对一个组标识生成一套证书链和一个私钥,其中证书链包括根证书和对应的公钥证书,公钥证书与私钥相匹配,构成证书对。然后,可信证书生成器将根证书和证书对分发给经过认证的、运行该组标识对应的各个计算任务的各个可信计算单元。另一方面,还将上述根证书分发给请求该任务分组的计算服务的用户终端。于是,具有根证书的用户终端、具有根证书和证书对的可信计算单元之间,可以通过TLS协议的方式,进行多方安全通信。

Description

通过证书签发进行多方安全计算的方法及装置 技术领域
本说明书一个或多个实施例涉及分布式计算和安全计算领域,尤其涉及多方安全计算的方法和装置。
背景技术
为了计算和数据传输的安全,常常使用可信执行环境TEE(Trusted Execution Environment)中的可信计算单元进行可信计算和数据处理,其中可信计算单元可以保证其中的代码执行是安全的,外界包括操作系统或驱动等都无法获取内部的运行时内存等秘密。例如,可以利用可信计算单元来运行程序代码,执行计算任务,以保证程序代码的执行安全以及与外界的隔离。
出于可信执行环境的安全需要,在可信计算单元与其他方通信之前,例如与用户终端通信,或与其他可信计算单元通信之前,通常首先通过协商得到一个共同的加密密钥,该密钥除了通信的双方,其他任何人都不可能破解。双方之间的数据发送均通过该协商得出的密钥来进行加密,如此,我们称为,可信计算单元与其他方建立了可信通道,可以在该可信通道上安全传输保密数据。
在许多情况下,需要基于多个可信计算单元进行多方安全计算。例如,一些分布式任务需要在多个可信计算单元中执行多个计算任务合作完成,例如需要任务1,任务2和任务3共同协作完成。在这样的情况下,用户终端可能需要与运行上述多个计算任务的多个可信计算单元进行通信来获取计算服务,这多个可信计算单元之间也需要彼此通信,以完成计算任务。那么,出于上述安全需要,用户终端与可信计算单元之间,以及多个可信计算单元彼此之间,都需要建立可信通道。如果分别进行密钥协商,分别建立单独的可信通道,那么当可信计算单元数目增多,数量庞大时,多方计算的通信过程会变得复杂繁琐,成本高昂。
因此,希望能有改进的方案,便于多个参与方进行多方安全计算,提供相应的计算服务。
发明内容
本说明书一个或多个实施例描述了多方安全计算的方法及装置,其中通过为运行任务分组中各个计算任务的各个可信计算单元和请求该任务分组的计算服务的用户终端分发证书链中的对应证书,确保用户终端与各个可信计算单元之间进行安全的多方通信和计算。
根据第一方面,提供了一种获取证书以进行多方安全计算的方法,通过运行第一计算任务的第一计算单元执行,所述第一计算任务预先被配置为属于第一任务分组,所述第一任务分组还包括至少一个其他计算任务;所述方法包括:
向可信证书生成器发送第一证书请求,所述第一证书请求包括所述第一任务分组的第一组标识,以及第一认证信息,所述第一认证信息用于对第一计算单元进行可信认证,并包括所述第一计算任务的第一代码哈希;
从所述可信证书生成器接收第一证书报告,所述第一证书报告包括针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书以及对应的第一公钥证书,所述第一公钥证书与所述第一私钥相匹配,构成第一证书对;
以所述第一计算单元作为提供所述第一计算任务的计算服务的TLS服务端,将所述第一证书对设置为所述TLS服务端的证书对,并且以所述第一计算单元作为与所述至少一个其他计算任务连接的TLS客户端,将所述第一根证书设置为所述TLS客户端的可信根证书。
在第一方面的一个实施例中,所述第一计算单元实现为可信围圈Enclave。
根据第一方面的一个实施例,在向可信证书生成器发送第一认证请求之前,方法还包括:
生成第一计算单元的单元报告文件,所述单元报告文件包括所述第一代码哈希,以及所述第一计算单元的签名信息;
将所述单元报告文件发送至第三方认证机构,以获得认证结果文件,所述认证结果文件包含所述第三方认证机构的签名信息;
将所述认证结果文件作为所述第一认证信息包含在所述第一证书请求中。
根据第一方面的另一实施例,在向可信证书生成器发送第一认证请求之前,方法还包括:
生成第一计算单元的单元报告文件,所述单元报告文件包括所述第一代码哈希,所述第一计算单元的签名信息;
将所述单元报告文件作为所述第一认证信息包含在所述第一证书请求中。
根据一种实施方式,在向可信证书生成器发送第一认证请求之前,第一计算单元与所述可信证书生成器进行密钥协商,建立可信通道,所述可信通道用于发送所述第一证书请求,以及接收所述第一证书报告。
根据第二方面,提供了一种为计算单元分发证书的方法,通过可信证书生成器执行,所述方法包括:
从运行第一计算任务的第一计算单元接收第一证书请求,所述第一证书请求包括第一任务分组的第一组标识,以及第一认证信息,所述第一认证信息用于对所述第一计算单元进行认证,且包括所述第一计算任务的第一代码哈希;
根据所述第一认证信息对所述第一计算单元进行认证;
在认证通过的情况下,根据所述第一代码哈希判断所述第一计算任务是否属于所述第一任务分组;
在确认所述第一计算任务属于所述第一任务分组的情况下,获取预先针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书和对应的第一公钥证书,所述第一公钥证书与所述第一私钥相匹配,构成第一证书对;
向所述第一计算单元发送第一证书报告,所述第一证书报告包括所述第一根证书和所述第一证书对,使得所述第一计算单元以自身为提供计算服务的TLS服务端和与其他计算任务连接的TLS客户端,将所述第一证书对设置为TLS服务端的证书对,将所述第一根证书设置为TLS客户端的可信根证书。
根据第二方面的一个实施例,所述第一认证信息为经过第三方认证机构认证的认证结果文件,该认证结果文件包含该第三方认证机构的签名信息;在这样的情况下,对所述第一计算单元进行认证包括:
校验所述签名信息,在校验成功的情况下,确定所述第一计算单元认证通过。
根据第二方面的另一实施例,所述第一认证信息为所述第一计算单元生成的单元报告文件,所述单元报告文件包括所述第一代码哈希,以及所述第一计算单元的签名信息;在这样的情况下,对所述第一计算单元进行认证包括:
将所述单元报告文件发送至第三方认证机构,以获得认证结果文件,所述认证结果文件包含所述第三方认证机构的签名信息;
校验所述签名信息,在校验成功的情况下,确定所述第一计算单元认证通过。
根据第二方面的一种实施方式,在从运行第一计算任务的第一计算单元接收第一证书请求之前,所述可信证书管理器从配置管理器接收第一生成命令,所述第一生成命令包括,所述第一组标识,以及与所述第一组标识对应的第一哈希列表,该第一哈希列表包括属于所述第一任务分组的所有计算任务的代码哈希;针对所述第一组标识,生成所述第一证书链和第一私钥。
根据第二方面的一个实施例,通过以下方式判断所述第一计算任务是否属于所述第一任务分组:
获取预先配置的、与所述第一组标识对应的第一哈希列表,该第一哈希列表包括属于所述第一任务分组的所有计算任务的代码哈希;
判断所述第一代码哈希是否位于所述第一哈希列表中,如果是,则确认所述第一计算任务属于所述第一任务分组。
根据第二方面的一个具体实施例,所述第一公钥证书包括针对所述第一组标识生成的第一公钥,以及所述可信证书生成器签名的第一签名信息,其中所述第一公钥和所述第一私钥构成密钥对;所述第一根证书中包括针对所述第一组标识生成的第二公钥,以及所述可信证书生成器自签名的第二签名信息;所述第二公钥用于对所述第一签名信息和第二签名信息进行校验。
根据第二方面的另一具体实施例,所述第一公钥证书包括针对所述第一组标识生成的第一公钥,以及所述可信证书生成器签名的第一签名信息,其中所述第一公钥和所述第一私钥构成密钥对;所述第一根证书包括所述第一公钥,以及所述可信证书生成器自签名的第二签名信息;所述第一公钥用于对所述第一签名信息和第二签名信息进行校验。
根据第二方面的一种实施方式,在从运行第一计算任务的第一计算单元接收第一证书请求之前,可信证书生成器与所述第一计算单元进行密钥协商,建立可信通道,所述可信通道用于接收所述第一证书请求,以及发送所述第一证书报告。
根据第三方面,提供了一种获取证书以进行多方安全计算的方法,通过用户终端执行,所述方法包括:
向可信证书生成器发送第二证书请求,所述第二证书请求中包括,期望连接的第一任务分组的第一组标识;
从所述可信证书生成器接收第二证书报告,所述第二证书报告至少包括针对所述第一组标识生成的第一证书链中的第一根证书,所述第一证书链还包括与所述第一根证书对应的第一公钥证书;所述第一公钥证书和匹配的第一私钥构成第一证书对,被预先分发给经过认证的、运行所述第一任务分组中各个计算任务的至少一个计算单元;
以所述用户终端为TLS客户端,将所述第一根证书设置为所述TLS客户端的可信根证书,从而与具有所述第一证书对、且作用为TLS服务端的所述至少一个计算单元通信。
根据第三方面的一种实施方式,在向可信证书生成器发送第二证书请求之前,还包括:
获取所述可信证书生成器的第二认证信息;
根据所述第二认证信息,对所述可信证书生成器进行认证。
根据一个进一步的实施例,所述第二认证信息为经过第三方认证机构认证的认证结果文件,该认证结果文件包含该第三方认证机构的签名信息;
所述根据所述第二认证信息,对所述可信证书生成器进行认证包括:
校验所述签名信息,在校验成功的情况下,确定所述可信证书生成器认证通过。
根据另一个进一步的实施例,所述第二认证信息为所述可信证书生成器生成的报告文件,所述报告文件包括所述可信证书生成器自身的代码哈希和签名信息;
所述根据所述第二认证信息,对所述可信证书生成器进行认证包括:
将所述报告文件发送至第三方认证机构,以获得认证结果文件,所述认证结果文件包含所述第三方认证机构的签名信息;
校验所述签名信息,在校验成功的情况下,确定所述证书生成器认证通过。
根据第三方面的一种实施方式,所述第二证书报告还包括,所述第一组标识对应的第一哈希列表,该第一哈希列表包括属于所述第一任务分组的所有计算任务的代码哈希;
在将所述第一根证书设置为所述TLS客户端的可信根证书之前,所述方法还包括, 判断所述第一哈希列表是否符合预期。
根据第三方面的一个实施例,在将所述第一根证书设置为所述TLS客户端的可信根证书之后,还包括,
与所述至少一个计算单元进行TLS握手,建立TLS可信通道;
通过TLS可信通道,从所述至少一个计算单元获取所述第一任务分组的计算服务。
根据第三方面的一个实施例,所述第二证书报告还包括,所述第一公钥证书,所述方法还包括:利用所述第一公钥证书加密所述用户终端的用户数据,并将加密的用户数据存入数据平台,以供所述至少一个计算单元利用所述第一证书对进行解密获取。
根据第四方面,提供了一种为用户终端分发证书的方法,通过可信证书生成器执行,所述方法包括:
接收用户终端发送的第二证书请求,所述第二证书请求中包括,所述用户终端期望连接的第一任务分组的第一组标识;
获取预先针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书和与其对应的第一公钥证书,所述第一公钥证书与所述第一私钥匹配,构成第一证书对;至少所述第一证书对被预先分发给经过认证的、运行所述第一任务分组中各个计算任务的至少一个计算单元;
向所述用户终端发送第二证书报告,所述第二证书报告至少包括所述第一根证书,以使得所述用户终端以自身为TLS客户端,将所述第一根证书作为TLS客户端的可信根证书,从而与具有所述第一证书对、且作用为TLS服务端的所述至少一个计算单元通信。
根据第四方面的一种实施方式,在接收用户终端发送的第二证书请求之前,还包括:
响应于所述用户终端的认证请求,向所述用户终端提供第二认证信息,以供所述用户终端进行认证。
根据一个进一步的实施例,向所述用户终端提供第二认证信息包括:
生成报告文件,所述报告文件包括所述可信证书生成器自身的代码哈希和签名信息;
将所述报告文件发送至第三方认证机构,以获得认证结果文件,所述认证结果文 件包含所述第三方认证机构的签名信息;
将所述认证结果文件作为所述第二认证信息提供给所述用户终端。
根据另一个进一步的实施例,向所述用户终端提供第二认证信息包括:
生成报告文件,所述报告文件包括所述可信证书生成器自身的代码哈希和签名信息;
将所述报告文件作为所述第二认证信息提供给所述用户终端。
根据第四方面的一个实施例,所述第二证书报告还包括,所述第一组标识对应的第一哈希列表,该第一哈希列表包括属于所述第一任务分组的所有计算任务的代码哈希。
根据第四方面的一个实施例,所述第二证书报告还包括所述第一公钥证书,以使得所述用户终端利用所述第一公钥证书加密用户数据。
根据第五方面,提供了一种通过数字证书进行多方安全计算的方法,通过运行第一计算任务的第一计算单元执行,其中:
所述第一计算任务预先被配置为属于第一任务分组,所述第一任务分组还包括第二计算单元所运行的第二计算任务;
所述第一计算单元预先被分发有针对所述第一任务分组生成的第一证书对和第一根证书,所述第一证书对包括第一公钥证书和匹配的第一私钥,所述第一公钥证书和第一根证书构成第一证书链;
并且,所述第一计算单元被配置作为提供所述第一计算任务的计算服务的第一TLS服务端,该第一TLS服务端以所述第一证书对作为其证书对;所述第一计算单元还被配置作为至少与所述第二计算单元连接的第一TLS客户端,所述第一TLS客户端以所述第一根证书作为其可信根证书;
所述方法包括:
利用所述第一TLS服务端与作用为第二TLS客户端的用户终端进行TLS握手,建立第一TLS可信通道;其中所述第二TLS客户端将所述第一根证书作为其可信根证书;
通过所述第一TLS可信通道接收第一用户数据;
对所述第一用户数据进行第一处理,得到第一应用数据;
利用所述第一TLS客户端与作用为第二TLS服务端的第二计算单元进行TLS握手, 建立第二TLS可信通道;其中所述第二TLS服务端将所述第一证书对作为其证书对;
通过所述第二TLS可信通道将所述第一应用数据传送给所述第二计算单元。
在第五方面的一个实施例中,所述方法还包括,从数据平台读取第二用户数据,所述第二用户数据由所述用户终端使用所述第一公钥证书加密产生;
使用所述第一私钥解密所述第二用户数据。
在第五方面的一种实施方式中,所述方法还包括:
生成第二应用数据;
使用所述第一公钥证书加密所述第二应用数据,得到第二加密应用数据;
将所述第二加密应用数据存入数据平台,以供所述第二计算单元利用所述第一证书对进行解密获取。
根据第六方面,提供了一种获取证书以进行多方安全计算的装置,部署在运行第一计算任务的第一计算单元中,所述第一计算任务预先被配置为属于第一任务分组,所述第一任务分组还包括至少一个其他计算任务;所述装置包括:
第一证书请求模块,配置为向可信证书生成器发送第一证书请求,所述第一证书请求包括所述第一任务分组的第一组标识,以及第一认证信息,所述第一认证信息用于对第一计算单元进行可信认证,并包括所述第一计算任务的第一代码哈希;
第一报告接收模块,配置为从所述可信证书生成器接收第一证书报告,所述第一证书报告包括针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书以及对应的第一公钥证书,所述第一公钥证书与所述第一私钥相匹配,构成第一证书对;
第一设置模块,配置为以所述第一计算单元作为提供所述第一计算任务的计算服务的TLS服务端,将所述第一证书对设置为所述TLS服务端的证书对;并且以所述第一计算单元作为与所述至少一个其他计算任务连接的TLS客户端,将所述第一根证书设置为所述TLS客户端的可信根证书。
根据第七方面,提供了一种为计算单元分发证书的装置,部署在可信证书生成器中,所述装置包括:
第一请求接收模块,配置为从运行第一计算任务的第一计算单元接收第一证书请求,所述第一证书请求包括第一任务分组的第一组标识,以及第一认证信息,所述第一 认证信息用于对所述第一计算单元进行认证,且包括所述第一计算任务的第一代码哈希;
单元认证模块,配置为根据所述第一认证信息对所述第一计算单元进行认证;
分组判断模块,配置为在认证通过的情况下,根据所述第一代码哈希判断所述第一计算任务是否属于所述第一任务分组;
证书获取模块,配置为在确认所述第一计算任务属于所述第一任务分组的情况下,获取预先针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书和对应的第一公钥证书,所述第一公钥证书与所述第一私钥相匹配,构成第一证书对;
第一报告发送模块,配置为向所述第一计算单元发送第一证书报告,所述第一证书报告包括所述第一根证书和所述第一证书对,使得所述第一计算单元以自身为提供计算服务的TLS服务端和与其他计算任务连接的TLS客户端,将所述第一证书对设置为TLS服务端的证书对,将所述第一根证书设置为TLS客户端的可信根证书。
根据第八方面,提供了一种获取证书以进行多方安全计算的装置,部署在用户终端中,所述装置包括:
第二请求发送模块,配置为向可信证书生成器发送第二证书请求,所述第二证书请求中包括,期望连接的第一任务分组的第一组标识;
第二报告接收模块,配置为从所述可信证书生成器接收第二证书报告,所述第二证书报告至少包括针对所述第一组标识生成的第一证书链中的第一根证书,所述第一证书链还包括与所述第一根证书对应的第一公钥证书;所述第一公钥证书和匹配的第一私钥构成第一证书对,被预先分发给经过认证的、运行所述第一任务分组中各个计算任务的至少一个计算单元;
第二配置模块,配置为以所述用户终端为TLS客户端,将所述第一根证书设置为所述TLS客户端的可信根证书,从而与具有所述第一证书对、且作用为TLS服务端的所述至少一个计算单元通信。
根据第九方面,提供了一种为用户终端分发证书的装置,部署在可信证书生成器中,所述装置包括:
第二请求接收模块,配置为接收用户终端发送的第二证书请求,所述第二证书请求中包括,所述用户终端期望连接的第一任务分组的第一组标识;
证书获取模块,配置为获取预先针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书和与其对应的第一公钥证书,所述第一公钥证书与所述第一私钥匹配,构成第一证书对;至少所述第一证书对被预先分发给经过认证的、运行所述第一任务分组中各个计算任务的至少一个计算单元;
第二报告发送模块,配置为向所述用户终端发送第二证书报告,所述第二证书报告至少包括所述第一根证书,以使得所述用户终端以自身为TLS客户端,将所述第一根证书作为TLS客户端的可信根证书,从而与具有所述第一证书对、且作用为TLS服务端的所述至少一个计算单元通信。
根据第十方面,提供了一种通过数字证书进行多方安全计算的装置,部署在运行第一计算任务的第一计算单元中,其中:
所述第一计算任务预先被配置为属于第一任务分组,所述第一任务分组还包括第二计算单元所运行的第二计算任务;
所述第一计算单元预先被分发有针对所述第一任务分组生成的第一证书对和第一根证书,所述第一证书对包括第一公钥证书和匹配的第一私钥,所述第一公钥证书和第一根证书构成第一证书链;
并且,所述第一计算单元被配置作为提供所述第一计算任务的计算服务的第一TLS服务端,该第一TLS服务端以所述第一证书对作为其证书对;所述第一计算单元还被配置作为至少与所述第二计算单元连接的第一TLS客户端,所述第一TLS客户端以所述第一根证书作为其可信根证书;
所述装置包括:
第一握手模块,配置为利用所述第一TLS服务端与作用为第二TLS客户端的用户终端进行TLS握手,建立第一TLS可信通道;其中所述第二TLS客户端将所述第一根证书作为其可信根证书;
数据接收模块,配置为通过所述第一TLS可信通道接收第一用户数据;
数据处理模块,配置为对所述第一用户数据进行第一处理,得到第一应用数据;
第二握手模块,配置为利用所述第一TLS客户端与作用为第二TLS服务端的第二计算单元进行TLS握手,建立第二TLS可信通道;其中所述第二TLS服务端将所述第一证书对作为其证书对;
数据发送模块,配置为通过所述第二TLS可信通道将所述第一应用数据传送给所述第二计算单元。
根据第十一方面,提供了一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行第一方面到第五方面的方法。
根据第十二方面,提供了一种计算设备,包括存储器和处理器,其特征在于,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现第一方面到第五方面的方法。
根据本说明书实施例提供的方法和装置,通过可信证书生成器生成并分发证书,实现安全认证和校验,便于用户终端与可信计算单元之间进行多方安全通信和计算。具体的,预先将计算任务进行分组,形成任务分组。可信证书生成器通过组标识区分不同任务分组,针对一个组标识生成一套证书链和一个私钥,其中证书链中包括根证书和对应的公钥证书,公钥证书与私钥相匹配,构成一个证书对。然后,可信证书生成器将该上述根证书和证书对分发给经过认证的、运行该组标识对应的各个计算任务的各个可信计算单元。于是,运行同一任务分组中各个计算任务的多个可信计算单元会获得同样的根证书和证书对。另一方面,可信证书生成器将上述根证书分发给请求该任务分组的计算服务的用户终端。于是,具有根证书的用户终端、具有根证书和证书对的可信计算单元之间,可以通过TLS协议的方式,进行多方安全通信。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为本说明书披露的一个实施例的实施场景示意图;
图2示出根据一个实施例通过配置管理器进行分组配置的过程示意图;
图3示出一个示例中的数字证书的证书链和证书对;
图4示出根据一个实施例为计算单元签发证书的过程示意图;
图5示出在一个实施例中的第一证书链;
图6示出在另一实施例中的第一证书链;
图7示出在执行图4所示的过程之后各个计算单元的状态;
图8示出根据一个实施例为用户终端分发证书的过程示意图;
图9示出在执行图4和图8所示的过程之后系统的状态;
图10示出在一个实施例中进行多方安全计算的方法流程图;
图11示出在一个实施例中部署在第一计算单元中的获取证书的装置的示意性框图;
图12示出在一个实施例中为计算单元分发证书的装置的示意性框图;
图13示出在一个实施例中部署在用户终端中的获取证书的装置的示意性框图;
图14示出在一个实施例中为用户终端分发证书的装置的示意性框图;
图15示出在一个实施例中部署在第一计算单元中的进行多方计算的装置的示意性框图。
具体实施方式
下面结合附图,对本说明书提供的方案进行描述。
图1为本说明书披露的一个实施例的实施场景示意图。如图所示,可以通过可信执行环境TEE中的可信计算单元执行所需的计算任务。可信计算单元可以是具有一定隔离能力从而保证计算安全性的计算模块或计算设备,例如是可信的计算围圈Enclave,比如采用SGX或Trust Zone等技术而实现。例如,根据SGX技术,通过提供一系列CPU指令码,允许用户代码创建具有高访问权限的私有内存区域而形成计算围圈Enclave。其他应用程序,包括操作系统OS,BIOS系统,虚拟机系统等,均不能访问围圈Enclave中的数据,也就不能窥探和篡改其中应用程序的状态和数据。因此,通过例如围圈Enclave的可信计算单元执行计算任务,可以保证任务代码与外界的隔离,确保任务程序的运行安全。
在图1的示例中,各个可信计算单元(例如各个围圈Enclave)分别执行各自的计算任务,例如,可信计算单元11,12,13,14分别执行不同的计算任务,任务1,任务2,任务3和任务4。可以理解,这仅仅是一个示例。还可以存在其他可信计算单元执行其他任务,也可以存在多个可信计算单元执行同一任务的多个副本。
在分布式任务的情况下,会需要运行多个计算任务的多个可信计算单元共同协作, 进行多方计算。例如,在一个例子中,假定需要任务1,任务2和任务3协同计算,共同提供一套计算服务。
如前所述,由于可信执行环境的安全需要,这就要求在用户终端与各个可信计算单元,以及各个可信计算单元之间,均建立可信通道才能进行数据的传输和交换。
为了便于在分布式任务的场景下进行多方安全计算,根据本说明书的一个实施例,预先为各个计算任务进行分组,将执行同一分布式任务的计算任务划分到同一分组。然后,采用可信证书生成器20基于任务分组来生成数字证书并管理数字证书,通过证书的生成和分发管理,促使用户终端和多个可信计算单元进行多方安全计算。
具体地,可信证书生成器20根据组标识区分各个任务分组。针对某一任务分组,例如称为第一任务分组,可信证书生成器为其生成一套证书链和一个私钥,其中证书链中包括公钥证书和对应的根证书,公钥证书与上述私钥相匹配,构成一个证书对。然后,可信证书生成器将该根证书和证书对分发给经过认证的、运行该第一任务分组中各个计算任务的各个可信计算单元。于是,运行同一任务分组中各个计算任务的多个可信计算单元会获得同样的证书对和根证书。另一方面,可信证书生成器将上述证书链中的根证书分发给请求该第一任务分组的计算服务的用户终端30。
接下来,对于运行第一任务分组中某个计算任务的某个可信计算单元,可以将其作为提供计算服务的传输层安全协议TLS服务端,将上述证书对设置为该TLS服务端的证书对,还可以将该可信计算单元作为与同一任务分组中其他计算单元连接的TLS客户端,将上述根证书设置为TLS客户端的可信根证书。
对于请求该第一任务分组的计算服务的用户终端,可以将其作为TLS客户端,将分发给用户终端的根证书设置为TLS客户端的可信根证书。
由于上述证书对和根证书构成一套证书链,而TLS客户端只会与拥有同一证书链中对应证书对的TLS服务端握手,于是保证了,请求第一任务分组的用户终端,只会与运行第一任务分组中各计算任务的可信计算单元进行握手,且运行第一任务分组中各计算任务的各个可信计算单元之间彼此可以进行握手,建立可信通道,从而实现多方安全计算。
下面描述以上构思的具体实现方式。
首先,在配置阶段,为各个计算任务设置分组,使得执行同一分布式任务的多个计算任务构成一个任务分组。对于形成的任务分组,为其分配组标识。于是,每个任务 分组对应具有一个组标识。之后,使得各个计算任务获知其所属的任务分组的组标识,此外,还使得可信证书生成器获知分组信息,以便针对各个分组生成证书链。
在一个实施例中,通过配置管理器进行上述任务分组配置,并由配置管理器将分组配置信息通知可信证书生成器以及各个计算任务。
图2示出根据一个实施例通过配置管理器进行分组配置的过程示意图。如图所示,在步骤201,配置管理器可以接收配置人员进行的分组配置请求或配置操作,其中指示将多个计算任务划归为一个任务分组,简单起见称为第一任务分组。上述配置人员可以是配置管理器的管理员,分布式计算系统的管理员,甚至可以是请求计算服务的用户。在接收到上述配置请求或配置操作后,配置管理器为划归形成的第一任务分组分配组标识,称为第一组标识,并建立该第一组标识与第一任务分组中包含的上述多个计算任务的对应关系。
具体的,在一个例子中,假定图1中的三个计算任务,任务1,任务2和任务3用于执行同一分布式任务,那么配置人员可以在配置管理器中设定,将该三个计算任务划归为一个任务分组。于是,配置管理器为该任务分组分配组标识GID1,并建立组标识GID1与任务1,任务2和任务3的对应关系。
接着,在步骤202,配置管理器将上述第一组标识通知给第一任务分组中包含的多个计算任务。例如,将组标识GID1分别通知给任务1,任务2和任务3。
另一方面,在步骤203,配置管理器向可信证书生成器发出配置通知,该通知中包括,第一组标识,以及与第一组标识对应的第一哈希列表,该第一哈希列表包括属于第一任务分组的所有计算任务的代码哈希。
延续上例,对于任务1,任务2和任务3形成的任务分组GID1,配置管理器可以形成与组标识GID1对应的哈希列表1,其中包括,上述三个计算任务,任务1,任务2和任务3各自的代码哈希H1,H2和H3。于是,配置管理器可以向可信证书生成器发出针对上述任务分组的配置通知,其中包括组标识GID1,以及对应的哈希列表1:{H1,H2,H3}。
可以理解,步骤202和203可以以任意顺序执行。
在一个实施例中,可信证书生成器在接收到上述配置通知后,记录其中第一组标识和第一哈希列表的对应关系,以用于后续验证,并在后续证书签发阶段生成对应的证书。
更优选的,在另一实施例中,可信证书生成器将上述配置通知作为证书生成请求,相应地生成证书。具体的,在步骤204,可信证书生成器判断是否存在与第一组标识对应的证书链;如果存在,则拒绝生成请求,不再生成;如果没有,则针对该第一组标识,生成第一证书链和第一私钥,其中第一证书链包括第一根证书和对应的第一公钥证书,第一公钥证书与第一私钥相匹配,构成第一证书对。
下面对证书链和证书对进行简单的介绍。
数字证书是由证书认证机构CA(Certificate Authority)签发的、用来认证持有者身份合法性的电子文档,以防止第三方的冒充行为。一般地,数字证书中包括,持有者信息,持有者公钥,签发者信息,以及签发者的签名。由于数字证书中包含为持有者生成的公钥,因此也将这样的数字证书称为公钥证书。相应的,签发机构还会生成一个与持有者公钥对应匹配的私钥,该公钥和私钥构成非对称加密的密钥对。此时,公钥证书与私钥构成一个证书对。
图3示出一个示例中的数字证书的证书链和证书对。假定其中的数字证书33是签发机构CA1颁发给持有者U1的公钥证书,那么证书33中包括,持有者U1信息,持有者U1公钥K1,签发者CA1信息,以及签发者CA1的签名。签发者CA1还会生成与公钥K1对应的私钥k1,于是证书33和私钥k1构成证书对。
当验证者想要验证该证书33时,可以利用签发者CA1的公钥进行验证。然而,如果验证者对于签发者CA1不够信任的话,那么就需要向上追溯,获取CA1的证书,来验证CA1是否合法可信。于是,可以向上追溯到证书32,该证书32是签发机构CA2颁发给CA1的证书,其中包括,CA1信息(此时CA1是证书持有者),CA1公钥,签发者CA2信息,签发者CA2的签名。验证者可以利用证书32中的CA1公钥,验证证书33中的CA1签名。然而,如果验证者对于签发机构CA2仍然不够信任的话,就需要继续向上追溯,直到最终的根证书30。
根证书是根CA自己给自己颁发的证书,其中根CA一般是最高权威的CA中心,必须给予信任。如图所示,根证书30包括,根CA信息(此时根CA既是持有者,也是签发者),根CA公钥,以及根CA自己给自己的签名信息。
如此,根证书30和各个公钥证书构成一个证书链或信任链,其中根证书由根CA签发给自己,后续的各个公钥证书由根CA以及根CA逐级授权的各级CA签发产生。根证书是证书链的起点,证书链的层级数根据实际情况而定。
回到图2,与上述证书链类似的,在步骤204,证书生成器针对当前请求的第一任务分组生成第一证书链,该证书链中包括针对第一组标识生成的第一公钥证书,以及可信证书生成器作为根CA自签名的第一根证书,第一根证书和第一公钥证书形成证书链。可信证书生成器还生成第一私钥,该第一私钥与第一公钥证书中的公钥相匹配,构成第一证书对。这样的第一证书链和第一私钥,用于后续分发给用户终端和运行第一任务分组中各计算任务的可信计算单元。
可以理解,图2示出了通过配置管理器进行任务分组配置的过程。然而,任务分组配置还可以通过其他方式实现。例如,可以由配置人员直接对可信证书生成器和各个计算任务进行配置。
具体地,在一个实施例中,可信证书生成器具有配置接口,配置人员可以通过该配置接口,直接向可信证书生成器输入计算任务的分组信息,包括任务分组的组标识和对应的哈希列表,以使得可信证书生成器记录上述分组信息,并可选地针对各个组标识生成相应的证书链。配置人员还可以通过配置计算任务的启动项或可信计算单元的启动项,在其中设置各个计算任务所属的任务分组的组标识。如此,将任务分组信息配置到各个计算任务和可信证书生成器。
在进行任务分组配置之后,可信证书生成器可以分别为可信计算单元和用户终端签发证书,以实现其间的多方安全计算。
图4示出根据一个实施例为计算单元签发证书的过程示意图。通过图4的过程,可信证书生成器向运行第一计算任务的第一计算单元分发数字证书,便于其后续参与与计算服务相关的多方计算。可以理解,第一计算任务可以是任何计算任务,第一计算单元可以是执行该任务的任意可信计算单元。并且,在分组配置阶段该第一计算任务预先被配置为属于某个任务分组,在此称为第一任务分组。可以理解,该第一任务分组还可以包括至少一个其他计算任务。
例如,延续之前的例子,假定图1中所示的任务1,任务2,任务3被配置为形成一个任务分组。那么,图4中的第一计算任务可以是任务1,任务2,任务3中的任一个,相应的,第一计算单元可以是可信计算单元11,12,13中的任一个。更具体的,可以假定第一计算任务为任务1,第一计算单元为可信计算单元11。
下面描述签发证书的过程。
在步骤401,当第一计算任务在第一计算单元中启动时,生成第一认证信息,用于 其他方对第一计算单元进行可信认证。该可信认证一般是通过远程认证RA(Remote Attestation)实现,因此,又将生成的认证信息称为RA信息或RA报告。
在一个实施例中,第一计算单元生成本计算单元的单元报告文件作为上述第一认证信息,其中单元报告文件用于描述第一计算单元自身配置状况和运行状况。具体的,该单元报告文件至少包括,其中运行的第一计算任务的代码哈希,称为第一代码哈希。可以理解,第一代码哈希可以唯一地标识出所运行的第一计算任务。可选的,该单元报告中还可以包括其中运行的第一计算任务的其他描述信息,例如名称、版本、属性信息等等。
上述单元报告文件还包括该第一计算单元的签名信息,以此保证单元报告文件的真实可靠,防止伪造和篡改。签名信息可以通过各种签名方式得到,例如哈希算法,加密算法等。在一个具体实施例中,签名信息依赖于对应第一计算单元的硬件密钥,该硬件密钥唯一对应于实体硬件,如此确保单元报告文件中的签名信息确实是由基于该硬件的可信计算单元产生。
在一个实施例中,上述单元报告文件还包括第一计算单元的硬件信息,例如CPU主频,内存容量等等。在一个实施例中,上述单元报告文件还包括第一计算单元的运行时环境信息,从而更全面地描述当前的运行状况。在又一实施例中,单元报告文件还可以包括其他用户自定义的数据,以根据需要描述和定义可信计算单元的其他信息。
如此,上述生成的单元报告文件可以作为第一认证信息,用于其他方对第一计算单元进行可信认证。
在一个实施例中,第一计算单元在生成上述单元报告文件后,将该单元报告文件发送至第三方认证机构进行认证,以获得认证结果文件,从而将认证结果文件作为第一认证信息。
可以理解,上述第三方认证机构是可信的、具有认证能力的权威认证机构。通常,假定各个可信计算单元在投入使用之前,会向该第三方认证机构进行注册,因此,该第三方认证结构登记有各个可信计算单元的配置状况,从而后续可以对其进行认证。
例如,在上述第一计算单元是通过Intel SGX实现的可信围圈Enclave的情况下,该第三方认证机构即为Intel认证服务器(Attestation Service)。在第一计算单元通过其他方式实现的情况下,该第三方认证机构可以是生产、部署对应计算单元的机构或其关联机构。
在接收到第一计算单元的单元报告文件后,第三方认证机构可以基于该单元报告,对第一计算单元的安全性和可信性进行认证。具体地,第三方认证机构首先根据单元报告文件中的签名信息,认证该单元报告文件是否真实无篡改,并根据维护的各个可信计算单元预先注册的信息,判断第一计算单元是否确实可信。此外,第三方认证机构还根据单元报告文件中的第一计算任务的相关信息,验证第一计算任务的程序代码是否运行在可信执行环境中,并验证第一代码哈希是否符合预期。
在对上述单元报告文件进行验证且验证通过的情况下,第三方机构可以在该单元报告文件上添加自身的签名,生成认证结果文件。也就是说,该认证结果文件中包含第三方认证机构的签名信息。
在获取到第三方认证机构返回的认证结果文件后,第一计算单元可以将该认证结果文件作为第一认证信息,作为可信计算单元的证明。
此外,在步骤402,第一计算单元与可信证书生成器进行密钥协商,建立可信通道,又称为RA通道。
具体地,第一计算单元与可信证书生成器可以采用各种密钥协商方式,确定出共同的密钥或密钥对。例如,采用DH(Diffie-Hellman)密钥交换方法,或者采用基于椭圆曲线的ECDH密钥交换方式,等等。利用协商得到的密钥或密钥对,可以建立可信通道,确保通过该可信通道传输的数据只有双方可以获取。
需要理解,步骤401和步骤402可以不限于图4所示的顺序,两者可以交换顺序执行,也可以并行执行。
接着,在步骤403,利用上述RA通道,第一计算单元向可信证书生成器发送获取证书的请求,以下称为第一证书请求。该第一证书请求中包括,第一计算任务所属的第一任务分组的组标识,称为第一组标识,以及步骤401中得到的第一认证信息,其中包含有第一计算任务的第一代码哈希。其中,第一组标识在如前所述的任务分组配置阶段,已经通知或配置给第一计算任务,因此,在第一计算单元中启动第一计算任务时,可以直接获取到之前配置的第一组标识,将其包含在第一证书请求中。
在接收到第一证书请求后,在步骤404,可信证书生成器首先基于上述第一认证信息,对第一计算单元进行认证。
如前所述,在一个实施例中,上述第一认证信息可以是第一计算单元生成的单元报告文件。在这样的情况下,可信证书生成器将该单元报告文件发送至上述第三方认证 机构,由该第三方认证机构进行验证。在验证通过的情况下,返回认证结果文件,其中包含有该第三方认证机构的签名信息。于是,可信证书生成器进一步验证该签名信息,验证通过,则认为第一计算单元认证通过。
在另一实施例中,上述第一认证信息也可以是第一计算单元从第三方认证机构收到的认证结果文件。在这样的情况下,可信证书生成器只需要验证该认证结果文件中的签名信息。验证通过,则认为第一计算单元认证通过。
如果对第一计算单元的认证通过,那么在步骤405,可信证书生成器根据第一代码哈希判断第一计算任务是否属于第一任务分组。
如前所述,在任务分组配置阶段,可信证书生成器会通过配置管理器或通过配置接口,获取到各个任务分组对应的哈希列表,其中包括属于对应任务分组的所有计算任务的代码哈希。于是,在步骤405,可信证书生成器可以读取预先配置的、与第一组标识对应的第一哈希列表,该第一哈希列表包括属于第一任务分组的所有计算任务的代码哈希。然后,判断第一认证信息中包含的第一代码哈希是否位于第一哈希列表中,如果是,则确认该第一计算任务属于第一任务分组。
例如,假定步骤403中的第一证书请求中包含第一组标识GID1,第一认证信息中包含第一代码哈希H1。那么在步骤405,可信证书生成器可以根据该组标识GID1读取到配置阶段获得的对应的哈希列表1:{H1,H2,H3}。然后判断第一代码哈希H1是否包含在哈希列表1中,据此判断第一计算任务是否属于第一任务分组。
如果第一计算任务不属于第一任务分组,那么拒绝该证书请求,返回错误信息。如果确认第一计算任务属于第一任务分组,那么继续执行后续步骤。
接下来,在步骤406,可信证书生成器获取针对第一组标识生成的第一证书链和第一私钥。
在一个实施例中,在前述的分组配置阶段,可信证书生成器已经针对各个任务分组各自的组标识,生成对应的证书链。在这样的情况下,在步骤406,可信证书生成器读取预先针对第一组标识生成的第一证书链和第一私钥。
在另一实施例中,在分组配置阶段,可信证书生成器只是记录各个任务分组的组标识和对应的哈希列表。在证书分发阶段,可信证书生成器针对各个组标识生成证书链。相应的,在步骤406,可信证书生成器判断是否存在与第一组标识对应的证书链,如果存在(例如运行同一任务分组中其他计算任务的其他计算单元先于第一计算单元发出了 证书请求),则读取该已经生成的证书链作为第一证书链。如果不存在,那么可信证书生成器针对该第一组标识生成第一证书链和第一私钥。
如前所述,第一证书链包括第一根证书和对应的第一公钥证书,第一根证书是可信证书生成器作为根CA自签名的证书,第一公钥证书是第一根证书的下游公钥证书,并与第一私钥相匹配,构成第一证书对。
在不同实施例中,第一公钥证书和第一根证书可以采用多种格式,例如,采用密码学中公钥证书的标准格式X.509证书。
此外,需要理解的是,可信证书生成器会针对不同任务分组,也就是不同组标识,生成不同证书链,一个证书链中的根证书和公钥证书具有对应关系,不同证书链中的根证书彼此不同。
相应地,对于第一证书链来说,第一根证书是信任链起点,与第一公钥证书相对应。在不同实施例中,第一公钥证书与第一根证书以不同的方式相对应。
图5示出在一个实施例中的第一证书链。在图5中,证书51为第一公钥证书,其中包括,作为证书持有者的第一任务分组(例如记为GID1)信息,第一公钥K1(为组标识GID1生成的公钥),作为签发者的证书生成器的信息,以及证书生成器签名的第一签名信息。第一私钥k1与第一公钥K1相匹配。证书50为第一根证书,其中包括证书生成器的信息(既作为证书持有者又作为签发者),第二公钥K2(证书生成器对外的签名公钥),以及证书生成器自签名的第二签名信息。其中,第一公钥证书51中的第一签名信息和第一根证书50中的第二签名信息,均使用第二公钥K2进行校验。并且,该第二公钥K2是针对第一任务分组的第一组标识生成的,如此,第一根证书50和第一公钥证书51均唯一地对应于第一组标识。
图6示出在另一实施例中的第一证书链。在图6中,证书61为第一公钥证书,其中包括,作为证书持有者的第一任务分组(例如记为GID1)信息,第一公钥K1(为组标识GID1生成的公钥),作为签发者的证书生成器的信息,以及证书生成器签名的第一签名信息。证书60为第一根证书,其中包括证书生成器的信息(既作为证书持有者又作为签发者),第一公钥K1,以及证书生成器自签名的第二签名信息。
可以看到,图6不同于图5之处在于,在图6的第一根证书60中,同样使用为组标识GID1生成的第一公钥K1作为证书生成器对外的签名公钥。于是,第一公钥证书61中的第一签名信息和第一根证书60中的第二签名信息,均使用第一公钥K1进行校 验。如此,简化了证书链的公钥生成。并且,由于第一公钥K1针对GID1而生成,第一根证书60和第一公钥证书61均唯一地对应于第一组标识。
在其他例子中,第一公钥证书和第一根证书还可以相隔更多层级(如图3中的证书33和30)而互相对应。
如此,可信证书生成器获取针对第一组标识生成的第一根证书,第一公钥证书和第一私钥。
接着,在步骤407,可信证书生成器通过之前建立的可信通道,即RA通道,向第一计算单元发送证书报告,称为第一证书报告。该第一证书报告中包括,第一根证书,以及第一公钥证书和第一私钥构成的第一证书对。通过RA通道,第一证书报告的内容不会被其他计算单元获得。
在第一计算单元获取到第一证书报告后,在步骤408,使用其中的证书以TLS安全协议的方式来加固在线服务接口,从而为后续进行与计算服务相关的多方计算提供基础。
传输层安全协议TLS(Transport Layer Security)是与上层应用层解耦合的安全协议,用于在两个通信应用程序之间提供保密性和数据完整性。应用层协议,例如HTTP/RPC协议等,能透明地运行在TLS协议之上,由TLS协议进行创建加密通道需要的协商和认证。应用层协议传送的数据在通过TLS协议时都会被加密,从而保证通信的私密性。
具体的,TLS安全协议支持客户端和服务端通信方式,其中TLS客户端和TLS服务端利用证书进行握手,建立加密通道,以此加固上层的网络服务,例如HTTP/RPC网络服务。
相应的,在步骤408,第一计算单元可以以自身作为提供第一计算任务的计算服务的TLS服务端,将接收到的第一证书对设置为TLS服务端的证书对。此外,为了与同一任务分组中其他计算任务协作,第一计算单元还将自身作为与其他计算任务连接的TLS客户端,并将第一根证书设置为TLS客户端的可信根证书。于是,第一计算单元后续可以作为TLS服务端,向具有对应的第一根证书的其他TLS客户端提供第一计算任务的计算服务,还可以作为TLS客户端,与具有第一证书对的其他TLS服务端通信,与其进行协同计算。这将在后续进行详细描述。
如此,通过图4的过程,运行第一计算任务的第一计算单元从可信证书生成器获 得针对第一任务分组生成的证书和私钥。可以理解,其他各个计算单元均可以执行图4所示的过程,分别获得与运行的计算任务所属任务分组所对应的证书。
图7示出在执行图4所示的过程之后各个计算单元的状态。如图7所示,由于可信计算单元11、12、13分别执行任务1、任务2和任务3,假定任务1、任务2和任务3同属于第一任务分组,那么,可信计算单元11、12、13均可以获取到针对第一任务分组的组标识GID1生成的第一根证书、第一公钥证书和第一私钥。可信计算单元14运行任务4,假定任务4属于第二任务分组,因此可信计算单元14可以获得针对第二任务分组生成的第二根证书、第二公钥证书和第二私钥。如此,各个计算单元可以获得与其运行的计算任务对应的证书和私钥。
在此基础上,可信证书生成器还响应于用户终端的请求,为用户终端分发对应的证书,以便于用户终端和可信计算单元进行通信。
图8示出根据一个实施例为用户终端分发证书的过程示意图。
首先,在步骤801,用户终端向可信证书生成器发出认证请求,请求对可信证书生成器进行RA认证。
于是,在步骤802,可信证书生成器向用户终端提供自身的RA信息,称为第二认证信息,以供用户终端进行认证。
相应的,在步骤803,用户终端基于该第二认证信息,对可信证书生成器进行认证。
与可信计算单元的认证类似的,在一个实施例中,可信证书生成器生成自身的报告文件,该报告文件包括可信证书生成器自身的代码哈希和签名信息。可选的,该报告文件还包括可信证书生成器的其他配置描述信息。于是,在步骤802,可信证书生成器将该报告文件作为上述第二认证信息,发送给用户终端。
在步骤803,用户终端将上述报告文件发送给第三方认证机构。与前述类似的,第三方认证机构基于该报告文件的签名信息和代码哈希进行验证,在验证通过后,在报告文件上添加上签名,作为认证结果文件。因此,该认证结果文件包含第三方认证机构的签名信息。于是,用户终端可以对该签名信息进行验证,据此对可信证书生成器进行认证。
或者,在另一实施例中,可信证书生成器在生成上述报告文件后,将该报告文件发送至第三方认证机构,并从该第三方认证机构获得认证结果文件。在步骤802,可信证书生成器将该认证结果文件作为第二认证信息,提供给用户终端。相应的,在步骤803, 用户终端仅需要对认证结果文件中的签名信息进行验证,据此实现对可信证书生成器的认证。
在对可信证书生成器认证通过后,在步骤804,用户终端向可信证书生成器发送证书请求,称为第二证书请求,该第二证书请求中包括,用户终端期望连接的第一任务分组的第一组标识。在一个具体例子中,用户终端可以向配置管理器查询期望连接的任务分组的组标识,将其包含在第二证书请求中。
例如,在图1的示意图中,用户终端想要连接到任务1、任务2和任务3所形成的第一任务分组,则在上述证书请求中包含该任务分组的组标识,例如GID1。
可信证书生成器在接收到上述第二证书请求后,在步骤805,获取预先针对该第一组标识生成的第一证书链和第一私钥,其中第一证书链包括第一根证书和与其对应的第一公钥证书,第一公钥证书与第一私钥构成第一证书对。并且,如图4所示,可信证书生成器已经预先将第一证书对分发给经过认证的、运行第一任务分组中各个计算任务的至少一个计算单元。
然后,在步骤806,可信证书生成器向用户终端返回证书报告,称为第二证书报告,其中至少包括上述第一证书链中的第一根证书。
可选的,在一个实施例中,第二证书报告中还包括,第一组标识对应的第一哈希列表,该第一哈希列表包括属于第一任务分组的所有计算任务的代码哈希。
在这样的情况下,在步骤807,用户终端判断所述第一哈希列表是否符合预期。具体地,用户终端判断第一哈希列表中包括的每个代码哈希是否符合预期,也就是,每个代码哈希是否是期望连接的任务分组中计算任务的代码哈希。据此,用户终端判断可信证书生成器中的任务分组信息是否符合预期,该任务分组中的任务程序代码行为是否符合预期。
如果第一哈希列表中包含任何一个非预期的代码哈希,那么用户终端会认为,任务分组信息不一致,拒绝信任可信证书生成器发送的证书。
如果第一哈希列表符合预期,那么接着在步骤808,用户终端将自身作为TLS客户端,将接收到的第一根证书设置为TLS客户端的可信根证书。
而另一方面,如图4中步骤408所示以及如图7所示,运行第一任务分组中各个计算任务的各个计算单元在通过认证之后,会获得第一根证书和第一证书对,并进行相应的TLS设置,也就是以自身为TLS客户端和TLS服务端,将第一根证书作为TLS客 户端信任的根证书,将第一证书对作为TLS服务端证书对。在用户终端和各个计算单元均进行相应TLS设置之后,用户终端与运行第一任务分组的各个计算单元之间,以及该各个计算单元彼此之间,就可以使用TLS安全协议进行安全的多方计算。
如前所述,TLS安全协议支持客户端和服务端通信方式。具体来说,在第一根证书与第一公钥证书形成证书链的情况下,将第一根证书作为唯一可信根证书的TLS客户端就可以,并且仅可以,与具有第一证书对的TLS服务端进行握手,进而建立TLS可信通道。具有第一根证书的TLS客户端与具有第一证书对的TLS服务端可以通过以下方式实现TLS握手。
首先,TLS客户端发起握手请求,TLS服务端将第一公钥证书和生成的随机数N1返回给TLS客户端。
由于TLS客户端已经将第一根证书设置为唯一可信根证书,而第一公钥证书为该第一根证书信任链中的证书,因此,TLS客户端会认为第一公钥证书可信。于是TLS客户端生成另一随机数N2,并使用第一公钥证书中的第一公钥加密该随机数N2,发送给TLS服务端。
TLS服务端利用第一证书对中的第一私钥解密出随机数N2,并根据之前的随机数N1,N2和约定的加密算法,生成用于加密后续传输数据的会话密钥。TLS客户端在确认该会话密钥后,双方就握手成功,利用该会话密钥建立了TLS可信通道。在握手成功后,TLS客户端就可以与TLS服务端通过TLS可信通道交换数据。
利用以上的TLS客户端和服务端的通信机制,用户终端以及运行第一任务分组的计算单元之间就可以进行多方安全计算。具体的,由于用户终端作为TLS客户端,将第一根证书设置为可信根证书,而运行第一任务分组中各个计算任务的各个计算单元均可以作为TLS服务端,且将第一证书对作为服务端证书对,因此,请求第一任务分组的计算服务的用户终端,可以与运行第一任务分组中各个计算任务的各个计算单元建立TLS可信通道,进行安全通信。此外,各个计算单元本身又可以作为TLS客户端,且也将第一根证书设置为可信根证书,因此,作为TLS客户端的一个计算单元可以与作为TLS服务端的另一计算单元建立TLS可信通道,并且,该另一计算单元必然是运行同一任务分组中计算任务的计算单元。如此,在用户终端和多个计算单元之间实现安全的多方计算。
可以看到,在图8的过程中,用户终端只是对可信证书生成器进行了RA认证,而 没有对各个计算单元进行RA认证。但是应理解,根据图4的过程,可信证书生成器在分发证书前,会首先对计算单元进行RA认证,认证通过的情况下,才为计算单元分发证书。因此,用户终端对可信证书生成器进行RA认证,就意味着,对可信计算单元间接地进行了RA认证。并且,综合图4和图8的过程,证书链中证书的各自分发相当于同时实现了RA认证和TLS校验,简化了安全认证的过程。
在一个实施例中,第一任务分组的计算服务不仅需要在多方之间进行数据交换,还需要存储和读取持久化的数据。在这样的情况下,在图8的步骤806中,可信证书生成器可以在返回给用户终端的第二证书报告中进一步包括第一公钥证书。于是,用户终端可以利用该第一公钥证书加密用户数据,并将加密的用户数据持久化存入数据平台。而如前所述,运行第一任务分组中各个计算任务的各个计算单元均获取有第一证书对,其中包含第一私钥。因此,上述各个计算单元可以利用第一证书对中的第一私钥解密获取上述用户数据。此外,各个计算单元也可以利用第一证书对中的第一公钥加密产生的中间数据,存入数据平台,其他计算单元可以利用第一私钥解密获得该中间数据。如此,确保需要持久化存储的数据仅可以由同一任务分组中的计算单元获得。
图9示出在执行图4和图8所示的过程之后系统的状态。如图9所示,运行同一任务分组中各个计算任务的各个计算单元,均获得该任务分组对应的根证书和证书对。例如,任务1、任务2、任务3同属于第一任务分组,那么分别运行这3个计算任务的可信计算单元11、12、13均获取到针对第一任务分组生成的第一根证书和第一证书对。而运行另一任务分组中计算任务4的可信计算单元14则获得到不同的第二根证书和第二证书对。另一方面,请求第一任务分组的计算服务的用户终端也从可信证书生成器获取到第一根证书,其中第一根证书与第一证书对中的第一公钥证书相对应,构成证书链。可选的,用户终端也可以获取到第一公钥证书,用于加密持久化数据。
基于图9所示的系统状态,用户终端和多个计算单元之间可以利用TLS协议进行安全计算。下面结合图9,描述运行第一任务分组中某个计算任务的计算单元,仍称为第一计算单元,进行多方计算的过程。
图10示出在一个实施例中进行多方安全计算的方法流程图。需要说明的是,图10的方法由运行第一任务分组中第一计算任务的第一计算单元执行,且运行第一任务分组中各个计算任务的各个计算单元,以及用户终端,已经进行了相应的TLS设置,如图9所示。
在这样的情况下,在步骤101,第一计算单元作为TLS服务端,与作用为TLS客 户端的用户终端进行TLS握手,建立第一TLS可信通道。握手的过程如前所述,不复赘述。
在步骤102,第一计算单元通过第一TLS可信通道,从用户终端接收第一用户数据。
在步骤103,第一计算单元运行的第一计算任务对第一用户数据进行第一处理,得到第一应用数据。
在步骤104,第一计算单元作为TLS客户端,与作用为TLS服务端的第二计算单元进行TLS握手,建立第二TLS可信通道;其中第二计算单元是运行第一任务分组中另一计算任务,即第二计算任务,的计算单元。
在步骤105,第一计算单元通过第二TLS可信通道,将上述第一应用数据传送给第二计算单元。
通过以上过程,利用TLS可信通道,第一计算单元从用户终端接收用户数据,对其处理之后,传输给运行同一任务分组中计算任务的第二计算单元,从而至少在用户终端、第一计算单元和第二计算单元之间实现多方安全传输和计算。
进一步的,在一个实施例中,第一任务分组的计算服务需要存储持久化数据。在这样的情况下,在一个例子中,图10的方法还包括,第一计算单元从数据平台读取第二用户数据,该第二用户数据由用户终端使用第一公钥证书加密产生。于是,第一计算单元可以使用第一私钥解密该第二用户数据,从而得到对应的数据明文。
在另一实施例中,第一计算单元自身会产生中间数据,并将其持久化进行存储,同一任务分组中的其他计算单元可以读取该持久化数据。具体的,在一个例子中,图10的方法还包括以下步骤。第一计算单元生成第二应用数据,然后使用第一公钥证书加密该第二应用数据,得到第二加密应用数据。第一计算单元于是将该第二加密应用数据存入数据平台,以供其他计算单元,例如第二计算单元利用第一证书对进行解密获取。
通过以上过程,第一计算单元可以与用户终端,以及与同一任务分组中的其他计算单元进行多方安全计算。
基于图9回顾整个过程,在本说明书的一个实施例中,通过可信证书生成器生成并分发证书,实现安全认证和校验,便于用户终端与可信计算单元之间进行多方安全通信和计算。具体的,预先将计算任务进行分组,形成任务分组。可信证书生成器通过组标识区分不同任务分组,针对一个组标识生成一套证书链和一个私钥,其中证书链中包 括根证书和对应的公钥证书,公钥证书与私钥相匹配,构成一个证书对。然后,可信证书生成器将该上述根证书和证书对分发给经过认证的、运行该组标识对应的各个计算任务的各个可信计算单元。于是,运行同一任务分组中各个计算任务的多个可信计算单元会获得同样的根证书和证书对。另一方面,可信证书生成器将上述根证书分发给请求该任务分组的计算服务的用户终端。于是,具有根证书的用户终端、具有根证书和证书对的可信计算单元之间,可以通过TLS协议的方式,进行多方安全通信。
根据另一方面的实施例,提供了一种获取证书以进行多方安全计算的装置,该装置部署在运行第一计算任务的第一计算单元中。所述第一计算任务预先被配置为属于第一任务分组,所述第一任务分组还包括至少一个其他计算任务。图11示出在一个实施例中部署在第一计算单元中的获取证书的装置的示意性框图。如图11所示,该装置110包括:
第一证书请求模块111,配置为向可信证书生成器发送第一证书请求,所述第一证书请求包括所述第一任务分组的第一组标识,以及第一认证信息,所述第一认证信息用于对第一计算单元进行可信认证,并包括所述第一计算任务的第一代码哈希;
第一报告接收模块113,配置为从所述可信证书生成器接收第一证书报告,所述第一证书报告包括针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书以及对应的第一公钥证书,所述第一公钥证书与所述第一私钥相匹配,构成第一证书对;
第一设置模块115,配置为以所述第一计算单元作为提供所述第一计算任务的计算服务的TLS服务端,将所述第一证书对设置为所述TLS服务端的证书对;并且以所述第一计算单元作为与所述至少一个其他计算任务连接的TLS客户端,将所述第一根证书设置为所述TLS客户端的可信根证书。
在一个具体实施例中,所述第一计算单元实现为可信围圈Enclave。
根据一个实施例,上述装置110还包括认证信息生成模块(未示出),用于生成上述第一认证信息。
在一个具体的实施例中,所述认证信息生成模块配置为:
生成第一计算单元的单元报告文件,所述单元报告文件包括所述第一代码哈希,所述第一计算单元的签名信息;
将所述单元报告文件发送至第三方认证机构,以获得认证结果文件,所述认证结 果文件包含所述第三方认证机构的签名信息;
将所述认证结果文件作为所述第一认证信息包含在所述第一证书请求中。
在另一具体的实施例中,所述认证信息生成模块配置为:
生成第一计算单元的单元报告文件,所述单元报告文件包括所述第一代码哈希,所述第一计算单元的签名信息;
将所述单元报告文件作为所述第一认证信息包含在所述第一证书请求中。
根据一种实施方式,该装置110还包括密钥协商模块,配置为在向可信证书生成器发送第一认证请求之前,与所述可信证书生成器进行密钥协商,建立可信通道,所述可信通道用于发送所述第一证书请求,以及接收所述第一证书报告。
根据另一方面的实施例,提供了一种为计算单元分发证书的装置,部署在可信证书生成器中。该可信证书生成器可以通过任何具有计算、处理能力的设备、平台或设备集群实现。图12示出在一个实施例中为计算单元分发证书的装置的示意性框图。如图12所示,该装置120包括:
第一请求接收模块121,配置为从运行第一计算任务的第一计算单元接收第一证书请求,所述第一证书请求包括第一任务分组的第一组标识,以及第一认证信息,所述第一认证信息用于对所述第一计算单元进行认证,且包括所述第一计算任务的第一代码哈希;
单元认证模块123,配置为根据所述第一认证信息对所述第一计算单元进行认证;
分组判断模块125,配置为在认证通过的情况下,根据所述第一代码哈希判断所述第一计算任务是否属于所述第一任务分组;
证书获取模块127,配置为在确认所述第一计算任务属于所述第一任务分组的情况下,获取预先针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书和对应的第一公钥证书,所述第一公钥证书与所述第一私钥相匹配,构成第一证书对;
第一报告发送模块129,配置为向所述第一计算单元发送第一证书报告,所述第一证书报告包括所述第一根证书和所述第一证书对,使得所述第一计算单元以自身为提供计算服务的TLS服务端和与其他计算任务连接的TLS客户端,将所述第一证书对设置为TLS服务端的证书对,将所述第一根证书设置为TLS客户端的可信根证书。
在一个实施例中,第一请求接收模块121接收的第一认证信息为经过第三方认证机构认证的认证结果文件,该认证结果文件包含该第三方认证机构的签名信息;在这样的情况下,所述单元认证模块123配置为:
校验所述签名信息,在校验成功的情况下,确定所述第一计算单元认证通过。
在另一实施例中,第一请求接收模块121接收的第一认证信息为所述第一计算单元生成的单元报告文件,所述单元报告文件包括所述第一代码哈希,以及所述第一计算单元的签名信息;在这样的情况下,所述单元认证模块123配置为:
将所述单元报告文件发送至第三方认证机构,以获得认证结果文件,所述认证结果文件包含所述第三方认证机构的签名信息;
校验所述签名信息,在校验成功的情况下,确定所述第一计算单元认证通过。
根据一种实施方式,装置120还包括证书生成模块(未示出),配置为:
从配置管理器接收第一生成命令,所述第一生成命令包括,所述第一组标识,以及与所述第一组标识对应的第一哈希列表,该第一哈希列表包括属于所述第一任务分组的所有计算任务的代码哈希;
针对所述第一组标识,生成所述第一证书链和第一私钥。
根据一个实施例,所述分组判断模块125配置为,获取预先配置的、与所述第一组标识对应的第一哈希列表,该第一哈希列表包括属于所述第一任务分组的所有计算任务的代码哈希;
判断所述第一代码哈希是否位于所述第一哈希列表中,如果是,则确认所述第一计算任务属于所述第一任务分组。
根据一个具体实施例,所述第一公钥证书包括针对所述第一组标识生成的第一公钥,以及所述可信证书生成器签名的第一签名信息,其中所述第一公钥和所述第一私钥构成密钥对;所述第一根证书中包括针对所述第一组标识生成的第二公钥,以及所述可信证书生成器自签名的第二签名信息;所述第二公钥用于对所述第一签名信息和第二签名信息进行校验。
根据另一具体实施例,所述第一公钥证书包括针对所述第一组标识生成的第一公钥,以及所述可信证书生成器签名的第一签名信息,其中所述第一公钥和所述第一私钥构成密钥对;所述第一根证书包括所述第一公钥,以及所述可信证书生成器自签名的第 二签名信息;所述第一公钥用于对所述第一签名信息和第二签名信息进行校验。
根据一种实施方式,装置120还包括密钥协商模块(未示出),用于在接收第一证书请求之前,与所述第一计算单元进行密钥协商,建立可信通道,所述可信通道用于接收所述第一证书请求,以及发送所述第一证书报告。
根据又一方面的实施例,提供了一种获取证书以进行多方安全计算的装置,部署在用户终端中。该用户终端可以通过任何具有计算、处理能力的设备实现。图13示出在一个实施例中部署在用户终端中的获取证书的装置的示意性框图。如图13所示,该装置130包括:
第二请求发送模块131,配置为向可信证书生成器发送第二证书请求,所述第二证书请求中包括,期望连接的第一任务分组的第一组标识;
第二报告接收模块133,配置为从所述可信证书生成器接收第二证书报告,所述第二证书报告至少包括针对所述第一组标识生成的第一证书链中的第一根证书,所述第一证书链还包括与所述第一根证书对应的第一公钥证书;所述第一公钥证书和匹配的第一私钥构成第一证书对,被预先分发给经过认证的、运行所述第一任务分组中各个计算任务的至少一个计算单元;
第二设置模块135,配置为以所述用户终端为TLS客户端,将所述第一根证书设置为所述TLS客户端的可信根证书,从而与具有所述第一证书对、且作用为TLS服务端的所述至少一个计算单元通信。
根据一种实施方式,上述装置130还包括认证模块(未示出),配置为:
获取所述可信证书生成器的第二认证信息;
根据所述第二认证信息,对所述可信证书生成器进行认证。
进一步的,根据一个实施例,上述第二认证信息为经过第三方认证机构认证的认证结果文件,该认证结果文件包含该第三方认证机构的签名信息;相应的,认证模块配置为:校验所述签名信息,在校验成功的情况下,确定所述可信证书生成器认证通过。
根据另一实施例,所述第二认证信息为所述可信证书生成器生成的报告文件,所述报告文件包括所述可信证书生成器自身的代码哈希和签名信息;相应的,认证模块配置为:
将所述报告文件发送至第三方认证机构,以获得认证结果文件,所述认证结果文 件包含所述第三方认证机构的签名信息;
校验所述签名信息,在校验成功的情况下,确定所述证书生成器认证通过。
根据一种实施方式,第二证书报告还包括,所述第一组标识对应的第一哈希列表,该第一哈希列表包括属于所述第一任务分组的所有计算任务的代码哈希;相应的,装置130还包括哈希确认模块(未示出),配置为,在所述第二配置模块135将所述第一根证书设置为所述TLS客户端的可信根证书之前,判断所述第一哈希列表是否符合预期。
根据一种实施方式,上述装置130还包括通信模块(未示出),在第二配置模块135将所述第一根证书设置为所述TLS客户端的可信根证书之后,所述通信模块用于与所述至少一个计算单元进行TLS握手,建立TLS可信通道;通过TLS可信通道,从所述至少一个计算单元获取所述第一任务分组的计算服务。
根据一个实施例,第二证书报告还包括第一公钥证书;相应的,装置130还包括加密模块,配置为,利用所述第一公钥证书加密所述用户终端的用户数据,并将加密的用户数据存入数据平台,以供所述至少一个计算单元利用所述第一证书对进行解密获取。
根据另一方面的实施例,还提供了一种为用户终端分发证书的装置,部署在可信证书生成器中。该可信证书生成器可以通过任何具有计算、处理能力的设备、平台或设备集群实现。图14示出在一个实施例中为用户终端分发证书的装置的示意性框图。如图14所示,该装置140包括:
第二请求接收模块141,配置为接收用户终端发送的第二证书请求,所述第二证书请求中包括,所述用户终端期望连接的第一任务分组的第一组标识;
证书获取模块143,配置为获取预先针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书和与其对应的第一公钥证书,所述第一公钥证书与所述第一私钥匹配,构成第一证书对;至少所述第一证书对被预先分发给经过认证的、运行所述第一任务分组中各个计算任务的至少一个计算单元;
第二报告发送模块145,配置为向所述用户终端发送第二证书报告,所述第二证书报告至少包括所述第一根证书,以使得所述用户终端以自身为TLS客户端,将所述第一根证书作为TLS客户端的可信根证书,从而与具有所述第一证书对、且作用为TLS服务端的所述至少一个计算单元通信。
根据一种实施方式,上述装置140还包括认证信息提供模块(未示出),在第二请求接收模块141接收用户终端发送的第二证书请求之前,该认证信息提供模块响应于 所述用户终端的认证请求,向所述用户终端提供第二认证信息,以供所述用户终端进行认证。
在一个进一步的实施例中,所述认证信息提供模块配置为:
生成报告文件,所述报告文件包括所述可信证书生成器自身的代码哈希和签名信息;
将所述报告文件发送至第三方认证机构,以获得认证结果文件,所述认证结果文件包含所述第三方认证机构的签名信息;
将所述认证结果文件作为所述第二认证信息提供给所述用户终端。
在另一个进一步的实施例中,所述认证信息提供模块配置为:
生成报告文件,所述报告文件包括所述可信证书生成器自身的代码哈希和签名信息;
将所述报告文件作为所述第二认证信息提供给所述用户终端。
在一个实施例中,第二报告发送模块145发送的第二证书报告还包括,所述第一组标识对应的第一哈希列表,该第一哈希列表包括属于所述第一任务分组的所有计算任务的代码哈希。
在一种实施方案中,第二报告发送模块145发送的第二证书报告还包括所述第一公钥证书,以使得所述用户终端利用所述第一公钥证书加密用户数据。
根据另一方面的实施例,提供了一种通过数字证书进行多方安全计算的装置,该装置部署在运行第一计算任务的第一计算单元中。图15示出在一个实施例中部署在第一计算单元中的进行多方计算的装置的示意性框图,其中:
第一计算任务预先被配置为属于第一任务分组,所述第一任务分组还包括第二计算单元所运行的第二计算任务;
所述第一计算单元预先被分发有针对所述第一任务分组生成的第一证书对和第一根证书,所述第一证书对包括第一公钥证书和匹配的第一私钥,所述第一公钥证书和第一根证书构成第一证书链;
并且,所述第一计算单元被配置作为提供所述第一计算任务的计算服务的第一TLS服务端,该第一TLS服务端以所述第一证书对作为其证书对;所述第一计算单元还被配置作为至少与所述第二计算单元连接的第一TLS客户端,所述第一TLS客户端以所述 第一根证书作为其可信根证书。
如图15所示,该装置150包括:
第一握手模块151,配置为利用所述第一TLS服务端与作用为第二TLS客户端的用户终端进行TLS握手,建立第一TLS可信通道;其中所述第二TLS客户端将所述第一根证书作为其可信根证书;
数据接收模块153,配置为通过所述第一TLS可信通道接收第一用户数据;
数据处理模块155,配置为对所述第一用户数据进行第一处理,得到第一应用数据;
第二握手模块157,配置为利用所述第一TLS客户端与作用为第二TLS服务端的第二计算单元进行TLS握手,建立第二TLS可信通道;其中所述第二TLS服务端将所述第一证书对作为其证书对;
数据发送模块159,配置为通过所述第二TLS可信通道将所述第一应用数据传送给所述第二计算单元。
在一个实施例中,上述装置150还包括数据获取模块(未示出),配置为:从数据平台读取第二用户数据,所述第二用户数据由所述用户终端使用所述第一公钥证书加密产生;使用所述第一私钥解密所述第二用户数据。
在一种实施方式中,上述装置150还包括,数据加密存储模块(未示出),配置为:生成第二应用数据;使用所述第一公钥证书加密所述第二应用数据,得到第二加密应用数据;将所述第二加密应用数据存入数据平台,以供所述第二计算单元利用所述第一证书对进行解密获取。
根据另一方面的实施例,还提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行结合图4、图8和图10所描述的方法。
根据再一方面的实施例,还提供一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现结合图4、图8和图10所述的方法。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进 行传输。
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本发明的保护范围之内。

Claims (36)

  1. 一种获取证书以进行多方安全计算的方法,通过运行第一计算任务的第一计算单元执行,所述第一计算任务预先被配置为属于第一任务分组,所述第一任务分组还包括至少一个其他计算任务;所述方法包括:
    向可信证书生成器发送第一证书请求,所述第一证书请求包括所述第一任务分组的第一组标识,以及第一认证信息,所述第一认证信息用于对第一计算单元进行可信认证,并包括所述第一计算任务的第一代码哈希;
    从所述可信证书生成器接收第一证书报告,所述第一证书报告包括针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书以及对应的第一公钥证书,所述第一公钥证书与所述第一私钥相匹配,构成第一证书对;
    以所述第一计算单元作为提供所述第一计算任务的TLS服务端,将所述第一证书对设置为所述TLS服务端的证书对,并且以所述第一计算单元作为与所述至少一个其他计算任务连接的TLS客户端,将所述第一根证书设置为所述TLS客户端的可信根证书。
  2. 根据权利要求1所述的方法,其中,所述第一计算单元实现为可信围圈Enclave。
  3. 根据权利要求1所述的方法,还包括,在向可信证书生成器发送第一认证请求之前:
    生成第一计算单元的单元报告文件,所述单元报告文件包括所述第一代码哈希,以及所述第一计算单元的签名信息;
    将所述单元报告文件发送至第三方认证机构,以获得针对第一计算单元的第一认证结果文件,所述第一认证结果文件包含所述第三方认证机构的签名信息;
    将所述第一认证结果文件作为所述第一认证信息包含在所述第一证书请求中。
  4. 根据权利要求1所述的方法,还包括,在向可信证书生成器发送第一认证请求之前:
    生成第一计算单元的单元报告文件,所述单元报告文件包括所述第一代码哈希,所述第一计算单元的签名信息;
    将所述单元报告文件作为所述第一认证信息包含在所述第一证书请求中。
  5. 根据权利要求1所述的方法,还包括,在向可信证书生成器发送第一认证请求之前:
    与所述可信证书生成器进行密钥协商,建立可信通道,所述可信通道用于发送所述第一证书请求,以及接收所述第一证书报告。
  6. 一种为计算单元分发证书的方法,通过可信证书生成器执行,所述方法包括:
    从运行第一计算任务的第一计算单元接收第一证书请求,所述第一证书请求包括第一任务分组的第一组标识,以及第一认证信息,所述第一认证信息用于对所述第一计算单元进行认证,且包括所述第一计算任务的第一代码哈希;
    根据所述第一认证信息对所述第一计算单元进行认证;
    在认证通过的情况下,根据所述第一代码哈希判断所述第一计算任务是否属于所述第一任务分组;
    在确认所述第一计算任务属于所述第一任务分组的情况下,获取预先针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书和对应的第一公钥证书,所述第一公钥证书与所述第一私钥相匹配,构成第一证书对;
    向所述第一计算单元发送第一证书报告,所述第一证书报告包括所述第一根证书和所述第一证书对,使得所述第一计算单元以自身为提供计算服务的TLS服务端和与其他计算任务连接的TLS客户端,将所述第一证书对设置为TLS服务端的证书对,将所述第一根证书设置为TLS客户端的可信根证书。
  7. 根据权利要求6所述的方法,其中,所述第一认证信息为第三方认证机构针对所述第一计算单元认证的第一认证结果文件,该第一认证结果文件包含该第三方认证机构的签名信息;
    所述根据所述第一认证信息对所述第一计算单元进行认证包括:
    校验所述第三方认证机构的签名信息,在校验成功的情况下,确定所述第一计算单元认证通过。
  8. 根据权利要求6所述的方法,其中,所述第一认证信息为所述第一计算单元生成的单元报告文件,所述单元报告文件包括所述第一代码哈希,以及所述第一计算单元的签名信息;
    所述根据所述第一认证信息对所述第一计算单元进行认证包括:
    将所述单元报告文件发送至第三方认证机构,以获得针对第一计算单元的第一认证结果文件,所述第一认证结果文件包含所述第三方认证机构的签名信息;
    校验所述第三方认证机构的签名信息,在校验成功的情况下,确定所述第一计算单元认证通过。
  9. 根据权利要求6所述的方法,其中,从运行第一计算任务的第一计算单元接收第一证书请求之前,还包括:
    从配置管理器接收第一生成命令,所述第一生成命令包括,所述第一组标识,以及 与所述第一组标识对应的第一哈希列表,该第一哈希列表包括属于所述第一任务分组的所有计算任务的代码哈希;
    针对所述第一组标识,生成所述第一证书链和第一私钥。
  10. 根据权利要求6所述的方法,其中,根据所述第一代码哈希判断所述第一计算任务是否属于所述第一任务分组,包括:
    获取预先配置的、与所述第一组标识对应的第一哈希列表,该第一哈希列表包括属于所述第一任务分组的所有计算任务的代码哈希;
    判断所述第一代码哈希是否位于所述第一哈希列表中,如果是,则确认所述第一计算任务属于所述第一任务分组。
  11. 根据权利要求6所述的方法,其中,所述第一公钥证书包括针对所述第一组标识生成的第一公钥,以及所述可信证书生成器签名的第一签名信息,其中所述第一公钥和所述第一私钥构成密钥对;所述第一根证书中包括针对所述第一组标识生成的第二公钥,以及所述可信证书生成器自签名的第二签名信息;所述第二公钥用于对所述第一签名信息和第二签名信息进行校验。
  12. 根据权利要求6所述的方法,其中,所述第一公钥证书包括针对所述第一组标识生成的第一公钥,以及所述可信证书生成器签名的第一签名信息,其中所述第一公钥和所述第一私钥构成密钥对;所述第一根证书包括所述第一公钥,以及所述可信证书生成器自签名的第二签名信息;所述第一公钥用于对所述第一签名信息和第二签名信息进行校验。
  13. 根据权利要求6所述的方法,其中,在从运行第一计算任务的第一计算单元接收第一证书请求之前,还包括:
    与所述第一计算单元进行密钥协商,建立可信通道,所述可信通道用于接收所述第一证书请求,以及发送所述第一证书报告。
  14. 一种获取证书以进行多方安全计算的方法,通过用户终端执行,所述方法包括:
    向可信证书生成器发送第二证书请求,所述第二证书请求中包括,期望连接的第一任务分组的第一组标识;
    从所述可信证书生成器接收第二证书报告,所述第二证书报告至少包括针对所述第一组标识生成的第一证书链中的第一根证书,所述第一证书链还包括与所述第一根证书对应的第一公钥证书;所述第一公钥证书和匹配的第一私钥构成第一证书对,被预先分发给经过认证的、运行所述第一任务分组中各个计算任务的至少一个计算单元;
    以所述用户终端为TLS客户端,将所述第一根证书设置为所述TLS客户端的可信 根证书,从而与具有所述第一证书对、且作用为TLS服务端的所述至少一个计算单元通信。
  15. 根据权利要求14所述的方法,其中,在向可信证书生成器发送第二证书请求之前,还包括:
    获取所述可信证书生成器的第二认证信息;
    根据所述第二认证信息,对所述可信证书生成器进行认证。
  16. 根据权利要求15所述的方法,其中,所述第二认证信息为第三方认证机构针对所述可信证书生成器认证的第二认证结果文件,该第二认证结果文件包含该第三方认证机构的签名信息;
    所述根据所述第二认证信息,对所述可信证书生成器进行认证包括:
    校验所述第三方认证机构的签名信息,在校验成功的情况下,确定所述可信证书生成器认证通过。
  17. 根据权利要求15所述的方法,其中,所述第二认证信息为所述可信证书生成器生成的报告文件,所述报告文件包括所述可信证书生成器自身的代码哈希和签名信息;
    所述根据所述第二认证信息,对所述可信证书生成器进行认证包括:
    将所述报告文件发送至第三方认证机构,以获得针对所述可信证书生成器的第二认证结果文件,所述第二认证结果文件包含所述第三方认证机构的签名信息;
    校验所述第三方认证机构的签名信息,在校验成功的情况下,确定所述证书生成器认证通过。
  18. 根据权利要求14所述的方法,其中,所述第二证书报告还包括,所述第一组标识对应的第一哈希列表,该第一哈希列表包括属于所述第一任务分组的所有计算任务的代码哈希;
    在将所述第一根证书设置为所述TLS客户端的可信根证书之前,所述方法还包括,判断所述第一哈希列表是否符合预期。
  19. 根据权利要求14所述的方法,其中,在将所述第一根证书设置为所述TLS客户端的可信根证书之后,还包括,
    与所述至少一个计算单元进行TLS握手,建立TLS可信通道;
    通过TLS可信通道,从所述至少一个计算单元获取所述第一任务分组的计算服务。
  20. 根据权利要求14所述的方法,其中,所述第二证书报告还包括,所述第一公钥证书,所述方法还包括:
    利用所述第一公钥证书加密所述用户终端的用户数据,并将加密的用户数据存入数 据平台,以供所述至少一个计算单元利用所述第一证书对进行解密获取。
  21. 一种为用户终端分发证书的方法,通过可信证书生成器执行,所述方法包括:
    接收用户终端发送的第二证书请求,所述第二证书请求中包括,所述用户终端期望连接的第一任务分组的第一组标识;
    获取预先针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书和与其对应的第一公钥证书,所述第一公钥证书与所述第一私钥匹配,构成第一证书对;至少所述第一证书对被预先分发给经过认证的、运行所述第一任务分组中各个计算任务的至少一个计算单元;
    向所述用户终端发送第二证书报告,所述第二证书报告至少包括所述第一根证书,以使得所述用户终端以自身为TLS客户端,将所述第一根证书作为TLS客户端的可信根证书,从而与具有所述第一证书对、且作用为TLS服务端的所述至少一个计算单元通信。
  22. 根据权利要求21的方法,其中,在接收用户终端发送的第二证书请求之前,还包括:
    响应于所述用户终端的认证请求,向所述用户终端提供第二认证信息,以供所述用户终端进行认证。
  23. 根据权利要求22所述的方法,其中,向所述用户终端提供第二认证信息包括:
    生成报告文件,所述报告文件包括所述可信证书生成器自身的代码哈希和签名信息;
    将所述报告文件发送至第三方认证机构,以获得针对所述可信证书生成器的第二认证结果文件,所述第二认证结果文件包含所述第三方认证机构的签名信息;
    将所述第二认证结果文件作为所述第二认证信息提供给所述用户终端。
  24. 根据权利要求22所述的方法,其中,向所述用户终端提供第二认证信息包括:
    生成报告文件,所述报告文件包括所述可信证书生成器自身的代码哈希和签名信息;
    将所述报告文件作为所述第二认证信息提供给所述用户终端。
  25. 根据权利要求22所述的方法,其中,所述第二证书报告还包括,所述第一组标识对应的第一哈希列表,该第一哈希列表包括属于所述第一任务分组的所有计算任务的代码哈希。
  26. 根据权利要求22所述的方法,其中,所述第二证书报告还包括所述第一公钥证书,以使得所述用户终端利用所述第一公钥证书加密用户数据。
  27. 一种通过数字证书进行多方安全计算的方法,通过运行第一计算任务的第一计算单元执行,其中:
    所述第一计算任务预先被配置为属于第一任务分组,所述第一任务分组还包括第二计算单元所运行的第二计算任务;
    所述第一计算单元预先被分发有针对所述第一任务分组生成的第一证书对和第一根证书,所述第一证书对包括第一公钥证书和匹配的第一私钥,所述第一公钥证书和第一根证书构成第一证书链;
    并且,所述第一计算单元被配置作为提供所述第一计算任务的计算服务的第一TLS服务端,该第一TLS服务端以所述第一证书对作为其证书对;所述第一计算单元还被配置作为至少与所述第二计算单元连接的第一TLS客户端,所述第一TLS客户端以所述第一根证书作为其可信根证书;
    所述方法包括:
    利用所述第一TLS服务端与作用为第二TLS客户端的用户终端进行TLS握手,建立第一TLS可信通道;其中所述第二TLS客户端将所述第一根证书作为其可信根证书;
    通过所述第一TLS可信通道接收第一用户数据;
    对所述第一用户数据进行第一处理,得到第一应用数据;
    利用所述第一TLS客户端与作用为第二TLS服务端的第二计算单元进行TLS握手,建立第二TLS可信通道;其中所述第二TLS服务端将所述第一证书对作为其证书对;
    通过所述第二TLS可信通道将所述第一应用数据传送给所述第二计算单元。
  28. 根据权利要求27所述的方法,还包括:
    从数据平台读取第二用户数据,所述第二用户数据由所述用户终端使用所述第一公钥证书加密产生;
    使用所述第一私钥解密所述第二用户数据。
  29. 根据权利要求27所述的方法,还包括:
    生成第二应用数据;
    使用所述第一公钥证书加密所述第二应用数据,得到第二加密应用数据;
    将所述第二加密应用数据存入数据平台,以供所述第二计算单元利用所述第一证书对进行解密获取。
  30. 一种获取证书以进行多方安全计算的装置,部署在运行第一计算任务的第一计算单元中,所述第一计算任务预先被配置为属于第一任务分组,所述第一任务分组还包括至少一个其他计算任务;所述装置包括:
    第一证书请求模块,配置为向可信证书生成器发送第一证书请求,所述第一证书请求包括所述第一任务分组的第一组标识,以及第一认证信息,所述第一认证信息用于对 第一计算单元进行可信认证,并包括所述第一计算任务的第一代码哈希;
    第一报告接收模块,配置为从所述可信证书生成器接收第一证书报告,所述第一证书报告包括针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书以及对应的第一公钥证书,所述第一公钥证书与所述第一私钥相匹配,构成第一证书对;
    第一设置模块,配置为以所述第一计算单元作为提供所述第一计算任务的计算服务的TLS服务端,将所述第一证书对设置为所述TLS服务端的证书对;并且以所述第一计算单元作为与所述至少一个其他计算任务连接的TLS客户端,将所述第一根证书设置为所述TLS客户端的可信根证书。
  31. 一种为计算单元分发证书的装置,部署在可信证书生成器中,所述装置包括:
    第一请求接收模块,配置为从运行第一计算任务的第一计算单元接收第一证书请求,所述第一证书请求包括第一任务分组的第一组标识,以及第一认证信息,所述第一认证信息用于对所述第一计算单元进行认证,且包括所述第一计算任务的第一代码哈希;
    单元认证模块,配置为根据所述第一认证信息对所述第一计算单元进行认证;
    分组判断模块,配置为在认证通过的情况下,根据所述第一代码哈希判断所述第一计算任务是否属于所述第一任务分组;
    证书获取模块,配置为在确认所述第一计算任务属于所述第一任务分组的情况下,获取预先针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书和对应的第一公钥证书,所述第一公钥证书与所述第一私钥相匹配,构成第一证书对;
    第一报告发送模块,配置为向所述第一计算单元发送第一证书报告,所述第一证书报告包括所述第一根证书和所述第一证书对,使得所述第一计算单元以自身为提供计算服务的TLS服务端和与其他计算任务连接的TLS客户端,将所述第一证书对设置为TLS服务端的证书对,将所述第一根证书设置为TLS客户端的可信根证书。
  32. 一种获取证书以进行多方安全计算的装置,部署在用户终端中,所述装置包括:
    第二请求发送模块,配置为向可信证书生成器发送第二证书请求,所述第二证书请求中包括,期望连接的第一任务分组的第一组标识;
    第二报告接收模块,配置为从所述可信证书生成器接收第二证书报告,所述第二证书报告至少包括针对所述第一组标识生成的第一证书链中的第一根证书,所述第一证书链还包括与所述第一根证书对应的第一公钥证书;所述第一公钥证书和匹配的第一私钥构成第一证书对,被预先分发给经过认证的、运行所述第一任务分组中各个计算任务的 至少一个计算单元;
    第二设置模块,配置为以所述用户终端为TLS客户端,将所述第一根证书设置为所述TLS客户端的可信根证书,从而与具有所述第一证书对、且作用为TLS服务端的所述至少一个计算单元通信。
  33. 一种为用户终端分发证书的装置,部署在可信证书生成器中,所述装置包括:
    第二请求接收模块,配置为接收用户终端发送的第二证书请求,所述第二证书请求中包括,所述用户终端期望连接的第一任务分组的第一组标识;
    证书获取模块,配置为获取预先针对所述第一组标识生成的第一证书链和第一私钥,所述第一证书链包括第一根证书和与其对应的第一公钥证书,所述第一公钥证书与所述第一私钥匹配,构成第一证书对;至少所述第一证书对被预先分发给经过认证的、运行所述第一任务分组中各个计算任务的至少一个计算单元;
    第二报告发送模块,配置为向所述用户终端发送第二证书报告,所述第二证书报告至少包括所述第一根证书,以使得所述用户终端以自身为TLS客户端,将所述第一根证书作为TLS客户端的可信根证书,从而与具有所述第一证书对、且作用为TLS服务端的所述至少一个计算单元通信。
  34. 一种通过数字证书进行多方安全计算的装置,部署在运行第一计算任务的第一计算单元中,其中:
    所述第一计算任务预先被配置为属于第一任务分组,所述第一任务分组还包括第二计算单元所运行的第二计算任务;
    所述第一计算单元预先被分发有针对所述第一任务分组生成的第一证书对和第一根证书,所述第一证书对包括第一公钥证书和匹配的第一私钥,所述第一公钥证书和第一根证书构成第一证书链;
    并且,所述第一计算单元被配置作为提供所述第一计算任务的计算服务的第一TLS服务端,该第一TLS服务端以所述第一证书对作为其证书对;所述第一计算单元还被配置作为至少与所述第二计算单元连接的第一TLS客户端,所述第一TLS客户端以所述第一根证书作为其可信根证书;
    所述装置包括:
    第一握手模块,配置为利用所述第一TLS服务端与作用为第二TLS客户端的用户终端进行TLS握手,建立第一TLS可信通道;其中所述第二TLS客户端将所述第一根证书作为其可信根证书;
    数据接收模块,配置为通过所述第一TLS可信通道接收第一用户数据;
    数据处理模块,配置为对所述第一用户数据进行第一处理,得到第一应用数据;
    第二握手模块,配置为利用所述第一TLS客户端与作用为第二TLS服务端的第二计算单元进行TLS握手,建立第二TLS可信通道;其中所述第二TLS服务端将所述第一证书对作为其证书对;
    数据发送模块,配置为通过所述第二TLS可信通道将所述第一应用数据传送给所述第二计算单元。
  35. 一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行权利要求1-29中任一项的所述的方法。
  36. 一种计算设备,包括存储器和处理器,其特征在于,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现权利要求1-29中任一项所述的方法。
PCT/CN2020/072112 2019-08-29 2020-01-15 通过证书签发进行多方安全计算的方法及装置 WO2021036183A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US16/813,524 US11038699B2 (en) 2019-08-29 2020-03-09 Method and apparatus for performing multi-party secure computing based-on issuing certificate
US17/244,854 US11228450B2 (en) 2019-08-29 2021-04-29 Method and apparatus for performing multi-party secure computing based-on issuing certificate

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910808822.5A CN110535628B (zh) 2019-08-29 2019-08-29 通过证书签发进行多方安全计算的方法及装置
CN201910808822.5 2019-08-29

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/813,524 Continuation US11038699B2 (en) 2019-08-29 2020-03-09 Method and apparatus for performing multi-party secure computing based-on issuing certificate

Publications (1)

Publication Number Publication Date
WO2021036183A1 true WO2021036183A1 (zh) 2021-03-04

Family

ID=68665426

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/072112 WO2021036183A1 (zh) 2019-08-29 2020-01-15 通过证书签发进行多方安全计算的方法及装置

Country Status (2)

Country Link
CN (1) CN110535628B (zh)
WO (1) WO2021036183A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20240205026A1 (en) * 2022-12-15 2024-06-20 Cisco Technology, Inc. Systems and methods for securely transferring account information between devices

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11038699B2 (en) 2019-08-29 2021-06-15 Advanced New Technologies Co., Ltd. Method and apparatus for performing multi-party secure computing based-on issuing certificate
CN110535628B (zh) * 2019-08-29 2020-07-17 阿里巴巴集团控股有限公司 通过证书签发进行多方安全计算的方法及装置
US10790979B1 (en) 2019-08-29 2020-09-29 Alibaba Group Holding Limited Providing high availability computing service by issuing a certificate
CN110677240B (zh) * 2019-08-29 2020-07-10 阿里巴巴集团控股有限公司 通过证书签发提供高可用计算服务的方法、装置及介质
WO2020180365A1 (en) * 2019-12-05 2020-09-10 Futurewei Technologies, Inc. System and method of establishing a trusted relationship in a distributed system
CN111291369B (zh) * 2020-01-20 2022-05-20 北京无限光场科技有限公司 一种信息检测方法和电子设备
CN111131336B (zh) * 2020-03-30 2020-07-17 腾讯科技(深圳)有限公司 多方授权场景下的资源访问方法、装置、设备及存储介质
CN111726782B (zh) * 2020-05-22 2023-12-29 浙江吉利汽车研究院有限公司 一种安全认证方法及系统
CN112491847B (zh) * 2020-07-08 2022-02-22 支付宝(杭州)信息技术有限公司 区块链一体机及其自动建链方法、装置
CN111541552B (zh) 2020-07-08 2021-06-22 支付宝(杭州)信息技术有限公司 区块链一体机及其节点自动加入方法、装置
CN111541724B (zh) 2020-07-08 2021-06-29 支付宝(杭州)信息技术有限公司 区块链一体机及其节点自动加入方法、装置
CN113810382B (zh) * 2021-08-24 2023-07-11 东北大学秦皇岛分校 一种用于抵御sgx侧信道攻击的密文加载方法
CN114143034A (zh) * 2021-11-01 2022-03-04 清华大学 一种网络访问安全性检测方法及装置
CN114282237B (zh) * 2021-12-21 2023-01-17 北京百度网讯科技有限公司 一种通信方法、装置、设备及存储介质
CN114168924B (zh) * 2022-02-10 2022-07-12 亿次网联(杭州)科技有限公司 一种基于数字证书的群成员相互认证的方法和系统
CN115277078A (zh) * 2022-06-22 2022-11-01 抖音视界(北京)有限公司 用于处理基因数据的方法、装置、设备和介质
CN117097487B (zh) * 2023-10-19 2024-01-26 翼方健数(北京)信息科技有限公司 一种利用数字证书认证简化可信执行环境远程认证方法、系统和介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060036850A1 (en) * 2003-06-25 2006-02-16 Tomoaki Enokida Digital certificate management system, digital certificate management apparatus, digital certificate management method, update procedure determination method and program
CN108881252A (zh) * 2018-06-28 2018-11-23 腾讯科技(深圳)有限公司 身份认证数据处理方法、装置、计算机设备和存储介质
CN110535628A (zh) * 2019-08-29 2019-12-03 阿里巴巴集团控股有限公司 通过证书签发进行多方安全计算的方法及装置
CN110677240A (zh) * 2019-08-29 2020-01-10 阿里巴巴集团控股有限公司 通过证书签发提供高可用计算服务的方法及装置

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104378374B (zh) * 2014-11-14 2017-11-07 国家超级计算深圳中心(深圳云计算中心) 一种基于安全套接层建立通信的方法及系统
US10135622B2 (en) * 2016-06-03 2018-11-20 Intel Corporation Flexible provisioning of attestation keys in secure enclaves
CN107959656B (zh) * 2016-10-14 2021-08-31 阿里巴巴集团控股有限公司 数据安全保障系统及方法、装置
US20190065406A1 (en) * 2017-11-17 2019-02-28 Intel Corporation Technology For Establishing Trust During A Transport Layer Security Handshake
CN108282466B (zh) * 2017-12-29 2021-02-02 北京握奇智能科技有限公司 用于在tee中提供数字证书功能的方法、系统
CN109873801B (zh) * 2018-12-12 2020-07-24 阿里巴巴集团控股有限公司 在用户和可信计算集群之间建立可信通道的方法、装置、存储介质及计算设备
CN109861980B (zh) * 2018-12-29 2020-08-04 阿里巴巴集团控股有限公司 一种建立可信计算集群的方法、装置、存储介质及计算设备
CN110034925B (zh) * 2019-01-07 2022-03-01 创新先进技术有限公司 跨机房可信计算集群形成及通信方法和装置
CN110011988B (zh) * 2019-03-21 2021-08-10 平安科技(深圳)有限公司 基于区块链的证书验证方法及装置、存储介质、电子装置
CN110120869B (zh) * 2019-03-27 2022-09-30 上海隔镜信息科技有限公司 密钥管理系统及密钥服务节点

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060036850A1 (en) * 2003-06-25 2006-02-16 Tomoaki Enokida Digital certificate management system, digital certificate management apparatus, digital certificate management method, update procedure determination method and program
CN108881252A (zh) * 2018-06-28 2018-11-23 腾讯科技(深圳)有限公司 身份认证数据处理方法、装置、计算机设备和存储介质
CN110535628A (zh) * 2019-08-29 2019-12-03 阿里巴巴集团控股有限公司 通过证书签发进行多方安全计算的方法及装置
CN110677240A (zh) * 2019-08-29 2020-01-10 阿里巴巴集团控股有限公司 通过证书签发提供高可用计算服务的方法及装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20240205026A1 (en) * 2022-12-15 2024-06-20 Cisco Technology, Inc. Systems and methods for securely transferring account information between devices

Also Published As

Publication number Publication date
CN110535628B (zh) 2020-07-17
CN110535628A (zh) 2019-12-03

Similar Documents

Publication Publication Date Title
WO2021036183A1 (zh) 通过证书签发进行多方安全计算的方法及装置
WO2021036186A1 (zh) 通过证书签发提供高可用计算服务的方法及装置
US11206137B2 (en) Providing high availability computing service by issuing a certificate
CN110933108B (zh) 基于区块链网络的数据处理方法、装置、电子设备及存储介质
US10841295B1 (en) Extensions for using a digital certificate with multiple cryptosystems
US11038699B2 (en) Method and apparatus for performing multi-party secure computing based-on issuing certificate
US11563567B2 (en) Secure shared key establishment for peer to peer communications
US10951423B2 (en) System and method for distribution of identity based key material and certificate
JP6896940B2 (ja) 第1のアプリケーションと第2のアプリケーションとの間の対称型相互認証方法
CN110046507B (zh) 形成可信计算集群的方法及装置
US8572387B2 (en) Authentication of a peer in a peer-to-peer network
US8285989B2 (en) Establishing a secured communication session
US20050216736A1 (en) System and method for combining user and platform authentication in negotiated channel security protocols
US8806206B2 (en) Cooperation method and system of hardware secure units, and application device
WO2019110018A1 (zh) 通信网络系统的消息验证方法、通信方法和通信网络系统
Mao et al. BTAA: Blockchain and TEE-Assisted Authentication for IoT Systems
CN117081736A (zh) 密钥分发方法、密钥分发装置、通信方法及通信装置
Liou et al. T-auth: A novel authentication mechanism for the IoT based on smart contracts and PUFs
WO2023116027A1 (zh) 安全多方计算中的跨域身份验证方法及服务器
CN113676330B (zh) 一种基于二级密钥的数字证书申请系统及方法
CN118400126A (zh) 基于智能合约的分布式安全动态访问控制方法
CN115544583A (zh) 一种服务器密码机的数据处理方法及装置
CN117716666A (zh) 用于向用户提供自主身份云服务的方法、云服务方法、云服务器、自主身份方法

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: 20859103

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: 20859103

Country of ref document: EP

Kind code of ref document: A1