CN115495255A - Service interface securely invokes methods, devices, equipment and storage media - Google Patents

Service interface securely invokes methods, devices, equipment and storage media Download PDF

Info

Publication number
CN115495255A
CN115495255A CN202110672759.4A CN202110672759A CN115495255A CN 115495255 A CN115495255 A CN 115495255A CN 202110672759 A CN202110672759 A CN 202110672759A CN 115495255 A CN115495255 A CN 115495255A
Authority
CN
China
Prior art keywords
identity
service
service interface
request
caller
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202110672759.4A
Other languages
Chinese (zh)
Inventor
周新量
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lan Ting
Original Assignee
Kuaizuo Chengdu Technology Co ltd
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 Kuaizuo Chengdu Technology Co ltd filed Critical Kuaizuo Chengdu Technology Co ltd
Priority to CN202110672759.4A priority Critical patent/CN115495255A/en
Publication of CN115495255A publication Critical patent/CN115495255A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention provides a service interface safe calling method, a device, equipment and a storage medium, wherein an encrypted channel is established between a service provider and a service caller, the safe calling of a service interface is carried out in the encrypted channel, and the service interface safe calling method comprises the following steps: receiving a service interface calling request sent by a service calling party; generating an identity authentication request aiming at least one identity attribute in the target digital identity according to the service interface calling request; sending the identity authentication request to the service calling party, and receiving an identity certificate sent by the service calling party according to the identity authentication request; and verifying the identity certificate, and returning a service interface calling result to the service calling party according to a verification result. The invention can ensure the safety of the access of the service interface and effectively avoid the attack of the service interface.

Description

服务接口安全调用方法、装置、设备和存储介质Service interface securely invokes methods, devices, equipment and storage media

技术领域technical field

本发明涉及信息安全领域,尤其涉及一种服务接口安全调用方法、服务接口安全调用装置、电子设备和非暂态计算机可读存储介质。The invention relates to the field of information security, in particular to a method for securely invoking a service interface, a device for securely invoking a service interface, electronic equipment and a non-transitory computer-readable storage medium.

背景技术Background technique

“网络服务”,是指一些在网络上运行的、面向服务的、基于分布式程序的软件模块。网络服务通常是许多应用程序接口(Application Programming Interface,简称API)来提供。常用服务接口,即API的调用方法,为了保证接口访问的安全性,通常是为接口的合法用户配置用户名和密码。然而这种保证接口访问安全性的方式安全性较低,容易使接口受到攻击。"Network service" refers to some service-oriented software modules based on distributed programs that run on the network. Network services are usually provided by many application programming interfaces (Application Programming Interface, API for short). Commonly used service interfaces, that is, API calling methods, in order to ensure the security of interface access, user names and passwords are usually configured for legal users of the interface. However, this way of ensuring the security of interface access is low in security, and the interface is easy to be attacked.

发明内容Contents of the invention

本发明提供一种服务接口安全调用方法、装置、设备和存储介质,用以解决现有技术中服务接口访问的安全性较低,服务接口容易受到攻击的缺陷,实现保证服务接口访问的安全性,有效避免服务接口受到攻击。The present invention provides a method, device, device and storage medium for securely invoking a service interface, which are used to solve the defects in the prior art that the security of the service interface access is low and the service interface is vulnerable to attacks, so as to ensure the security of the service interface access , to effectively prevent the service interface from being attacked.

第一方面,本发明提供一种服务接口安全调用方法,应用于服务提供方,在所述服务提供方与服务调用方之间建立加密信道,对服务接口的安全调用是在所述加密信道中进行,所述服务接口安全调用方法包括:In the first aspect, the present invention provides a method for securely calling a service interface, which is applied to a service provider, and an encrypted channel is established between the service provider and the service caller, and the secure call to the service interface is in the encrypted channel To carry out, the safe call method of the service interface includes:

接收服务调用方发出的服务接口调用请求;Receive the service interface call request sent by the service caller;

根据所述服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求;Generate an identity verification request for at least one identity attribute in the target digital identity according to the service interface invocation request;

向所述服务调用方发送所述身份验证请求,并接收所述服务调用方根据所述身份验证请求发出的身份证明;Send the identity verification request to the service caller, and receive the identity certificate issued by the service caller according to the identity verification request;

对所述身份证明进行验证,并根据验证结果向所述服务调用方返回服务接口调用的结果。The identity certificate is verified, and the result of calling the service interface is returned to the service caller according to the verification result.

根据本发明提供的一种服务接口安全调用方法,根据所述服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求,包括:According to a method for securely invoking a service interface provided by the present invention, an identity verification request for at least one identity attribute in the target digital identity is generated according to the service interface invocation request, including:

根据所述服务接口调用请求确定身份验证的策略;所述身份验证的策略包括:所述目标数字身份中的至少一项身份属性和对所述至少一项身份属性进行身份证明的方式;Determine an identity verification strategy according to the service interface call request; the identity verification strategy includes: at least one identity attribute in the target digital identity and a way to authenticate the at least one identity attribute;

根据所述身份验证的策略生成所述身份验证请求;generating the identity verification request according to the identity verification policy;

对所述身份证明进行验证,包括:Verification of said identification, including:

根据所确定的身份证明的方式对所述身份证明进行验证,得到所述验证结果。The identity certificate is verified according to the determined identity certificate method, and the verification result is obtained.

根据本发明提供的一种服务接口安全调用方法,对所述身份证明进行验证,并根据验证结果向所述服务调用方返回服务接口调用的结果,包括:According to a service interface security calling method provided by the present invention, the identity certificate is verified, and the result of the service interface call is returned to the service caller according to the verification result, including:

判断身份证明是否有效;Determine whether the identity certificate is valid;

若身份证明有效,基于所述目标数字身份的至少一项身份属性,根据服务接口调用请求携带的服务接口信息,调用对应版本的服务接口提供服务,得到服务接口调用的结果;If the identity certificate is valid, based on at least one identity attribute of the target digital identity, according to the service interface information carried in the service interface call request, call the corresponding version of the service interface to provide services, and obtain the result of the service interface call;

向所述服务调用方返回所述服务接口调用的结果;Returning the result of the service interface call to the service caller;

若身份证明无效,向所述服务调用方返回所述服务接口调用失败的信息。If the identity certificate is invalid, return the information that the service interface call fails to the service caller.

根据本发明提供的一种服务接口安全调用方法,根据所述服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求之前,还包括:According to a method for securely invoking a service interface provided by the present invention, before generating an identity verification request for at least one identity attribute in the target digital identity according to the service interface invocation request, the method further includes:

判断身份验证提议中服务接口调用请求携带的服务接口信息是否具有合法性;Judging whether the service interface information carried in the service interface call request in the identity verification proposal is legal;

若服务接口调用请求携带的服务接口信息具有合法性,根据所述服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求;If the service interface information carried in the service interface call request is legal, generate an identity verification request for at least one identity attribute in the target digital identity according to the service interface call request;

若服务接口调用请求携带的服务接口信息不具有合法性,向所述服务调用方返回所述服务接口调用失败的信息。If the service interface information carried in the service interface call request is not legal, return information that the service interface call fails to the service caller.

第二方面,本发明提供一种服务接口安全调用方法,应用于服务调用方,在所述服务调用方与服务提供方之间建立加密信道,对服务接口的安全调用是在所述加密信道中进行,所述服务接口安全调用方法包括:In the second aspect, the present invention provides a method for securely invoking a service interface, which is applied to a service caller, and an encrypted channel is established between the service caller and the service provider, and the secure call to the service interface is in the encrypted channel To carry out, the safe call method of the service interface includes:

向服务提供方发送服务接口调用请求;Send a service interface call request to the service provider;

接收所述服务提供方根据所述服务接口调用请求发出的针对目标数字身份中至少一项身份属性的身份验证请求;receiving an identity verification request for at least one identity attribute in the target digital identity sent by the service provider according to the service interface call request;

根据所述身份验证请求生成身份证明,并向所述服务提供方发送所述身份证明;generating an identity certificate according to the identity verification request, and sending the identity certificate to the service provider;

接收所述服务提供方根据所述身份证明的验证结果返回的服务接口调用的结果。The service interface call result returned by the service provider according to the verification result of the identity certificate is received.

第三方面,本发明还提供一种服务接口安全调用装置,应用于服务提供方,在所述服务提供方与服务调用方之间建立加密信道,对服务接口的安全调用是在所述加密信道中进行,所述服务接口安全调用装置包括:In the third aspect, the present invention also provides a device for securely invoking a service interface, which is applied to a service provider, and an encrypted channel is established between the service provider and the service caller, and the secure invocation of the service interface is performed on the encrypted channel In the process, the device for securely invoking the service interface includes:

第一通信模块,用于接收服务调用方发出的服务接口调用请求;The first communication module is configured to receive a service interface call request sent by a service caller;

第一处理模块,用于根据所述服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求;A first processing module, configured to generate an identity verification request for at least one identity attribute in the target digital identity according to the service interface invocation request;

所述第一通信模块,还用于向所述服务调用方发送所述身份验证请求,并接收所述服务调用方根据所述身份验证请求生成的身份证明;The first communication module is further configured to send the identity verification request to the service caller, and receive an identity certificate generated by the service caller according to the identity verification request;

所述第一处理模块,还用于对所述身份证明进行验证;The first processing module is further configured to verify the identity certificate;

所述第一通信模块,还用于根据验证结果向所述服务调用方返回服务接口调用的结果。The first communication module is further configured to return a service interface call result to the service caller according to the verification result.

第四方面,本发明还提供一种服务接口安全调用装置,应用于服务调用方,在所述服务调用方与服务提供方之间建立加密信道,对服务接口的安全调用是在所述加密信道中进行,所述服务接口安全调用装置包括:In the fourth aspect, the present invention also provides a device for securely invoking a service interface, which is applied to a service caller, and an encrypted channel is established between the service caller and the service provider, and the secure call to the service interface is performed on the encrypted channel In the process, the device for securely invoking the service interface includes:

第二通信模块,用于向服务提供方发送服务接口调用请求;接收所述服务提供方根据所述服务接口调用请求发出的针对目标数字身份中至少一项身份属性的身份验证请求;The second communication module is configured to send a service interface call request to the service provider; receive an identity verification request for at least one identity attribute in the target digital identity sent by the service provider according to the service interface call request;

第二处理模块,用于根据所述身份验证请求生成身份证明;A second processing module, configured to generate an identity certificate according to the identity verification request;

所述第二通信模块,还用于向所述服务提供方发送所述身份证明;接收所述服务提供方根据所述身份证明的验证结果返回的服务接口调用的结果。The second communication module is further configured to send the identity certificate to the service provider; and receive the service interface call result returned by the service provider according to the verification result of the identity certificate.

第五方面,本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述第一方面任一种所述服务接口安全调用方法的步骤,或者实现如上述第二方面任一种所述服务接口安全调用方法的步骤。In the fifth aspect, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and operable on the processor, when the processor executes the program, any of the above-mentioned first aspects can be realized. A step of securely invoking a method of the service interface, or a step of implementing the method of securely invoking the service interface according to any one of the above-mentioned second aspect.

第六方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述第一方面任一种所述服务接口安全调用方法的步骤,或者实现如上述第二方面任一种所述服务接口安全调用方法的步骤。In the sixth aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for safely invoking the service interface described in any one of the above-mentioned first aspects is implemented. or implement the steps of securely invoking the service interface method as described in any one of the second aspect above.

本发明提供的服务接口安全调用方法、装置、设备和存储介质,通过在服务提供方与服务调用方之间建立加密信道,在加密信道中进行对服务接口的安全调用,通过接收服务调用方发出的服务接口调用请求,根据服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求,向服务调用方发送身份验证请求,并接收服务调用方根据身份验证请求发出的身份证明,对身份证明进行验证,并根据验证结果向服务调用方返回服务接口调用的结果;利用服务调用方所持有的数字身份中的至少一项身份属性,通过服务调用方向服务提供方证明自己拥有数字身份的签发方所签发的数字身份,使服务调用方取得服务提供方对于自己的信任,从而访问对应的服务接口,可以保证服务接口访问的安全性,有效避免服务接口受到攻击。The service interface security calling method, device, equipment and storage medium provided by the present invention establish an encrypted channel between the service provider and the service caller, and make a secure call to the service interface in the encrypted channel, and receive the service caller's According to the service interface call request, generate an authentication request for at least one identity attribute in the target digital identity, send the identity verification request to the service caller, and receive the identity certificate issued by the service caller according to the identity verification request , verify the identity certificate, and return the result of the service interface call to the service caller according to the verification result; use at least one identity attribute in the digital identity held by the service caller to prove to the service provider through the service caller that he has The digital identity issued by the issuer of the digital identity enables the service caller to gain the trust of the service provider and access the corresponding service interface, which can ensure the security of the service interface access and effectively prevent the service interface from being attacked.

附图说明Description of drawings

为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the present invention or the technical solutions in the prior art, the accompanying drawings that need to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are the present invention. For some embodiments of the invention, those skilled in the art can also obtain other drawings based on these drawings without creative effort.

图1是本发明提供的一种服务接口安全调用方法的流程示意图;Fig. 1 is a schematic flow diagram of a method for safely invoking a service interface provided by the present invention;

图2是本发明提供的一种数字身份系统的结构示意图;Fig. 2 is a schematic structural diagram of a digital identity system provided by the present invention;

图3是图1中提供的服务接口安全调用方法的一些实施例的流程示意图;Fig. 3 is a schematic flow diagram of some embodiments of the service interface security calling method provided in Fig. 1;

图4是本发明提供的另一种服务接口安全调用方法的流程示意图;Fig. 4 is a schematic flow diagram of another method for securely invoking a service interface provided by the present invention;

图5是本发明提供的服务接口安全调用方法的一种应用场景的流程示意图;Fig. 5 is a schematic flow chart of an application scenario of a method for securely invoking a service interface provided by the present invention;

图6是本发明提供的一种服务接口安全调用装置的结构示意图;Fig. 6 is a schematic structural diagram of a device for safely invoking a service interface provided by the present invention;

图7是本发明提供的另一种服务接口安全调用装置的结构示意图;Fig. 7 is a schematic structural diagram of another device for safely invoking a service interface provided by the present invention;

图8是本发明提供的电子设备的结构示意图。Fig. 8 is a schematic structural diagram of an electronic device provided by the present invention.

具体实施方式detailed description

为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention , but not all examples. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

下面结合图1-图5描述本发明的服务接口安全调用方法。The method for safely invoking a service interface of the present invention will be described below in conjunction with FIGS. 1-5 .

请参阅图1,图1是本发明提供的一种服务接口安全调用方法的流程示意图,图1所示的服务接口安全调用方法,应用于服务提供方,可以由服务接口安全调用装置执行,在服务提供方与服务调用方之间建立加密信道,例如,通过安全套接字协议(Secure SocketsLayer,简称SSL)、传输层安全性协议(Transport Layer Security,简称TLS)或者超文本传输安全协议(Hyper Text Transfer Protocol over SecureSocket Layer,简称HTTPS)等建立加密信道,本发明实施例对实现加密信道的协议类型不作限定,通过加密信道服务调用方和服务提供方可以进行公钥的交换,对服务接口的安全调用是在加密信道中进行,如图1所示,该服务接口安全调用方法至少包括:Please refer to Fig. 1. Fig. 1 is a schematic flow diagram of a method for securely invoking a service interface provided by the present invention. The method for securely invoking a service interface shown in Fig. 1 is applied to a service provider and can be executed by a device for securely invoking a service interface. An encrypted channel is established between the service provider and the service caller, for example, through Secure Sockets Layer (Secure SocketsLayer, SSL for short), Transport Layer Security (Transport Layer Security, TLS for short) or Hypertext Transfer Security Protocol (Hypertext Transfer Security). Text Transfer Protocol over SecureSocket Layer, referred to as HTTPS) etc. to establish an encrypted channel, the embodiment of the present invention does not limit the protocol type for implementing the encrypted channel, the service caller and the service provider can exchange public keys through the encrypted channel, and the service interface The secure call is carried out in an encrypted channel, as shown in Figure 1, the secure call method of the service interface includes at least:

101,接收服务调用方发出的服务接口调用请求。101. Receive a service interface invocation request sent by a service caller.

在本发明实施例中,服务调用方向服务提供方发出的服务接口调用请求可以携带被调用的服务接口信息,例如,服务接口的名称、服务接口的参数名称和数值等,本发明实施例对服务接口调用请求携带的服务接口信息的内容不作限定,服务提供方可以根据接收到的服务接口调用请求携带的服务接口信息,调用对应的服务接口提供服务。可选地,服务调用方可以将服务接口调用请求整合于身份验证提议中,向服务提供方发出整合后的身份验证提议,服务提供方可以接收整合后的身份验证提议,从中获取服务接口调用请求。In the embodiment of the present invention, the service interface call request sent by the service caller to the service provider may carry the called service interface information, for example, the name of the service interface, the parameter name and value of the service interface, etc. The content of the service interface information carried in the interface call request is not limited, and the service provider can call the corresponding service interface to provide services according to the service interface information carried in the received service interface call request. Optionally, the service caller can integrate the service interface call request into the identity verification proposal, send the integrated identity verification proposal to the service provider, and the service provider can receive the integrated identity verification proposal, and obtain the service interface call request from it .

102,根据服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求。102. Generate an identity verification request for at least one identity attribute in the target digital identity according to the service interface call request.

在本发明实施例中,数字身份是一种数字化加密的身份证明,如图2所示,数字身份具有以下特点:In the embodiment of the present invention, the digital identity is a digitally encrypted identity certificate. As shown in Figure 2, the digital identity has the following characteristics:

(1)每个数字身份都具有签发方和持有方,其中,签发方是数字身份的赋予者,是数字身份的来源,持有方是数字身份描述的对象,是数字身份的所有者,数字身份代表的是签发方对持有方的特定的信任;(1) Each digital identity has an issuer and a holder. The issuer is the giver of the digital identity and the source of the digital identity. The holder is the object described by the digital identity and the owner of the digital identity. Digital identity represents the specific trust of the issuer in the holder;

(2)每个数字身份都符合某一数字身份规范,每个数字身份规范都具有唯一的标识,数字身份规范的标识是规范制定方在信任中介对数字身份规范进行注册获得,其所有权属于规范制定方;(2) Each digital identity conforms to a certain digital identity specification, and each digital identity specification has a unique identifier. The identifier of the digital identity specification is obtained by the specification maker registering the digital identity specification with the trust intermediary, and its ownership belongs to the specification formulation party;

(3)每个数字身份规范可以包含多种不同的数据格式,每个数字身份必须符合某一特定的数据格式,因此也必定属于该数据格式所属的数据规范;数字身份的数据格式用来描述数字身份的持有人的相关信息,例如,姓名、安全级别等,对于不同的应用场景可以采用一种或多种不同数据格式的数字身份;每个数据格式都具有唯一的标识,每个数据格式的标识是所属的数据规范的制定方在信任中介对数据格式进行注册获得,每个数字身份的内容必须引用所采用的数据格式的标识;(3) Each digital identity specification can contain a variety of different data formats, and each digital identity must conform to a specific data format, so it must also belong to the data specification to which the data format belongs; the data format of a digital identity is used to describe For the relevant information of the holder of the digital identity, such as name, security level, etc., one or more digital identities in different data formats can be used for different application scenarios; each data format has a unique identifier, and each data The identification of the format is obtained by registering the data format with the trust intermediary by the party that formulates the data specification to which it belongs, and the content of each digital identity must refer to the identification of the data format adopted;

(4)每个数字身份都具有对应的数据源;数据源是由数字身份的签发方和数据格式两方面信息组成的二元组,每个数据源都具有唯一的标识,每个数据源的标识是数字身份的签发方在生成数字身份前在信任中介对数据源进行注册获得,每个数字身份的内容必须引用所采用的数据源的标识;(4) Each digital identity has a corresponding data source; the data source is a binary group composed of the issuer of the digital identity and the data format. Each data source has a unique identifier. The identity is obtained by the issuer of the digital identity by registering the data source in the trust intermediary before generating the digital identity, and the content of each digital identity must refer to the identity of the data source used;

(5)信任中介可以是专门提供信任服务的组织,也可以是区块链这种的公共基础设施;(5) The trust intermediary can be an organization that specializes in providing trust services, or it can be a public infrastructure such as blockchain;

(6)签发方在签发数字身份后,可以通过各种通信方式将所签发的数字身份发送给持有方,持有方对从签发方获得的数字身份进行存储;(6) After issuing the digital identity, the issuer can send the issued digital identity to the holder through various communication methods, and the holder stores the digital identity obtained from the issuer;

(7)数字身份的持有方可以同时持有来自多个数据源的多个数字身份,每个数字身份可以服务于不同的目的;(7) The holder of a digital identity can hold multiple digital identities from multiple data sources at the same time, and each digital identity can serve different purposes;

(8)数字身份用于持有方向验证方证明自己拥有签发方赋予的特定的信任,验证方可以基于对签发方的信任来选择信任数字身份的持有方;(8) The digital identity is used by the holder to prove to the verifier that he has the specific trust granted by the issuer, and the verifier can choose to trust the holder of the digital identity based on the trust in the issuer;

(9)数字身份的验证方和签发方可以是同一方。(9) The verifier and issuer of the digital identity can be the same party.

在本发明实施例中,服务调用方是数字身份的持有方,服务调用方可以在调用服务接口之前,获取了访问服务接口所需的所有数字身份。服务提供方是数字身份的验证方,也可以是数字身份的签发方,或者数字身份的签发方可以是除服务提供方和服务调用方以外的第三方,服务提供方对数字身份的签发方签发的数字身份存在执行服务接口调用所需的信任。In the embodiment of the present invention, the service caller is the holder of the digital identity, and the service caller may obtain all the digital identities required for accessing the service interface before calling the service interface. The service provider is the verifier of the digital identity, and it can also be the issuer of the digital identity, or the issuer of the digital identity can be a third party other than the service provider and the service caller. The digital identity exists to perform the trust required to perform service interface calls.

在本发明实施例中,服务提供方在接收到服务调用方发出的服务接口调用请求后,可以根据服务接口调用请求获得服务接口调用的上下文信息,例如,服务接口的名称、服务调用方的姓名、服务接口调用的时间等,根据服务接口调用的上下文信息,生成针对服务调用方的目标数字身份中至少一项身份属性的身份验证请求。可选地,目标数字身份可以包括以下中的一种:符合特定数字身份规范的数字身份、符合特定数据格式的数字身份、来自特定签发方的数字身份和来自特定数据源的数字身份;目标数字身份中的至少一项身份属性可以根据目标数字身份的内容确定,例如,姓名、地址等身份属性;本发明实施例对目标数字身份的类型和目标数字身份中至少一项身份属性的类型不作限定。In the embodiment of the present invention, after receiving the service interface call request from the service caller, the service provider can obtain the context information of the service interface call according to the service interface call request, for example, the name of the service interface, the name of the service caller , the time of invoking the service interface, etc., according to the context information of the invocation of the service interface, an identity verification request for at least one identity attribute in the target digital identity of the service caller is generated. Optionally, the target digital identity may include one of the following: a digital identity conforming to a specific digital identity specification, a digital identity conforming to a specific data format, a digital identity from a specific issuer, and a digital identity from a specific data source; the target digital identity At least one identity attribute in the identity can be determined according to the content of the target digital identity, for example, identity attributes such as name and address; the embodiment of the present invention does not limit the type of the target digital identity and the type of at least one identity attribute in the target digital identity .

可选地,所生成的生成身份验证请求,可以是针对服务调用方一个目标数字身份中一项身份属性的身份验证请求;或者,也可以是针对服务调用方一个目标数字身份中多项身份属性的身份验证请求;或者,还可以是针对服务调用方多个目标数字身份中多项身份属性的身份验证请求;本发明实施例对此不作限定。Optionally, the generated authentication request may be an authentication request for an identity attribute in a target digital identity of the service caller; or, it may be an authentication request for multiple identity attributes in a target digital identity of the service caller or an identity verification request for multiple identity attributes in multiple target digital identities of the service caller; this is not limited in this embodiment of the present invention.

在本发明实施例中,服务提供方在每一次服务接口被调用时,可根据服务接口调用的上下文信息中不同的服务接口、不同的服务调用方、不同的服务接口调用时间等,生成针对服务调用方不同目标数字身份中至少一项身份属性的身份验证请求;或者,也可以生成针对服务调用方同一目标数字身份中不同类型和/或数量的身份属性的身份验证请求;本发明实施例对此不作限定。In the embodiment of the present invention, each time the service interface is called, the service provider can generate a service-specific An identity verification request for at least one identity attribute in different target digital identities of the caller; or, an identity verification request for different types and/or quantities of identity attributes in the same target digital identity of the service caller can also be generated; This is not limited.

103,向服务调用方发送身份验证请求,并接收服务调用方根据身份验证请求发出的身份证明。103. Send an identity verification request to the service caller, and receive the identity certificate issued by the service caller according to the identity verification request.

在本发明实施例中,服务提供方生成针对服务调用方目标数字身份中至少一项身份属性的身份验证请求后,可以向服务调用方发送所生成的身份验证请求,服务调用方在接收到服务提供方根据服务接口调用请求发出的针对目标数字身份中至少一项身份属性的身份验证请求后,可以根据身份验证请求,在本地数据库中所存储的数字身份查询目标数字身份,在查询到目标数字身份后,获取目标数字身份中对应的至少一项身份属性,并对所获取的至少一项身份属性根据身份验证请求生成身份证明,在生成身份证明后,服务调用方会向服务提供方发送所生成的身份证明,服务提供方会接收服务调用方根据身份验证请求发出的身份证明。In the embodiment of the present invention, after the service provider generates an identity verification request for at least one identity attribute in the target digital identity of the service caller, it can send the generated identity verification request to the service caller, and the service caller receives the service After the provider sends an authentication request for at least one identity attribute in the target digital identity according to the service interface call request, it can query the target digital identity from the digital identity stored in the local database according to the authentication request. After identity, obtain at least one identity attribute corresponding to the target digital identity, and generate an identity certificate for at least one identity attribute obtained according to the identity verification request. After generating the identity certificate, the service caller will send the service provider the The generated identity certificate, the service provider will receive the identity certificate sent by the service caller according to the authentication request.

若服务调用方根据针对目标数字身份中至少一项身份属性的身份验证请求,在本地数据库中查询到符合身份验证请求的多个目标数字身份,服务调用方可以根据预先制定的规则,自动选取生成身份证明的一个或多个目标数字身份,来生成身份证明;或者也可以通过交互方式由人工干预,选择生成身份证明的一个或多个目标数字身份,来生成身份证明;本发明实施例对此不做限定。If the service caller finds multiple target digital identities that meet the authentication request in the local database according to the authentication request for at least one identity attribute in the target digital identity, the service caller can automatically select and generate according to the pre-established rules One or more target digital identities of identity certificates are used to generate identity certificates; or one or more target digital identities for generating identity certificates can be selected to generate identity certificates through manual intervention in an interactive manner; the embodiments of the present invention address No limit.

例如,所获取的至少一项身份属性,可以是目标数字身份的签发方私钥加密的身份属性,服务调用方可以根据身份验证请求,通过服务调用方的私钥对所获取的签发方私钥加密的身份属性进行加密,从而得到的身份证明,该身份证明是同时被服务调用方的私钥和目标数字身份的签发方的私钥加密的身份属性。For example, the obtained at least one identity attribute may be the identity attribute encrypted by the issuer's private key of the target digital identity, and the service caller can use the private key of the service caller to pair the obtained issuer's private key The encrypted identity attribute is encrypted to obtain an identity certificate, which is an identity attribute encrypted by both the private key of the service caller and the private key of the issuer of the target digital identity.

104,对身份证明进行验证,并根据验证结果向服务调用方返回服务接口调用的结果。104. Verify the identity certificate, and return the service interface call result to the service caller according to the verification result.

在本发明实施例中,服务提供方在接收到服务调用方根据身份验证请求生成的身份证明后,可以对所接收到的身份证明进行验证,例如,当身份证明可以是同时被服务调用方的私钥和目标数字身份的签发方的私钥加密后的身份属性时,可以根据服务调用方的公钥和数字身份的签发方的公钥对加密后的身份属性进行解密,得到对应的身份属性,从而实现对身份证明的验证。服务提供方在得到身份证明的验证结果后,可以根据身份证明的验证结果,确定是否调用对应的服务接口为服务调用方提供服务,若调用对应的服务接口为服务调用方提供服务,则向服务调用方返回服务接口调用的结果。In the embodiment of the present invention, after receiving the identity certificate generated by the service caller according to the identity verification request, the service provider can verify the received identity certificate. For example, when the identity certificate can be When the private key and the private key of the issuer of the target digital identity encrypt the identity attribute, the encrypted identity attribute can be decrypted according to the public key of the service caller and the public key of the issuer of the digital identity to obtain the corresponding identity attribute , so as to realize the verification of the identity certificate. After obtaining the verification result of the identity certificate, the service provider can determine whether to call the corresponding service interface to provide services for the service caller according to the verification result of the identity certificate. The caller returns the result of the service interface call.

本发明提供的服务接口安全调用方法,通过在服务提供方与服务调用方之间建立加密信道,在加密信道中进行对服务接口的安全调用,通过接收服务调用方发出的服务接口调用请求,根据服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求,向服务调用方发送身份验证请求,并接收服务调用方根据身份验证请求发出的身份证明,对身份证明进行验证,并根据验证结果向服务调用方返回服务接口调用的结果;利用服务调用方所持有的数字身份中的至少一项身份属性,通过服务调用方向服务提供方证明自己拥有数字身份的签发方所签发的数字身份,使服务调用方取得服务提供方对于自己的信任,从而访问对应的服务接口,可以保证服务接口访问的安全性,有效避免服务接口受到攻击。The method for securely invoking a service interface provided by the present invention establishes an encrypted channel between the service provider and the service caller, performs a secure call to the service interface in the encrypted channel, and receives the service interface call request sent by the service caller, according to Service interface call request, generate an identity verification request for at least one identity attribute in the target digital identity, send the identity verification request to the service caller, and receive the identity certificate issued by the service caller according to the identity verification request, and verify the identity certificate, And return the result of the service interface call to the service caller according to the verification result; using at least one identity attribute in the digital identity held by the service caller, through the service caller to prove to the service provider that he has a digital identity issued by the issuer The digital identity of the service caller can obtain the trust of the service provider and access the corresponding service interface, which can ensure the security of the service interface access and effectively prevent the service interface from being attacked.

请参阅图3,图3是图1中提供的服务接口安全调用方法的一些实施例的流程示意图,如图3所示,该服务接口安全调用方法至少包括:Please refer to FIG. 3. FIG. 3 is a schematic flow diagram of some embodiments of the service interface security invocation method provided in FIG. 1. As shown in FIG. 3, the service interface security invocation method at least includes:

301,接收服务调用方发出的身份验证提议。301. Receive an identity verification proposal sent by a service caller.

在本发明实施例中,服务调用方向服务提供方发出的是整合有服务接口调用请求的身份验证提议,服务提供方接收的是整合有服务接口调用请求的身份验证提议,在整合有服务接口调用请求的身份验证提议中除了包含服务接口调用请求外,还可以包含服务调用方自愿公开的身份属性,例如,服务调用方的姓名等身份属性,本发明实施例对服务调用方在身份验证提议中自愿公开的身份属性的类型不作限定,根据身份验证提议中包含的身份属性,可以确定生成身份验证请求的身份属性,也就是说,在生成身份验证请求时,可以选取身份验证提议中未公开的身份属性来生成身份验证请求。In the embodiment of the present invention, the service caller sends the identity verification proposal integrated with the service interface call request to the service provider, and the service provider receives the identity verification proposal integrated with the service interface call request. In addition to the service interface call request, the identity verification proposal of the request may also include the identity attributes that the service caller voluntarily discloses, for example, the name and other identity attributes of the service caller. The types of identity attributes that are voluntarily disclosed are not limited. According to the identity attributes contained in the identity verification proposal, the identity attributes that generate the identity verification request can be determined, that is, when generating the identity verification request, you can select Identity attributes to generate authentication requests.

302,判断身份验证提议中服务接口调用请求携带的服务接口信息是否具有合法性。302. Determine whether the service interface information carried in the service interface call request in the identity verification proposal is legal.

若服务接口调用请求携带的服务接口信息具有合法性,执行303;若服务接口调用请求携带的服务接口信息不具有合法性,执行308。If the service interface information carried in the service interface call request is legal, go to 303 ; if the service interface information carried in the service interface call request is not legal, go to 308 .

在本发明实施例中,服务提供方接收到整合有服务接口调用请求的身份验证提议后,可以解析出服务接口调用请求携带的服务接口信息,例如,服务接口的名称、服务接口的参数名称和数值等,并对解析出的服务接口信息进行合法性检查,判断身份验证提议中服务接口调用请求携带的服务接口信息是否具有合法性,例如,检查服务接口是否存在、服务接口的参数是否符合合法值域区间等,并得到检查结果。In the embodiment of the present invention, after the service provider receives the identity verification proposal integrated with the service interface call request, it can parse out the service interface information carried in the service interface call request, for example, the name of the service interface, the parameter name of the service interface, and value, etc., and check the legality of the parsed service interface information to determine whether the service interface information carried in the service interface call request in the identity verification proposal is legal, for example, check whether the service interface exists and whether the parameters of the service interface are legal range, etc., and get the check result.

303,根据身份验证提议,生成针对目标数字身份中至少一项身份属性的身份验证请求。303. Generate an identity verification request for at least one identity attribute in the target digital identity according to the identity verification proposal.

在本发明实施例中,服务提供方对服务接口信息进行合法性检查,得到的检查结果可以包括检查成功和检查失败。若服务接口调用请求携带的服务接口信息具有合法性,则合法性的检查结果为检查成功,表明服务接口信息满足基本的合法性要求,例如,服务接口存在、服务接口的参数符合合法值域区间等,则根据身份验证提议,生成针对目标数字身份中至少一项身份属性的身份验证请求。若若服务接口调用请求携带的服务接口信息不具有合法性,则合法性的检查结果为检查失败,表明服务接口信息不满足基本的合法性要求,例如,服务接口不存在和/或服务接口的参数不符合合法值域区间等,则向服务调用方返回服务接口调用失败的信息。可选地,服务接口调用失败的信息可以包含服务接口调用失败的的原因,例如,接口不存在和/或参数错误等。In the embodiment of the present invention, the service provider checks the validity of the service interface information, and the obtained check results may include check success and check failure. If the service interface information carried in the service interface call request is legal, the result of the legality check is that the check is successful, indicating that the service interface information meets the basic legality requirements, for example, the service interface exists, and the parameters of the service interface conform to the legal value range interval etc., generate an authentication request for at least one identity attribute in the target digital identity according to the identity authentication proposal. If the service interface information carried in the service interface call request is not legal, the legality check result is a check failure, indicating that the service interface information does not meet the basic legal requirements, for example, the service interface does not exist and/or the service interface If the parameter does not conform to the legal value range interval, etc., the service interface call failure information will be returned to the service caller. Optionally, the information about the failure to call the service interface may include a reason for the failure to call the service interface, for example, the interface does not exist and/or the parameters are wrong.

在一些可选的例子中,在根据身份验证提议,生成针对目标数字身份中至少一项身份属性的身份验证请求时,可以根据服务接口调用请求确定身份验证的策略,其中,身份验证的策略可以包括:目标数字身份中的至少一项身份属性和对至少一项身份属性进行身份证明的方式,对至少一项身份属性进行身份证明的方式可以包括直接身份信息证明,也可以称为数据验证,和零知识证明中的至少一种,然后根据身份验证的策略生成身份验证请求。In some optional examples, when an authentication request for at least one identity attribute in the target digital identity is generated according to the authentication proposal, the identity authentication strategy may be determined according to the service interface call request, wherein the identity authentication strategy may be Including: at least one identity attribute in the target digital identity and the method of identifying at least one identity attribute. The method of identifying at least one identity attribute may include direct identification of identity information, which may also be called data verification, and zero-knowledge proof, and then generate an authentication request according to the authentication policy.

在本发明实施例中,服务提供方在每一次服务接口被调用时,可根据不同的服务接口、不同的服务调用方、不同的服务接口调用时间等,确定不同的身份验证的策略,不同的身份验证的策略中所包含的目标数字身份、目标数字身份的身份属性的类型和/或数量、身份证明的方式中的至少一项可以不同,本发明实施例对此不作限定。In the embodiment of the present invention, the service provider can determine different authentication strategies according to different service interfaces, different service callers, different service interface call times, etc. each time the service interface is called. At least one of the target digital identity included in the identity verification policy, the type and/or quantity of the identity attributes of the target digital identity, and the manner of identity verification may be different, which is not limited in the embodiment of the present invention.

可选地,身份验证的策略中目标数字身份的至少一项身份属性可以是选自服务调用方持有的以下一种数字身份:符合特定数字身份规范的数字身份,该数字身份不限定具体的数据格式和签发方;符合特定数据格式的数字身份,该数字身份的数字身份规范和数据格式固定,不限定数据源,即签发方;来自特定签发方的数字身份,该数字身份的签发方固定,不限定数字身份规范和数据格式;来自特定数据源的数字身份,该数字身份的签发方、数字身份数据规范和数据格式均固定。Optionally, at least one identity attribute of the target digital identity in the authentication policy may be selected from the following digital identities held by the service caller: digital identities conforming to specific digital identity specifications, and the digital identities are not limited to specific Data format and issuer; digital identity conforming to a specific data format, the digital identity specification and data format of the digital identity are fixed, and the data source is not limited, that is, the issuer; digital identity from a specific issuer, the issuer of the digital identity is fixed , does not limit the digital identity specification and data format; digital identity from a specific data source, the issuer of the digital identity, digital identity data specification and data format are fixed.

304,向服务调用方发送身份验证请求,并接收服务调用方根据身份验证请求发出的身份证明。304. Send an identity verification request to the service caller, and receive the identity certificate sent by the service caller according to the identity verification request.

在一些可选的例子中,当身份验证请求是身份验证的策略生成时,服务调用方在接收到服务提供方发出的身份验证请求后,可以根据身份验证请求,在本地数据库中查询目标数字身份,并获取目标数字身份中的至少一项身份属性,对至少一项身份属性根据身份验证请求中规定的身份证明的方式,生成身份证明。可选地,若服务调用方在查询或者生成身份证明的过程出现问题,服务调用方会向服务提供方返回错误信息。可选地,服务提供方可以针对身份验证请求设置应答时限,若服务调用方生成身份证明的过程超过应答时限,服务提供方判定身份验证失败。In some optional examples, when the authentication request is generated by the authentication policy, the service caller can query the target digital identity in the local database according to the authentication request after receiving the authentication request from the service provider , and obtain at least one identity attribute in the target digital identity, and generate an identity certificate for at least one identity attribute according to the identity certificate method specified in the identity verification request. Optionally, if the service caller encounters a problem in the process of querying or generating the identity certificate, the service caller will return an error message to the service provider. Optionally, the service provider can set a response time limit for the identity verification request. If the process of generating the identity certificate by the service caller exceeds the response time limit, the service provider determines that the identity verification fails.

305,判断身份证明是否有效。305. Determine whether the identity certificate is valid.

若身份证明有效,执行306;若身份证明无效,执行308。If the identity certificate is valid, execute 306; if the identity certificate is invalid, execute 308.

在一些可选的例子中,当身份验证请求是身份验证的策略生成时,服务提供方在接收到服务调用方发出的身份证明后,可以根据身份验证的策略所确定的身份证明的方式,对身份证明进行验证,判断身份证明是否有效。例如,当身份证明的方式为数据验证时,服务调用方返回的证明自己持有满足服务提供方要求的数字身份的身份证明,可以是根据对应的至少一项身份属性得到的数值,该数值可以是通过服务调用方的私钥和目标数字身份的签发方的私钥对身份属性进行加密后得到。服务提供方可以通过服务调用方的公钥和数字身份的签发方的公钥对加密后的身份属性进行解密,实现对身份证明的验证。例如,当身份证明的方式为零知识证明时,服务调用方方返回的证明自己持有满足服务提供方要求的数字身份的身份证明,可以是根据服务提供方所构造的零知识证明请求,针对至少一项身份属性对应的数值与预设的值域的关系,例如大于或者小于,其中,至少一项身份属性对应的数值可以是通过服务调用方的私钥和目标数字身份的签发方的私钥对身份属性进行加密后得到。服务提供方可以通过服务调用方返回的至少一项身份属性对应的数值与预设的值域的关系,实现对身份证明的验证,从而可以使服务调用方在不泄露具体身份信息的情况下,获得服务提供方的信任,兼顾了服务调用方的隐私和服务接口的安全。In some optional examples, when the identity verification request is generated by the identity verification policy, after receiving the identity certificate sent by the service caller, the service provider can, according to the identity verification method determined by the identity verification policy, The identity certificate is verified to determine whether the identity certificate is valid. For example, when the identity verification method is data verification, the identity certificate returned by the service caller to prove that he holds a digital identity that meets the requirements of the service provider can be a value obtained according to at least one corresponding identity attribute, and the value can be It is obtained by encrypting the identity attribute with the private key of the service caller and the private key of the issuer of the target digital identity. The service provider can decrypt the encrypted identity attributes through the service caller's public key and the digital identity issuer's public key to verify the identity certificate. For example, when the identity proof method is zero-knowledge proof, the identity proof that the service caller returns to prove that he holds a digital identity that meets the requirements of the service provider can be based on the zero-knowledge proof request constructed by the service provider, for The relationship between the value corresponding to at least one identity attribute and the preset value range, such as greater than or less than, where the value corresponding to at least one identity attribute can be obtained through the private key of the service caller and the private key of the issuer of the target digital identity. The key is obtained after encrypting the identity attribute. The service provider can verify the identity certificate through the relationship between the value corresponding to at least one identity attribute returned by the service caller and the preset value range, so that the service caller can, without disclosing specific identity information, Obtain the trust of the service provider, taking into account the privacy of the service caller and the security of the service interface.

306,基于所述目标数字身份,根据服务接口调用请求携带的服务接口信息,调用对应版本的服务接口提供服务,得到服务接口调用的结果。306. Based on the target digital identity, according to the service interface information carried in the service interface call request, call the corresponding version of the service interface to provide the service, and obtain the result of the service interface call.

在本发明实施例中,服务提供方在根据服务接口调用请求携带的服务接口信息,调用服务接口提供服务时,可以基于生成身份验证请求的目标数字身份的身份属性的不同,调用不同版本的服务接口提供服务。In the embodiment of the present invention, when the service provider calls the service interface to provide services according to the service interface information carried in the service interface call request, it can call different versions of the service based on the identity attributes of the target digital identity that generates the identity verification request. interface provides services.

307,向服务调用方返回服务接口调用的结果。307. Return the result of calling the service interface to the service caller.

在本发明实施例中,服务提供方对身份证明进行验证,得到的验证结果可以包括验证成功和验证失败。若身份证明有效,则身份证明的验证结果为验证成功,表明服务调用方持有符合服务提供方要求的数字身份,服务提供方对服务提供方存在执行服务接口调用所需的信任,允许根据服务接口调用请求携带的服务接口信息,调用对应的服务接口提供服务,并向服务调用方返回服务接口调用的结果。可选地,服务提供方可以将服务接口调用的结果附加在身份验证确认消息中,与身份验证确认消息同时返回给服务调用方。In the embodiment of the present invention, the service provider verifies the identity certificate, and the obtained verification results may include verification success and verification failure. If the identity certificate is valid, the verification result of the identity certificate is successful, indicating that the service caller holds a digital identity that meets the requirements of the service provider, and the service provider has the trust required for the service provider to perform service interface calls, allowing The service interface information carried in the interface call request calls the corresponding service interface to provide services, and returns the result of the service interface call to the service caller. Optionally, the service provider may attach the result of the service interface call to the identity verification confirmation message, and return it to the service caller at the same time as the identity verification confirmation message.

308,向服务调用方返回服务接口调用失败的信息。308. Return information that the service interface call fails to the service caller.

若身份证明是无效,则身份证明的验证结果为验证失败,表明服务调用方不持有符合服务提供方要求的数字身份,服务提供方对服务提供方不存在执行服务接口调用所需的信任,不允许根据服务接口调用请求携带的服务接口信息,调用对应的服务接口提供服务,并向服务调用方返回服务接口调用失败的信息。可选地,服务接口调用失败的信息可以包含服务接口调用失败的的原因,例如,身份验证失败等。If the identity certificate is invalid, the verification result of the identity certificate is a verification failure, indicating that the service caller does not hold a digital identity that meets the requirements of the service provider, and the service provider does not have the trust required for the service provider to perform service interface calls. It is not allowed to call the corresponding service interface to provide services according to the service interface information carried in the service interface call request, and return the failure information of the service interface call to the service caller. Optionally, the information about the service interface invocation failure may include the cause of the service interface invocation failure, for example, authentication failure and the like.

请参阅图4,图4是本发明提供的另一种服务接口安全调用方法的流程示意图,图4所示的服务接口安全调用方法,应用于服务调用方,可以由服务接口安全调用装置执行,在服务调用方与服务提供方之间建立加密信道,例如,通过SSL、TLS或者HTTPS等协议建立加密信道,本发明实施例对实现加密信道的协议类型不作限定,通过加密信道服务调用方和服务提供方可以进行公钥的交换,对服务接口的安全调用是在加密信道中进行,如图4所示,该服务接口安全调用方法至少包括:Please refer to FIG. 4. FIG. 4 is a schematic flow diagram of another service interface security invocation method provided by the present invention. The service interface security invocation method shown in FIG. 4 is applied to a service caller and can be executed by a service interface security invocation device. Establish an encrypted channel between the service caller and the service provider, for example, establish an encrypted channel through protocols such as SSL, TLS, or HTTPS. The embodiment of the present invention does not limit the protocol type for implementing the encrypted channel. The provider can exchange public keys, and the secure call to the service interface is carried out in an encrypted channel, as shown in Figure 4, the secure call method of the service interface includes at least:

401,向服务提供方发送服务接口调用请求。401. Send a service interface invocation request to the service provider.

402,接收服务提供方根据服务接口调用请求发出的针对目标数字身份中至少一项身份属性的身份验证请求。402. Receive an identity verification request for at least one identity attribute in the target digital identity sent by the service provider according to the service interface call request.

403,根据身份验证请求生成身份证明,并向服务提供方发送身份证明。403. Generate an identity certificate according to the identity verification request, and send the identity certificate to the service provider.

404,接收服务提供方根据身份证明的验证结果返回的服务接口调用的结果。404. Receive the service interface call result returned by the service provider according to the verification result of the identity certificate.

在本发明实施例中,关于401、402、403、404的说明可以参见图1中关于101、102、103、104的说明,故此处不再复述。In the embodiment of the present invention, for descriptions of 401 , 402 , 403 , and 404 , refer to descriptions of 101 , 102 , 103 , and 104 in FIG. 1 , so details are not repeated here.

请参阅图5,图5是本发明提供的服务接口安全调用方法的一种应用场景的流程示意图,如图5所示,该服务接口安全调用方法的具体过程如下:Please refer to FIG. 5. FIG. 5 is a schematic flow diagram of an application scenario of the service interface safe calling method provided by the present invention. As shown in FIG. 5, the specific process of the service interface safe calling method is as follows:

服务调用方向服务提供方发送身份验证提议,身份验证提议的内容包括服务接口的名称,服务接口的参数名称和数值,以及服务调用方自愿公开的身份属性。The service caller sends an authentication proposal to the service provider. The content of the authentication proposal includes the name of the service interface, the parameter names and values of the service interface, and the identity attributes voluntarily disclosed by the service caller.

服务提供方在收到身份验证提议后,解析其中服务接口调用请求包含的服务接口的名称、服务接口的参数名称和数值等,进行合法性检查。如果合法性检查失败,向服务调用方返回服务接口调用失败的信息。After receiving the identity verification proposal, the service provider analyzes the name of the service interface contained in the service interface call request, the parameter name and value of the service interface, etc., and performs a legality check. If the legality check fails, return the service interface call failure information to the service caller.

如果合法性检查通过,服务提供方向服务调用方返回身份验证请求。身份验证请求可以基于目标数字身份一个或多个身份属性,进行数据验证或者零知识证明生成。If the legality check is passed, the service provider returns an authentication request to the service caller. The identity verification request can be based on one or more identity attributes of the target digital identity for data verification or zero-knowledge proof generation.

服务调用方在收到身份验证请求后,从本地数据存储的数字身份中查询目标数字身份,并根据身份验证请求生成身份证明,并将所生成的身份验证请求返回给服务提供方。After receiving the identity verification request, the service caller queries the target digital identity from the digital identity stored in the local data, generates an identity certificate according to the identity verification request, and returns the generated identity verification request to the service provider.

服务提供方在收到身份证明后,对身份证明进行验证,确认身份证明有效后,执行对应的服务接口的功能。After receiving the identity certificate, the service provider verifies the identity certificate, and after confirming that the identity certificate is valid, executes the function of the corresponding service interface.

服务提供方在服务接口的功能执行完毕后,将执行结果附加在验证确认的消息内,返回给服务调用方。After the service provider finishes executing the function of the service interface, it attaches the execution result to the verification confirmation message and returns it to the service caller.

下面对本发明提供的界址点定位装置进行描述,下文描述的界址点定位装置与上文描述的界址点定位方法可相互对应参照。The boundary point locating device provided by the present invention is described below, and the boundary point locating device described below and the boundary point locating method described above may refer to each other correspondingly.

请参阅图6,图6是本发明提供的一种服务接口安全调用装置的结构示意图,图6所示的服务接口安全调用装置应用于服务提供方,可用来执行图1的服务接口安全调用方法,在服务提供方与服务调用方之间建立加密信道,例如,通过SSL、TLS或者HTTPS等协议建立加密信道,本发明实施例对实现加密信道的协议类型不作限定,通过加密信道服务调用方和服务提供方可以进行公钥的交换,对服务接口的安全调用是在加密信道中进行,如图6所示,该服务接口安全调用装置至少包括:Please refer to Fig. 6. Fig. 6 is a schematic structural diagram of a service interface secure calling device provided by the present invention. The service interface safe calling device shown in Fig. 6 is applied to a service provider and can be used to execute the service interface safe calling method in Fig. 1 , establish an encrypted channel between the service provider and the service caller, for example, establish an encrypted channel through protocols such as SSL, TLS or HTTPS, the embodiment of the present invention does not limit the protocol type for implementing the encrypted channel, and the service caller and The service provider can exchange public keys, and the secure call to the service interface is carried out in an encrypted channel, as shown in Figure 6, the device for secure call of the service interface includes at least:

第一通信模块610,用于接收服务调用方发出的服务接口调用请求。The first communication module 610 is configured to receive a service interface call request sent by a service caller.

第一处理模块620,用于根据服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求。The first processing module 620 is configured to generate an identity verification request for at least one identity attribute in the target digital identity according to the service interface call request.

第一通信模块610,还用于向服务调用方发送身份验证请求,并接收服务调用方根据身份验证请求生成的身份证明。The first communication module 610 is further configured to send an identity verification request to the service caller, and receive an identity certificate generated by the service caller according to the identity verification request.

第一处理模块620,还用于对身份证明进行验证。The first processing module 620 is also configured to verify the identity certificate.

第一通信模块610,还用于根据验证结果向服务调用方返回服务接口调用的结果。The first communication module 610 is further configured to return the result of calling the service interface to the service caller according to the verification result.

可选地,第一处理模块620,用于根据服务接口调用请求确定身份验证的策略;身份验证的策略包括:目标数字身份中的至少一项身份属性和对至少一项身份属性进行身份证明的方式;根据身份验证的策略生成身份验证请求;根据所确定的身份证明的方式对身份证明进行验证,得到验证结果。Optionally, the first processing module 620 is configured to determine an identity verification strategy according to the service interface call request; the identity verification strategy includes: at least one identity attribute in the target digital identity and an identity certificate for at least one identity attribute method; generate an identity verification request according to the identity verification strategy; verify the identity certificate according to the determined identity certificate method, and obtain the verification result.

可选地,第一处理模块620,用于判断身份证明是否有效;若身份证明有效,基于所述至少一项身份属性,根据服务接口调用请求携带的服务接口信息,调用对应版本的服务接口提供服务,得到服务接口调用的结果。Optionally, the first processing module 620 is configured to determine whether the identity certificate is valid; if the identity certificate is valid, based on the at least one identity attribute, according to the service interface information carried in the service interface call request, call the service interface of the corresponding version to provide Service, get the result of calling the service interface.

第一通信模块610,用于向服务调用方返回服务接口调用的结果;若身份证明无效,向服务调用方返回服务接口调用失败的信息。The first communication module 610 is configured to return the result of the service interface call to the service caller; if the identity certificate is invalid, return the service interface call failure information to the service caller.

可选地,第一处理模块620,还用于判断身份验证提议中服务接口调用请求携带的服务接口信息是否具有合法性;若服务接口调用请求携带的服务接口信息具有合法性,根据服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求;Optionally, the first processing module 620 is also used to judge whether the service interface information carried in the service interface call request in the identity verification proposal is legal; if the service interface information carried in the service interface call request is legal, according to the service interface call request, generating an authentication request for at least one identity attribute in the target digital identity;

第一通信模块610,还用于若服务接口调用请求携带的服务接口信息不具有合法性,向服务调用方返回服务接口调用失败的信息。The first communication module 610 is further configured to return information that the service interface call fails to the service caller if the service interface information carried in the service interface call request is not legal.

请参阅图7,图7是本发明提供的另一种服务接口安全调用装置的结构示意图,图7所示的服务接口安全调用装置应用于服务提供方,可用来执行图4的服务接口安全调用方法,在服务提供方与服务调用方之间建立加密信道,例如,通过SSL、TLS或者HTTPS等协议建立加密信道,本发明实施例对实现加密信道的协议类型不作限定,通过加密信道服务调用方和服务提供方可以进行公钥的交换,对服务接口的安全调用是在加密信道中进行,如图7所示,该服务接口安全调用装置至少包括:Please refer to FIG. 7. FIG. 7 is a schematic structural diagram of another service interface security call device provided by the present invention. The service interface security call device shown in FIG. 7 is applied to a service provider and can be used to execute the service interface security call of FIG. Method, establish an encrypted channel between the service provider and the service caller, for example, establish an encrypted channel through protocols such as SSL, TLS or HTTPS, the embodiment of the present invention does not limit the protocol type for implementing the encrypted channel, and the service caller through the encrypted channel The public key can be exchanged with the service provider, and the secure call to the service interface is carried out in an encrypted channel, as shown in Figure 7, the device for secure call of the service interface includes at least:

第二通信模块710,用于向服务提供方发送服务接口调用请求;接收服务提供方根据服务接口调用请求发出的针对目标数字身份中至少一项身份属性的身份验证请求。The second communication module 710 is configured to send a service interface call request to the service provider; receive an identity verification request for at least one identity attribute in the target digital identity sent by the service provider according to the service interface call request.

第二处理模块720,用于根据身份验证请求生成身份证明。The second processing module 720 is configured to generate an identity certificate according to the identity verification request.

第二通信模块710,还用于向服务提供方发送身份证明;接收服务提供方根据身份证明的验证结果返回的服务接口调用的结果。The second communication module 710 is also configured to send the identity certificate to the service provider; and receive the service interface call result returned by the service provider according to the verification result of the identity certificate.

可选地,第二处理模块720,还用于根据身份验证请求在本地数据库中查询目标数字身份,并获取目标数字身份中的至少一项身份属性;对至少一项身份属性,根据身份验证请求中规定的身份证明的方式,生成身份证明。Optionally, the second processing module 720 is also configured to query the target digital identity in the local database according to the identity verification request, and obtain at least one identity attribute in the target digital identity; for at least one identity attribute, according to the identity verification request Proof of identity is generated in the manner specified in Proof of Identity.

图8示例了一种电子设备的实体结构示意图,如图8所示,该电子设备可以包括:处理器(processor)810、通信接口(Communications Interface)820、存储器(memory)830和通信总线840,其中,处理器810,通信接口820,存储器830通过通信总线840完成相互间的通信。处理器810可以调用存储器830中的逻辑指令,以执行服务接口安全调用方法,在该服务接口安全调用方法应用于服务提供方时,在服务提供方与服务调用方之间建立加密信道,对服务接口的安全调用是在加密信道中进行,该服务接口安全调用方法包括:FIG. 8 illustrates a schematic diagram of the physical structure of an electronic device. As shown in FIG. 8, the electronic device may include: a processor (processor) 810, a communication interface (Communications Interface) 820, a memory (memory) 830, and a communication bus 840, Wherein, the processor 810 , the communication interface 820 , and the memory 830 communicate with each other through the communication bus 840 . The processor 810 can call the logic instructions in the memory 830 to execute the service interface security call method, when the service interface security call method is applied to the service provider, an encrypted channel is established between the service provider and the service caller, and the service The secure calling of the interface is carried out in an encrypted channel, and the safe calling methods of the service interface include:

接收服务调用方发出的服务接口调用请求;Receive the service interface call request sent by the service caller;

根据所述服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求;Generate an identity verification request for at least one identity attribute in the target digital identity according to the service interface invocation request;

向所述服务调用方发送所述身份验证请求,并接收所述服务调用方根据所述身份验证请求发出的身份证明;Send the identity verification request to the service caller, and receive the identity certificate issued by the service caller according to the identity verification request;

对所述身份证明进行验证,并根据验证结果向所述服务调用方返回服务接口调用的结果;Verify the identity certificate, and return the result of the service interface call to the service caller according to the verification result;

在该服务接口安全调用方法应用于服务调用方时,在服务调用方与服务提供方之间建立加密信道,对服务接口的安全调用是在加密信道中进行,该服务接口安全调用方法包括:When the service interface secure calling method is applied to the service caller, an encrypted channel is established between the service caller and the service provider, and the secure call to the service interface is performed in the encrypted channel. The service interface secure calling method includes:

向服务提供方发送服务接口调用请求;Send a service interface call request to the service provider;

接收所述服务提供方根据所述服务接口调用请求发出的针对目标数字身份中至少一项身份属性的身份验证请求;receiving an identity verification request for at least one identity attribute in the target digital identity sent by the service provider according to the service interface call request;

根据所述身份验证请求生成身份证明,并向所述服务提供方发送所述身份证明;generating an identity certificate according to the identity verification request, and sending the identity certificate to the service provider;

接收所述服务提供方根据所述身份证明的验证结果返回的服务接口调用的结果。The service interface call result returned by the service provider according to the verification result of the identity certificate is received.

此外,上述的存储器830中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above logic instructions in the memory 830 may be implemented in the form of software functional units and when sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes. .

另一方面,本发明还提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法所提供的服务接口安全调用方法,在该服务接口安全调用方法应用于服务提供方时,在服务提供方与服务调用方之间建立加密信道,对服务接口的安全调用是在加密信道中进行,该服务接口安全调用方法包括:On the other hand, the present invention also provides a computer program product, the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a computer When executing, the computer can execute the service interface security call method provided by the above methods. When the service interface security call method is applied to the service provider, an encrypted channel is established between the service provider and the service caller, and the service interface The secure call is carried out in an encrypted channel, and the secure call methods of the service interface include:

接收服务调用方发出的服务接口调用请求;Receive the service interface call request sent by the service caller;

根据所述服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求;Generate an identity verification request for at least one identity attribute in the target digital identity according to the service interface invocation request;

向所述服务调用方发送所述身份验证请求,并接收所述服务调用方根据所述身份验证请求发出的身份证明;Send the identity verification request to the service caller, and receive the identity certificate issued by the service caller according to the identity verification request;

对所述身份证明进行验证,并根据验证结果向所述服务调用方返回服务接口调用的结果;Verify the identity certificate, and return the result of the service interface call to the service caller according to the verification result;

在该服务接口安全调用方法应用于服务调用方时,在服务调用方与服务提供方之间建立加密信道,对服务接口的安全调用是在加密信道中进行,该服务接口安全调用方法包括:When the service interface secure calling method is applied to the service caller, an encrypted channel is established between the service caller and the service provider, and the secure call to the service interface is performed in the encrypted channel. The service interface secure calling method includes:

向服务提供方发送服务接口调用请求;Send a service interface call request to the service provider;

接收所述服务提供方根据所述服务接口调用请求发出的针对目标数字身份中至少一项身份属性的身份验证请求;receiving an identity verification request for at least one identity attribute in the target digital identity sent by the service provider according to the service interface call request;

根据所述身份验证请求生成身份证明,并向所述服务提供方发送所述身份证明;generating an identity certificate according to the identity verification request, and sending the identity certificate to the service provider;

接收所述服务提供方根据所述身份证明的验证结果返回的服务接口调用的结果。The service interface call result returned by the service provider according to the verification result of the identity certificate is received.

又一方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各方法所提供的服务接口安全调用方法,在该服务接口安全调用方法应用于服务提供方时,在服务提供方与服务调用方之间建立加密信道,对服务接口的安全调用是在加密信道中进行,该服务接口安全调用方法包括:In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the service interface security call method provided by the above methods. When the service interface secure invocation method is applied to the service provider, an encrypted channel is established between the service provider and the service caller, and the secure invocation of the service interface is performed in the encrypted channel. The service interface secure invocation method includes:

接收服务调用方发出的服务接口调用请求;Receive the service interface call request sent by the service caller;

根据所述服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求;Generate an identity verification request for at least one identity attribute in the target digital identity according to the service interface invocation request;

向所述服务调用方发送所述身份验证请求,并接收所述服务调用方根据所述身份验证请求发出的身份证明;Send the identity verification request to the service caller, and receive the identity certificate issued by the service caller according to the identity verification request;

对所述身份证明进行验证,并根据验证结果向所述服务调用方返回服务接口调用的结果;Verify the identity certificate, and return the result of the service interface call to the service caller according to the verification result;

在该服务接口安全调用方法应用于服务调用方时,在服务调用方与服务提供方之间建立加密信道,对服务接口的安全调用是在加密信道中进行,该服务接口安全调用方法包括:When the service interface secure calling method is applied to the service caller, an encrypted channel is established between the service caller and the service provider, and the secure call to the service interface is performed in the encrypted channel. The service interface secure calling method includes:

向服务提供方发送服务接口调用请求;Send a service interface call request to the service provider;

接收所述服务提供方根据所述服务接口调用请求发出的针对目标数字身份中至少一项身份属性的身份验证请求;receiving an identity verification request for at least one identity attribute in the target digital identity sent by the service provider according to the service interface call request;

根据所述身份验证请求生成身份证明,并向所述服务提供方发送所述身份证明;generating an identity certificate according to the identity verification request, and sending the identity certificate to the service provider;

接收所述服务提供方根据所述身份证明的验证结果返回的服务接口调用的结果。The service interface call result returned by the service provider according to the verification result of the identity certificate is received.

以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative efforts.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the implementations, those skilled in the art can clearly understand that each implementation can be implemented by means of software plus a necessary general hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic discs, optical discs, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims (10)

1.一种服务接口安全调用方法,其特征在于,应用于服务提供方,在所述服务提供方与服务调用方之间建立加密信道,对服务接口的安全调用是在所述加密信道中进行,所述服务接口安全调用方法包括:1. A method for securely invoking a service interface, characterized in that it is applied to a service provider, and an encrypted channel is established between the service provider and the service caller, and the secure call to the service interface is carried out in the encrypted channel , the safe call method of the service interface includes: 接收服务调用方发出的服务接口调用请求;Receive the service interface call request sent by the service caller; 根据所述服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求;Generate an identity verification request for at least one identity attribute in the target digital identity according to the service interface invocation request; 向所述服务调用方发送所述身份验证请求,并接收所述服务调用方根据所述身份验证请求发出的身份证明;Send the identity verification request to the service caller, and receive the identity certificate issued by the service caller according to the identity verification request; 对所述身份证明进行验证,并根据验证结果向所述服务调用方返回服务接口调用的结果。The identity certificate is verified, and the result of calling the service interface is returned to the service caller according to the verification result. 2.根据权利要求1所述的服务接口安全调用方法,其特征在于,根据所述服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求,包括:2. The service interface security calling method according to claim 1, characterized in that, according to the service interface calling request, an identity verification request for at least one identity attribute in the target digital identity is generated, including: 根据所述服务接口调用请求确定身份验证的策略;所述身份验证的策略包括:所述目标数字身份中的至少一项身份属性和对所述至少一项身份属性进行身份证明的方式;Determine an identity verification strategy according to the service interface call request; the identity verification strategy includes: at least one identity attribute in the target digital identity and a way to authenticate the at least one identity attribute; 根据所述身份验证的策略生成所述身份验证请求;generating the identity verification request according to the identity verification policy; 对所述身份证明进行验证,包括:Verification of said identification, including: 根据所确定的身份证明的方式对所述身份证明进行验证,得到所述验证结果。The identity certificate is verified according to the determined identity certificate method, and the verification result is obtained. 3.根据权利要求1或2所述的服务接口安全调用方法,其特征在于,对所述身份证明进行验证,并根据验证结果向所述服务调用方返回服务接口调用的结果,包括:3. The service interface secure calling method according to claim 1 or 2, characterized in that, verifying the identity certificate, and returning the result of calling the service interface to the service caller according to the verification result, including: 判断身份证明是否有效;Determine whether the identity certificate is valid; 若身份证明有效,基于所述目标数字身份的至少一项身份属性,根据服务接口调用请求携带的服务接口信息,调用对应版本的服务接口提供服务,得到服务接口调用的结果;If the identity certificate is valid, based on at least one identity attribute of the target digital identity, according to the service interface information carried in the service interface call request, call the corresponding version of the service interface to provide services, and obtain the result of the service interface call; 向所述服务调用方返回所述服务接口调用的结果;Returning the result of the service interface call to the service caller; 若身份证明无效,向所述服务调用方返回所述服务接口调用失败的信息。If the identity certificate is invalid, return the information that the service interface call fails to the service caller. 4.根据权利要求3所述的服务接口安全调用方法,其特征在于,根据所述服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求之前,还包括:4. The service interface security calling method according to claim 3, characterized in that, according to the service interface calling request, before generating an identity verification request for at least one identity attribute in the target digital identity, further comprising: 判断身份验证提议中服务接口调用请求携带的服务接口信息是否具有合法性;Judging whether the service interface information carried in the service interface call request in the identity verification proposal is legal; 若服务接口调用请求携带的服务接口信息具有合法性,根据所述服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求;If the service interface information carried in the service interface call request is legal, generate an identity verification request for at least one identity attribute in the target digital identity according to the service interface call request; 若服务接口调用请求携带的服务接口信息不具有合法性,向所述服务调用方返回所述服务接口调用失败的信息。If the service interface information carried in the service interface call request is not legal, return information that the service interface call fails to the service caller. 5.一种服务接口安全调用方法,其特征在于,应用于服务调用方,在所述服务调用方与服务提供方之间建立加密信道,对服务接口的安全调用是在所述加密信道中进行,所述服务接口安全调用方法包括:5. A method for securely invoking a service interface, characterized in that it is applied to a service caller, and an encrypted channel is established between the service caller and the service provider, and the secure call to the service interface is performed in the encrypted channel , the safe call method of the service interface includes: 向服务提供方发送服务接口调用请求;Send a service interface call request to the service provider; 接收所述服务提供方根据所述服务接口调用请求发出的针对目标数字身份中至少一项身份属性的身份验证请求;receiving an identity verification request for at least one identity attribute in the target digital identity sent by the service provider according to the service interface call request; 根据所述身份验证请求生成身份证明,并向所述服务提供方发送所述身份证明;generating an identity certificate according to the identity verification request, and sending the identity certificate to the service provider; 接收所述服务提供方根据所述身份证明的验证结果返回的服务接口调用的结果。The service interface call result returned by the service provider according to the verification result of the identity certificate is received. 6.根据权利要求5所述的服务接口安全调用方法,其特征在于,根据所述身份验证请求生成身份证明,包括:6. The service interface security calling method according to claim 5, characterized in that generating an identity certificate according to the identity verification request comprises: 根据所述身份验证请求在本地数据库中查询所述目标数字身份,并获取所述目标数字身份中的所述至少一项身份属性;querying the target digital identity in a local database according to the identity verification request, and acquiring the at least one identity attribute in the target digital identity; 对所述至少一项身份属性,根据所述身份验证请求中规定的身份证明的方式,生成所述身份证明。For the at least one identity attribute, the identity certificate is generated according to the manner of the identity certificate specified in the identity verification request. 7.一种服务接口安全调用装置,其特征在于,应用于服务提供方,在所述服务提供方与服务调用方之间建立加密信道,对服务接口的安全调用是在所述加密信道中进行,所述服务接口安全调用装置包括:7. A device for securely invoking a service interface, characterized in that it is applied to a service provider, and an encrypted channel is established between the service provider and the service caller, and the secure call to the service interface is performed in the encrypted channel , the device for securely invoking the service interface includes: 第一通信模块,用于接收服务调用方发出的服务接口调用请求;The first communication module is configured to receive a service interface call request sent by a service caller; 第一处理模块,用于根据所述服务接口调用请求,生成针对目标数字身份中至少一项身份属性的身份验证请求;A first processing module, configured to generate an identity verification request for at least one identity attribute in the target digital identity according to the service interface invocation request; 所述第一通信模块,还用于向所述服务调用方发送所述身份验证请求,并接收所述服务调用方根据所述身份验证请求生成的身份证明;The first communication module is further configured to send the identity verification request to the service caller, and receive an identity certificate generated by the service caller according to the identity verification request; 所述第一处理模块,还用于对所述身份证明进行验证;The first processing module is further configured to verify the identity certificate; 所述第一通信模块,还用于根据验证结果向所述服务调用方返回服务接口调用的结果。The first communication module is further configured to return a service interface call result to the service caller according to the verification result. 8.一种服务接口安全调用装置,其特征在于,应用于服务调用方,在所述服务调用方与服务提供方之间建立加密信道,对服务接口的安全调用是在所述加密信道中进行,所述服务接口安全调用装置包括:8. A device for securely invoking a service interface, characterized in that it is applied to a service caller, and an encrypted channel is established between the service caller and the service provider, and the secure call to the service interface is performed in the encrypted channel , the device for securely invoking the service interface includes: 第二通信模块,用于向服务提供方发送服务接口调用请求;接收所述服务提供方根据所述服务接口调用请求发出的针对目标数字身份中至少一项身份属性的身份验证请求;The second communication module is configured to send a service interface call request to the service provider; receive an identity verification request for at least one identity attribute in the target digital identity sent by the service provider according to the service interface call request; 第二处理模块,用于根据所述身份验证请求生成身份证明;A second processing module, configured to generate an identity certificate according to the identity verification request; 所述第二通信模块,还用于向所述服务提供方发送所述身份证明;接收所述服务提供方根据所述身份证明的验证结果返回的服务接口调用的结果。The second communication module is further configured to send the identity certificate to the service provider; and receive the service interface call result returned by the service provider according to the verification result of the identity certificate. 9.一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1至4任一项所述服务接口安全调用方法的步骤,或者实现如权利要求5或6所述服务接口安全调用方法的步骤。9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor according to claim 1 is implemented when executing the program. The step of safely invoking the method of the service interface described in any one of claims 4 to 4, or the step of implementing the method of safely invoking the service interface described in claim 5 or 6. 10.一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至4任一项所述服务接口安全调用方法的步骤,或者实现如权利要求5或6所述服务接口安全调用方法的步骤。10. A non-transitory computer-readable storage medium, on which a computer program is stored, characterized in that, when the computer program is executed by a processor, it implements the service interface security calling method according to any one of claims 1 to 4 steps, or realize the steps of safely invoking the service interface method according to claim 5 or 6.
CN202110672759.4A 2021-06-17 2021-06-17 Service interface securely invokes methods, devices, equipment and storage media Pending CN115495255A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110672759.4A CN115495255A (en) 2021-06-17 2021-06-17 Service interface securely invokes methods, devices, equipment and storage media

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110672759.4A CN115495255A (en) 2021-06-17 2021-06-17 Service interface securely invokes methods, devices, equipment and storage media

Publications (1)

Publication Number Publication Date
CN115495255A true CN115495255A (en) 2022-12-20

Family

ID=84464002

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110672759.4A Pending CN115495255A (en) 2021-06-17 2021-06-17 Service interface securely invokes methods, devices, equipment and storage media

Country Status (1)

Country Link
CN (1) CN115495255A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101534196A (en) * 2008-03-12 2009-09-16 因特伟特公司 Method and apparatus for securely invoking a rest api
CN101686127A (en) * 2008-09-24 2010-03-31 北京创原天地科技有限公司 Novel USBKey secure calling method and USBKey device
CN105991590A (en) * 2015-02-15 2016-10-05 阿里巴巴集团控股有限公司 Method and system for verifying user identity, client, and server
CN109150805A (en) * 2017-06-19 2019-01-04 亿阳安全技术有限公司 The method for managing security and system of application programming interface
CN111416704A (en) * 2020-03-17 2020-07-14 中国建设银行股份有限公司 Data processing method, device and system based on block chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101534196A (en) * 2008-03-12 2009-09-16 因特伟特公司 Method and apparatus for securely invoking a rest api
CN101686127A (en) * 2008-09-24 2010-03-31 北京创原天地科技有限公司 Novel USBKey secure calling method and USBKey device
CN105991590A (en) * 2015-02-15 2016-10-05 阿里巴巴集团控股有限公司 Method and system for verifying user identity, client, and server
CN109150805A (en) * 2017-06-19 2019-01-04 亿阳安全技术有限公司 The method for managing security and system of application programming interface
CN111416704A (en) * 2020-03-17 2020-07-14 中国建设银行股份有限公司 Data processing method, device and system based on block chain

Similar Documents

Publication Publication Date Title
US8812838B2 (en) Configuring a valid duration period for a digital certificate
US20190173873A1 (en) Identity verification document request handling utilizing a user certificate system and user identity document repository
RU2411668C2 (en) Expansion of user comparison information for protocols
US20090240936A1 (en) System and method for storing client-side certificate credentials
DK2414983T3 (en) Secure computer system
CN102217280B (en) Method, system, and server for user service authentication
JP2018519562A (en) Method and system for transaction security
CN104753674A (en) Application identity authentication method and device
US20030135734A1 (en) Secure mutual authentication system
RU2625949C2 (en) Method and system using cyber identifier for ensuring protected transactions
CN111371811A (en) Resource calling method, resource calling device, client and service server
CN118612096A (en) A method and device for verifying operation and maintenance identity security
CN105577606B (en) A method and device for realizing authenticator registration
CN111614458A (en) Generating method, system and storage medium of gateway JWT
CN116248368A (en) Identity authentication method, system, equipment and storage medium based on block chain
CN115622747A (en) API authorization authentication processing method, device, electronic device and storage medium
CN111723347B (en) Identity authentication method, identity authentication device, electronic equipment and storage medium
CN112039857B (en) Calling method and device of public basic module
CN110532741B (en) Personal information authorization method, authentication center and service provider
CN115495255A (en) Service interface securely invokes methods, devices, equipment and storage media
CN118250647A (en) A message push system and method
CN111935164B (en) Https interface request method
CN115664823A (en) An identity authentication method, device, equipment and storage medium
CN114500031A (en) System, method, electronic device and medium for obtaining BI report form based on single sign-on
TWI795148B (en) Device, method and system of handling access control

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20230306

Address after: Room 502, Unit 4, Building 5, Yard T05, Tangjialing New Town, Northwest Wang Town, Haidian District, Beijing 100094

Applicant after: Lan Ting

Address before: 516, Building 2, Fenghui Center, No. 218, Tianfu 3rd Street, High tech Zone, Chengdu, Sichuan 610041

Applicant before: Kuaizuo (Chengdu) Technology Co.,Ltd.

TA01 Transfer of patent application right