[go: up one dir, main page]

HK1249295B - Digital certificate applying method and device - Google Patents

Digital certificate applying method and device Download PDF

Info

Publication number
HK1249295B
HK1249295B HK18108073.3A HK18108073A HK1249295B HK 1249295 B HK1249295 B HK 1249295B HK 18108073 A HK18108073 A HK 18108073A HK 1249295 B HK1249295 B HK 1249295B
Authority
HK
Hong Kong
Prior art keywords
application
information
signature data
server
terminal signature
Prior art date
Application number
HK18108073.3A
Other languages
Chinese (zh)
Other versions
HK1249295A1 (en
Inventor
魏亚文
Original Assignee
创新先进技术有限公司
Filing date
Publication date
Application filed by 创新先进技术有限公司 filed Critical 创新先进技术有限公司
Priority to HK18108073.3A priority Critical patent/HK1249295B/en
Publication of HK1249295A1 publication Critical patent/HK1249295A1/en
Publication of HK1249295B publication Critical patent/HK1249295B/en

Links

Description

数字证书申请方法和装置Digital certificate application method and device

技术领域Technical Field

本说明书涉及安全技术领域,尤其涉及一种数字证书申请方法和装置。This specification relates to the field of security technology, and in particular to a method and device for applying for a digital certificate.

背景技术Background Art

数字证书通常由权威机构CA(Certificate Authority,第三方可信机构)颁发,可包括公钥以及公钥拥有者信息,可用于在互联网中对对方的身份进行验证。A digital certificate is usually issued by a CA (Certificate Authority, a third-party trusted organization) and may include a public key and public key owner information, and can be used to verify the identity of another party on the Internet.

目前,在申请数字证书的过程中,通常需要生成CSR(Cerificate SigningRequest,证书请求)文件,由于CSR文件的数据结构较复杂、且文件较大,会占用终端较多的计算资源。因此,需要提供一种轻量级、可用的证书申请方案。Currently, when applying for a digital certificate, a CSR (Cerificate Signing Request) file is usually generated. Due to the complex data structure and large file size of the CSR file, it will occupy a lot of terminal computing resources. Therefore, a lightweight and usable certificate application solution is needed.

发明内容Summary of the Invention

有鉴于此,本说明书提供一种数字证书申请方法和装置。In view of this, this specification provides a method and device for applying for a digital certificate.

具体地,本说明书是通过如下技术方案实现的:Specifically, this specification is implemented through the following technical solutions:

一种数字证书申请方法,应用于终端设备,所述终端设备集成有安全元件,并装载有客户端软件,该方法包括:A digital certificate application method is applied to a terminal device, wherein the terminal device is integrated with a security element and loaded with client software, and the method comprises:

客户端向服务端发送数字证书申请请求,以供服务端根据该申请请求生成申请信息,并将该申请信息返回给客户端,所述申请信息包括:与所述申请请求唯一对应的申请标识;The client sends a digital certificate application request to the server, so that the server generates application information according to the application request and returns the application information to the client. The application information includes: an application identifier uniquely corresponding to the application request;

客户端将服务端返回的所述申请信息下发给安全元件;The client sends the application information returned by the server to the secure element;

安全元件根据非对称算法生成公私钥对,采用私钥对所述申请标识进行签名,得到终端签名数据,并将该终端签名数据和公钥封装为指定格式后发送给客户端;The secure element generates a public-private key pair based on an asymmetric algorithm, signs the application identifier with the private key to obtain terminal signature data, and encapsulates the terminal signature data and the public key into a specified format before sending it to the client;

客户端将该指定格式数据发送给服务端,以供服务端在根据所述公钥确定所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、所述客户端的登录用户信息以及证书使用信息发送给CA。The client sends the specified format data to the server, so that the server can send the public key, the terminal signature data, the client's login user information and certificate usage information to the CA after determining that the terminal signature data has passed the verification based on the public key and the application identifier has also passed the verification.

一种数字证书申请方法,应用于服务端,所述服务端用于与终端设备中装载的客户端软件交互,所述终端设备还集成有安全元件,该方法包括:A digital certificate application method, applied to a server, wherein the server is used to interact with client software loaded in a terminal device, wherein the terminal device is also integrated with a security element, comprises:

在接收到客户端发送的数字证书申请请求后,生成申请信息,并将该申请信息发送给客户端和CA,所述申请信息包括:与该申请请求唯一对应的申请标识;After receiving the digital certificate application request from the client, generate application information and send the application information to the client and CA, the application information including: an application identifier uniquely corresponding to the application request;

接收客户端发送的指定格式数据,所述指定格式数据由安全元件在生成公私钥对后,采用私钥对所述申请标识进行签名,得到终端签名数据,并对该终端签名数据和公钥封装而成;Receiving data in a specified format sent by a client, wherein the security element generates a public-private key pair, signs the application identifier using the private key to obtain terminal signature data, and encapsulates the terminal signature data and the public key;

解析所述指定格式数据,并根据所述公钥验证所述终端签名数据,得到终端签名数据中的申请标识;Parsing the specified format data, and verifying the terminal signature data according to the public key to obtain the application identifier in the terminal signature data;

当所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、所述客户端的登录用户信息以及证书使用信息发送给CA,以供CA在确定所述终端签名数据通过验证、且所述申请标识通过验证后,生成数字证书。When the terminal signature data passes verification and the application identifier also passes verification, the public key, the terminal signature data, the client's login user information and the certificate usage information are sent to the CA, so that the CA can generate a digital certificate after determining that the terminal signature data passes verification and the application identifier passes verification.

一种数字证书申请装置,应用于终端设备,所述终端设备还集成有安全元件,该装置包括:A digital certificate application device, applied to a terminal device, wherein the terminal device is also integrated with a security element, comprises:

请求发送单元,向服务端发送数字证书申请请求,以供服务端根据该申请请求生成申请信息,并将该申请信息返回,所述申请信息包括:与所述申请请求唯一对应的申请标识;a request sending unit, which sends a digital certificate application request to a server, so that the server generates application information according to the application request and returns the application information, wherein the application information includes an application identifier uniquely corresponding to the application request;

信息下发单元,将服务端返回的所述申请信息下发给安全元件,以供安全元件根据非对称算法生成公私钥对,采用私钥对所述申请标识进行签名,得到终端签名数据,并将该终端签名数据和公钥封装为指定格式后返回;An information delivery unit delivers the application information returned by the server to the secure element, so that the secure element generates a public-private key pair according to an asymmetric algorithm, signs the application identifier with the private key to obtain terminal signature data, and encapsulates the terminal signature data and the public key into a specified format before returning the result;

数据发送单元,将该指定格式数据发送给服务端,以供服务端在根据所述公钥确定所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、登录用户信息以及证书使用信息发送给CA。The data sending unit sends the specified format data to the server, so that the server can send the public key, the terminal signature data, the login user information and the certificate usage information to the CA after determining that the terminal signature data has passed the verification according to the public key and the application identifier has also passed the verification.

一种数字证书申请装置,应用于服务端,所述装置用于与终端设备中装载的客户端软件交互,所述终端设备还集成有安全元件,该装置包括:A digital certificate application device, applied to a server, is used to interact with client software loaded in a terminal device, wherein the terminal device is also integrated with a security element. The device comprises:

信息生成单元,在接收到客户端发送的数字证书申请请求后,生成申请信息,并将该申请信息发送给客户端和CA,所述申请信息包括:与该申请请求唯一对应的申请标识;The information generating unit generates application information after receiving the digital certificate application request sent by the client, and sends the application information to the client and the CA, wherein the application information includes: an application identifier uniquely corresponding to the application request;

数据接收单元,接收客户端发送的指定格式数据,所述指定格式数据由安全元件在生成公私钥对后,采用私钥对所述申请标识进行签名,得到终端签名数据,并对该终端签名数据和公钥封装而成;A data receiving unit receives data in a specified format sent by a client, wherein the security element generates a public-private key pair, signs the application identifier with the private key to obtain terminal signature data, and encapsulates the terminal signature data and the public key;

数据验证单元,解析所述指定格式数据,并根据所述公钥验证所述终端签名数据,得到终端签名数据中的申请标识;a data verification unit, which parses the specified format data and verifies the terminal signature data according to the public key to obtain the application identifier in the terminal signature data;

证书申请单元,当所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、所述客户端的登录用户信息以及证书使用信息发送给CA,以供CA在确定所述终端签名数据通过验证、且所述申请标识通过验证后,生成数字证书。The certificate application unit sends the public key, the terminal signature data, the client's login user information and the certificate usage information to the CA when the terminal signature data passes the verification and the application identifier also passes the verification, so that the CA can generate a digital certificate after determining that the terminal signature data passes the verification and the application identifier passes the verification.

一种数字证书申请装置,应用于终端设备,该装置包括:A digital certificate application device, applied to a terminal device, comprising:

安全元件;security element;

处理器;processor;

用于存储机器可执行指令的存储器;memory for storing machine-executable instructions;

其中,通过读取并执行所述存储器存储的与数字证书申请逻辑对应的机器可执行指令,所述处理器被促使:Wherein, by reading and executing the machine executable instructions corresponding to the digital certificate application logic stored in the memory, the processor is prompted to:

向服务端发送数字证书申请请求,以供服务端根据该申请请求生成申请信息,并将该申请信息返回,所述申请信息包括:与所述申请请求唯一对应的申请标识;Sending a digital certificate application request to the server, so that the server generates application information according to the application request and returns the application information, wherein the application information includes: an application identifier uniquely corresponding to the application request;

将服务端返回的所述申请信息下发给安全元件,以供安全元件根据非对称算法生成公私钥对,采用私钥对所述申请标识进行签名,得到终端签名数据,并将该终端签名数据和公钥封装为指定格式后返回;Sending the application information returned by the server to the secure element, so that the secure element generates a public-private key pair according to an asymmetric algorithm, signs the application identifier with the private key to obtain terminal signature data, and encapsulates the terminal signature data and the public key into a specified format before returning the result;

将该指定格式数据发送给服务端,以供服务端在根据所述公钥确定所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、登录用户信息以及证书使用信息发送给CA。The specified format data is sent to the server, so that after the server determines that the terminal signature data has passed the verification based on the public key and the application identifier has also passed the verification, the server sends the public key, the terminal signature data, the login user information and the certificate usage information to the CA.

一种数字证书申请装置,应用于服务器,该装置包括:A digital certificate application device, applied to a server, comprising:

处理器;processor;

用于存储机器可执行指令的存储器;memory for storing machine-executable instructions;

其中,通过读取并执行所述存储器存储的与数字证书申请逻辑对应的机器可执行指令,所述处理器被促使:Wherein, by reading and executing the machine executable instructions corresponding to the digital certificate application logic stored in the memory, the processor is prompted to:

在接收到客户端发送的数字证书申请请求后,生成申请信息,并将该申请信息发送给客户端和CA,所述申请信息包括:与该申请请求唯一对应的申请标识;After receiving the digital certificate application request from the client, generate application information and send the application information to the client and CA, the application information including: an application identifier uniquely corresponding to the application request;

接收客户端发送的指定格式数据,所述指定格式数据由安全元件在生成公私钥对后,采用私钥对所述申请标识进行签名,得到终端签名数据,并对该终端签名数据和公钥封装而成;Receiving data in a specified format sent by a client, wherein the security element generates a public-private key pair, signs the application identifier using the private key to obtain terminal signature data, and encapsulates the terminal signature data and the public key;

解析所述指定格式数据,并根据所述公钥验证所述终端签名数据,得到终端签名数据中的申请标识;Parsing the specified format data, and verifying the terminal signature data according to the public key to obtain the application identifier in the terminal signature data;

当所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、所述客户端的登录用户信息以及证书使用信息发送给CA,以供CA在确定所述终端签名数据通过验证、且所述申请标识通过验证后,生成数字证书。When the terminal signature data passes verification and the application identifier also passes verification, the public key, the terminal signature data, the client's login user information and the certificate usage information are sent to the CA, so that the CA can generate a digital certificate after determining that the terminal signature data passes verification and the application identifier passes verification.

由以上描述可以看出,本说明书可通过终端与服务端配合生成证书请求文件,大大减轻安全元件的计算压力,实现轻量级、可用性高的证书申请方案。同时,由服务端和CA分别对终端签名数据进行验证,还可确保数字证书申请的安全性。As can be seen from the above description, this specification allows the terminal and server to collaborate to generate a certificate request file, significantly reducing the computational burden on the secure element and achieving a lightweight, highly available certificate application solution. Furthermore, the server and CA independently verify the terminal signature data, further ensuring the security of the digital certificate application.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是本说明书一示例性实施例示出的一种数字证书申请方法的流程示意图。FIG1 is a flow chart of a method for applying for a digital certificate shown in an exemplary embodiment of this specification.

图2是本说明书一示例性实施例示出的另一种数字证书申请方法的流程示意图。FIG2 is a flow chart of another digital certificate application method according to an exemplary embodiment of this specification.

图3是本说明书一示例性实施例示出的另一种数字证书申请方法的流程示意图。FIG3 is a flow chart of another digital certificate application method according to an exemplary embodiment of this specification.

图4是本说明书一示例性实施例示出的一种TLV格式的指定数据的结构示意图。FIG4 is a schematic diagram of the structure of designated data in a TLV format shown in an exemplary embodiment of this specification.

图5是本说明书一示例性实施例示出的一种终端设备的一结构示意图。FIG5 is a schematic structural diagram of a terminal device shown in an exemplary embodiment of this specification.

图6是本说明书一示例性实施例示出的一种数字证书申请装置的框图。FIG6 is a block diagram of a digital certificate application device shown in an exemplary embodiment of this specification.

图7是本说明书一示例性实施例示出的一种服务器的一结构示意图。FIG. 7 is a schematic structural diagram of a server shown in an exemplary embodiment of this specification.

图8是本说明书一示例性实施例示出的另一种数字证书申请装置的框图。FIG8 is a block diagram of another digital certificate application device shown in an exemplary embodiment of this specification.

具体实施方式DETAILED DESCRIPTION

这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with this specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of this specification, as detailed in the appended claims.

在本说明书使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书。在本说明书和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. As used in this specification and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

应当理解,尽管在本说明书可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information without departing from the scope of this specification. Depending on the context, the term "if" as used herein may be interpreted as "when," "when," or "in response to determining."

本说明书提供一种数字证书申请方案,可将原来由终端生成的证书请求文件改为由终端和服务端配合生成,以节省终端的计算资源。This specification provides a digital certificate application solution that can change the certificate request file originally generated by the terminal to be generated by the terminal and the server in a coordinated manner, thereby saving the terminal's computing resources.

图1是本说明书一示例性实施例示出的一种数字证书申请方法的流程示意图。FIG1 is a flow chart of a method for applying for a digital certificate shown in an exemplary embodiment of this specification.

所述数字证书申请方法可以应用在终端中,所述终端可以为手机、PC机等电子设备,所述终端中通常装载有可以和服务端进行交互的客户端软件(Application,APP),该客户端软件并不限制于独立装载的APP,还可以为浏览器等,本说明书对此不作特殊限制。所述终端中还集成有安全元件(Secure Element,SE),可用于生成公私钥对、实现加密、签名等操作。The digital certificate application method can be applied to a terminal, which can be an electronic device such as a mobile phone or a PC. The terminal is typically loaded with client software (Application, APP) that can interact with the server. The client software is not limited to independently loaded APPs and can also be a browser, etc., and this specification does not impose any special restrictions on this. The terminal also integrates a secure element (Secure Element, SE) that can be used to generate public and private key pairs and implement operations such as encryption and signing.

请参考图1,所述数字证书申请方法可以包括以下步骤:Referring to FIG1 , the digital certificate application method may include the following steps:

步骤102,客户端向服务端发送数字证书申请请求,以供服务端根据该申请请求生成申请信息,并将该申请信息返回给客户端,所述申请信息包括:与所述申请请求唯一对应的申请标识。In step 102, the client sends a digital certificate application request to the server, so that the server generates application information according to the application request and returns the application information to the client. The application information includes an application identifier uniquely corresponding to the application request.

在本实施例中,所述申请信息还可以包括:非对称算法信息以及签名算法信息、时间戳等信息,本说明书对此不作特殊限制。In this embodiment, the application information may further include: asymmetric algorithm information, signature algorithm information, timestamp and other information, which is not particularly limited in this specification.

步骤104,客户端将服务端返回的所述申请信息下发给安全元件。In step 104 , the client sends the application information returned by the server to the secure element.

步骤106,安全元件根据非对称算法生成公私钥对,采用私钥对所述申请标识进行签名,得到终端签名数据,并将该终端签名数据和公钥封装为指定格式后发送给客户端。In step 106 , the security element generates a public-private key pair according to an asymmetric algorithm, uses the private key to sign the application identifier to obtain terminal signature data, and encapsulates the terminal signature data and the public key into a specified format and sends the result to the client.

在本实施例中,当所述申请信息包括:非对称算法信息以及签名算法信息时,安全元件可以根据申请信息中指定的非对称算法生成公私钥对,采用申请信息中的签名算法计算所述申请标识的摘要,并采用私钥对该摘要进行签名,以得到终端签名数据。In this embodiment, when the application information includes: asymmetric algorithm information and signature algorithm information, the security element can generate a public-private key pair based on the asymmetric algorithm specified in the application information, use the signature algorithm in the application information to calculate the summary of the application identifier, and use the private key to sign the summary to obtain terminal signature data.

在另一个例子中,安全元件在进行摘要计算、签名时,所使用的数据并不限制于所述申请标识,还可以包括安全元件的生成公私钥对时得到的密钥长度等信息,本说明书对此不作特殊限制。In another example, when the security element performs digest calculation and signature, the data used is not limited to the application identifier, but may also include information such as the key length obtained when the security element generates a public-private key pair. This specification does not impose any special restrictions on this.

在本实施例中,所述指定格式可以为:TLV(Type,类型;Length,长度;Value,值)格式等。In this embodiment, the specified format may be a TLV (Type, type; Length, length; Value) format, etc.

步骤108,客户端将该指定格式数据发送给服务端,以供服务端在根据所述公钥确定所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、所述客户端的登录用户信息以及证书使用信息发送给CA。In step 108, the client sends the specified format data to the server, so that the server can send the public key, the terminal signature data, the client's login user information and certificate usage information to the CA after determining that the terminal signature data has passed the verification based on the public key and the application identifier has also passed the verification.

图2是本说明书一示例性实施例示出的另一种数字证书申请方法的流程示意图。FIG2 is a flow chart of another digital certificate application method according to an exemplary embodiment of this specification.

请参考图2,所述数字证书申请方法可以应用在服务端,该服务端通常为第三方服务提供商部署的服务器或者服务器集群,该数字证书申请方法包括以下步骤:Referring to FIG. 2 , the digital certificate application method may be applied on a server, which is typically a server or server cluster deployed by a third-party service provider. The digital certificate application method includes the following steps:

步骤202,在接收到客户端发送的数字证书申请请求后,生成申请信息,并将该申请信息发送给客户端和CA,所述申请信息包括:与该申请请求唯一对应的申请标识。Step 202: After receiving the digital certificate application request from the client, generate application information and send the application information to the client and the CA. The application information includes an application identifier uniquely corresponding to the application request.

步骤204,接收客户端发送的指定格式数据,所述指定格式数据由安全元件在生成公私钥对后,采用私钥对所述申请标识进行签名,得到终端签名数据,并对该终端签名数据和公钥封装而成。Step 204 , receiving the specified format data sent by the client, wherein the specified format data is generated by the security element, after generating a public-private key pair, using the private key to sign the application identifier to obtain terminal signature data, and encapsulating the terminal signature data and the public key.

步骤206,解析所述指定格式数据,并根据所述公钥验证所述终端签名数据,得到终端签名数据中的申请标识。Step 206: Parse the specified format data, verify the terminal signature data according to the public key, and obtain the application identifier in the terminal signature data.

步骤208,当所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、所述客户端的登录用户信息以及证书使用信息发送给CA,以供CA在确定所述终端签名数据通过验证、且所述申请标识通过验证后,生成数字证书。Step 208: When the terminal signature data passes verification and the application identifier also passes verification, the public key, the terminal signature data, the client's login user information and the certificate usage information are sent to the CA, so that the CA can generate a digital certificate after determining that the terminal signature data passes verification and the application identifier passes verification.

由以上描述可以看出,本实施例可通过终端与服务端配合生成证书请求文件,大大减轻安全元件的计算压力,实现轻量级、可用性高的证书申请方案。同时,由服务端和CA对终端签名数据进行验证还可确保数字证书申请的安全性。As can be seen from the above description, this embodiment can generate a certificate request file through the cooperation between the terminal and the server, greatly reducing the computing pressure on the secure element and realizing a lightweight and highly available certificate application solution. Furthermore, verification of the terminal signature data by the server and the CA further ensures the security of the digital certificate application.

图3是本说明书一示例性实施例示出的另一种数字证书申请方法的流程示意图。FIG3 is a flow chart of another digital certificate application method according to an exemplary embodiment of this specification.

请参考图3,所述数字证书申请方法可以包括以下步骤:Referring to FIG3 , the digital certificate application method may include the following steps:

步骤302,客户端向服务端发送数字证书申请请求。Step 302: The client sends a digital certificate request to the server.

在本实施例中,基于客户端登录的用户在申请数字证书时,可以基于客户端发起数字证书申请请求。例如,可通过触发预定的选项实现该数字证书申请请求的发送。In this embodiment, when a user who logs in through a client applies for a digital certificate, the client can initiate a digital certificate application request. For example, the sending of the digital certificate application request can be achieved by triggering a predetermined option.

在本实施例中,所述数字证书申请请求中通常携带有用户的账号信息,例如账号ID等。In this embodiment, the digital certificate application request usually carries user account information, such as account ID.

步骤304,服务端根据该申请请求生成申请信息,并将该申请信息发送给客户端和CA。Step 304: The server generates application information according to the application request and sends the application information to the client and the CA.

在本实施例中,服务端在接收到客户端发送的数字证书申请请求后,针对该申请请求,可以生成申请信息并发送给客户端和CA。In this embodiment, after receiving the digital certificate application request sent by the client, the server may generate application information in response to the application request and send the information to the client and the CA.

在一个例子中,所述申请信息可包括:与所述申请请求唯一对应的申请标识。该申请标识可以被携带在本次数字证书申请的交互过程中,用于标识本次数字证书申请,以在客户端重复发送数字证书申请请求时,重新进行数字证书申请。In one example, the application information may include an application identifier uniquely corresponding to the application request. The application identifier may be carried in the current digital certificate application interaction process to identify the current digital certificate application, so that the digital certificate application can be re-submitted when the client repeatedly sends a digital certificate application request.

在另一个例子中,在申请标识的基础上,所述申请信息还可以包括:非对称算法信息以及签名算法信息。所述非对称算法通常是安全元件生成公私钥对的算法依据,所述签名算法信息通常是安全元件计算摘要的算法依据。In another example, in addition to the application identifier, the application information may also include: asymmetric algorithm information and signature algorithm information. The asymmetric algorithm is typically the algorithm used by the secure element to generate a public-private key pair, and the signature algorithm is typically the algorithm used by the secure element to calculate a digest.

当然,所述申请信息还可以包括其他信息,例如时间戳等,本说明书对此不作特殊限制。Of course, the application information may also include other information, such as a timestamp, etc., and this specification does not impose any special restrictions on this.

步骤306,客户端将所述申请信息下发给安全元件。In step 306 , the client sends the application information to the secure element.

步骤308,安全元件生成公私钥对。In step 308 , the secure element generates a public-private key pair.

在一个例子中,若所述申请信息中携带非对称算法信息,安全元件可以根据该非对称算法信息生成公私钥对,例如,根据申请信息中携带的RSA算法生成公私钥对。In one example, if the application information carries asymmetric algorithm information, the security element can generate a public-private key pair based on the asymmetric algorithm information, for example, generate a public-private key pair based on the RSA algorithm carried in the application information.

在另一个例子中,若所述申请信息中未携带非对称算法,安全元件可以根据缺省算法生成公私钥对,本实施例对此不作特殊限制。In another example, if the application information does not carry an asymmetric algorithm, the security element may generate a public-private key pair according to a default algorithm, which is not particularly limited in this embodiment.

在本实施例中,安全元件在生成公私钥对后,还可以得到密钥长度。In this embodiment, after generating the public-private key pair, the security element can also obtain the key length.

步骤310,安全元件采用私钥对该申请标识和密钥长度进行签名,得到终端签名数据。In step 310 , the secure element uses a private key to sign the application identifier and key length to obtain terminal signature data.

基于前述步骤308,安全元件可将申请标识和密钥长度作为签名原文,先采用申请信息中指定的签名算法计算申请标识和密钥长度的摘要,然后采用公私钥对中的私钥对该摘要进行签名,以得到终端签名数据。Based on the aforementioned step 308, the security element can use the application identifier and key length as the signature original text, first use the signature algorithm specified in the application information to calculate the digest of the application identifier and key length, and then use the private key in the public-private key pair to sign the digest to obtain the terminal signature data.

在本例中,对密钥长度进行签名是对公钥进行签名的最小安全有效集合,可有效节约安全元件的处理资源。另一方面,只有通过暴力破解,对密钥长度进行因数分解,才可能会计算出私钥,而因数分解的难度极大,目前也没有相关的因数分解方案,因此将秘钥长度作为签名原文,并不会影响私钥的安全性。In this example, signing the key length is the minimum secure and effective set for signing the public key, effectively conserving secure element processing resources. On the other hand, calculating the private key is only possible through brute force factoring of the key length. Factoring is extremely difficult, and there is currently no relevant factoring solution. Therefore, using the key length as the signature text does not affect the security of the private key.

在另一个例子中,也可以不将密钥长度作为签名原文,例如,可以将时间戳等其他信息作为签名原文。当然,也可以仅将申请标识作为签名原文,本说明书对此不作特殊限制。In another example, the key length may not be used as the signature text. For example, other information such as a timestamp may be used as the signature text. Of course, only the application identifier may be used as the signature text, and this specification does not impose any special restrictions on this.

步骤312,安全元件将该终端签名数据、密钥长度和公钥封装为指定格式后发送给客户端。In step 312 , the secure element encapsulates the terminal signature data, key length, and public key into a specified format and sends the encapsulated data to the client.

在本实施例中,所述指定格式可以由开发人员预先进行设置,例如:TLV格式等,本说明书对此不作特殊限制。In this embodiment, the specified format may be pre-set by a developer, such as a TLV format, etc., and this specification does not impose any special restrictions on this.

请参考图4所示的TLV格式示意图,可在左边起第一个TLV字段添加密钥长度的相关信息,在中间的TLV字段添加公钥的信息,在右边的TLV字段添终端签名数据。Please refer to the TLV format diagram shown in Figure 4. You can add key length information to the first TLV field on the left, add public key information to the middle TLV field, and add terminal signature data to the right TLV field.

以RSA的算法位数是1024位为例,密钥长度为128字节,终端签名数据也是128字节,整个TLV共计265个字节,大大小于传统技术中2k左右的P10格式的证书请求文件,实现终端轻量级的数据封装,大大减轻了安全元件的计算量,也节省了网络传输流量。Taking the RSA algorithm with 1024 bits as an example, the key length is 128 bytes, the terminal signature data is also 128 bytes, and the entire TLV totals 265 bytes, which is much smaller than the P10 format certificate request file of about 2KB in traditional technology. This realizes lightweight data encapsulation of the terminal, greatly reduces the computing workload of the security element, and saves network transmission traffic.

步骤314,客户端将该指定格式数据发送给服务端。Step 314: The client sends the data in the specified format to the server.

步骤316,服务端解析所述指定格式数据,确定终端签名数据通过验证,且所述申请标识也通过验证。In step 316, the server parses the data in the specified format and determines whether the terminal signature data passes verification and whether the application identifier also passes verification.

在本实施例中,服务端在接收到所述指定格式数据后,可从该指定格式数据中提取出密钥长度、公钥以及终端签名数据。然后可采用该公钥对终端签名数据进行验证,在验证过程中得到终端签名数据中的申请标识和密钥长度,并验证得到的密钥长度和从上述指定格式中提取出的密钥长度是否一致,若一致,则可以确认密钥长度通过验证In this embodiment, after receiving the specified format data, the server can extract the key length, public key and terminal signature data from the specified format data. The public key can then be used to verify the terminal signature data. During the verification process, the application identifier and key length in the terminal signature data are obtained, and the obtained key length is verified to be consistent with the key length extracted from the above specified format. If they are consistent, it can be confirmed that the key length has passed the verification.

若服务端确定该终端签名数据和密钥长度通过验证,则可以确定公钥安全,所述指定格式数据没有被篡改。若服务端还确定所述申请标识也通过验证,则可以确定客户端也通过验证,进而可以执行步骤318。If the server determines that the terminal signature data and key length pass the verification, it can be determined that the public key is secure and the specified format data has not been tampered with. If the server also determines that the application identifier also passes the verification, it can be determined that the client also passes the verification, and then step 318 can be executed.

值得注意的是,客户端和服务端的交互过程中通常还会携带有用户账号的信息,服务端在接收到上述指定格式数据后,可以根据账号信息查找为该客户端生成的申请标识,并判断查找到的申请标识与校验签名过程中得到的申请标识是否一致。若一致,则可以确定申请标识通过验证;若不一致,则可以确定申请标识未通过验证。当然,在实际应用中,还可以采用其他方式对申请标识进行验证,本说明书对此不作特殊限制。It is worth noting that the interaction between the client and the server usually also carries user account information. After receiving the data in the specified format above, the server can search for the application identifier generated for the client based on the account information and determine whether the application identifier found is consistent with the application identifier obtained during the signature verification process. If they are consistent, it can be determined that the application identifier has passed the verification; if they are inconsistent, it can be determined that the application identifier has not passed the verification. Of course, in actual applications, other methods can also be used to verify the application identifier, and this manual does not impose any special restrictions on this.

在本实施例中,若服务端确定终端签名数据未通过验证,或申请标识未通过验证,则可以确认本次数字证书申请存在安全隐患,进而可以向客户端返回申请失败的消息。In this embodiment, if the server determines that the terminal signature data has not passed verification, or the application identifier has not passed verification, it can be confirmed that there is a security risk in this digital certificate application, and then a message indicating that the application has failed can be returned to the client.

步骤318,服务端将所述公钥、所述终端签名数据、所述客户端的登录用户信息、证书使用信息、证书使用信息以及服务端签名数据发送给CA。In step 318, the server sends the public key, the terminal signature data, the client's login user information, certificate usage information, certificate usage information, and the server signature data to the CA.

基于前述步骤316,在确定终端签名数据通过验证,且申请标识也通过验证后,可以获取客户端登录用户的用户信息,例如:用户名称、用户地址、用户电话等信息。Based on the aforementioned step 316, after determining that the terminal signature data passes verification and the application identifier also passes verification, the user information of the client login user, such as user name, user address, user phone number, etc., can be obtained.

在本实施例中,服务端可以将上述指定格式数据中携带的公钥封装为PKCS1、上述指定格式数据中的终端签名数据、用户信息、证书使用信息以及服务端签名数据一同发送给CA。In this embodiment, the server can encapsulate the public key carried in the above specified format data into PKCS1 and send it together with the terminal signature data, user information, certificate usage information and server signature data in the above specified format data to the CA.

其中,证书使用信息可以包括:证书用途、证书显示模板、证书自定义域信息等。The certificate usage information may include: certificate purpose, certificate display template, certificate custom domain information, etc.

所述服务端签名数据由服务端采用服务端私钥对服务端信息进行签名后生成。所述服务端信息可以由开发人员预先进行设置,例如:服务端名称、服务端地址等。The server signature data is generated by the server using the server private key to sign the server information. The server information can be pre-set by the developer, such as the server name, server address, etc.

若CA中保存有服务端公钥,服务端可以仅将所述服务端签名数据发给CA;若CA中未保存服务端公钥,服务端可以将服务端公钥和所述服务端签名数据一同发送给CA,以供CA对服务端签名数据进行验证,本说明书对此不作特殊限制。If the server public key is stored in the CA, the server can send only the server signature data to the CA; if the server public key is not stored in the CA, the server can send both the server public key and the server signature data to the CA for the CA to verify the server signature data. This manual does not impose any special restrictions on this.

步骤320,CA确定所述终端签名数据通过验证、所述申请标识通过验证、且所述服务端签名数据通过验证后,生成数字证书。In step 320 , after the CA determines that the terminal signature data passes verification, the application identifier passes verification, and the server signature data passes verification, a digital certificate is generated.

在本实施例中,CA在接收到服务端发送的上述公钥、终端签名数据、客户端的登录用户信息、证书使用信息以及服务端签名数据后,一方面,可以对该终端签名数据、申请标识和密钥长度进行验证,例如,根据服务端在步骤304中发送的申请标识,参考前述步骤316中服务端的验证方式对该终端签名数据、申请标识和进行验证;根据安全元件的算法类别、位数等对密钥长度进行验证等。In this embodiment, after receiving the above-mentioned public key, terminal signature data, client login user information, certificate usage information and server signature data sent by the server, the CA can, on the one hand, verify the terminal signature data, application identifier and key length. For example, based on the application identifier sent by the server in step 304, refer to the verification method of the server in the aforementioned step 316 to verify the terminal signature data, application identifier and; verify the key length according to the algorithm category, number of bits, etc. of the security element, etc.

另一方面,CA还可以对服务端签名数据进行验证,例如,采用服务端公钥对服务端签名数据进行验证,以验证服务端的签名是否合法。On the other hand, the CA can also verify the server-side signature data, for example, using the server-side public key to verify the server-side signature data to verify whether the server-side signature is legal.

在本实施例中,若CA确定终端签名数据通过验证、申请标识通过验证、且服务端签名数据也通过验证,则可以确定安全元件、客户端和服务端均合法,进而执行生成数字证书的操作。In this embodiment, if the CA determines that the terminal signature data passes verification, the application identifier passes verification, and the server signature data also passes verification, it can be determined that the security element, the client, and the server are all legal, and then the operation of generating a digital certificate is executed.

由以上描述可以看出,本说明书采用处理性能较佳的服务端配合终端生成证书请求文件,以进行数字证书的申请,大大减轻终端安全元件的计算压力,实现轻量级、可用性高的证书申请方案。同时,由服务端对终端的安全元件和客户端进行验证,由CA再对终端的安全元件、客户端以及服务端进行验证,还可确保数字证书申请的安全性。As can be seen from the above description, this specification utilizes a server with superior processing performance to work with the terminal to generate a certificate request file for digital certificate applications. This significantly reduces the computational burden on the terminal's secure element, enabling a lightweight, highly available certificate application solution. Furthermore, the server verifies the terminal's secure element and client, and the CA further verifies the terminal's secure element, client, and server, further ensuring the security of the digital certificate application.

需要说明的是,在前述步骤318中,服务端也可以不发送服务端签名数据给CA,CA默认服务端合法,后续也无需对服务端签名数据进行验证,本说明书对此不作特殊限制。It should be noted that in the aforementioned step 318, the server may not send the server signature data to the CA. The CA assumes that the server is legal and there is no need to verify the server signature data subsequently. This manual does not impose any special restrictions on this.

与前述图1所示的数字证书申请方法的实施例相对应,本说明书还提供了数字证书申请装置的实施例。Corresponding to the embodiment of the digital certificate application method shown in FIG1 , this specification also provides an embodiment of a digital certificate application device.

本说明书数字证书申请装置的实施例可以应用在终端设备上,该终端设备中集成有安全元件。装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在终端设备的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图5所示,为本说明书数字证书申请装置所在终端设备的一种硬件结构图,除了图5所示的处理器、内存、网络接口、以及非易失性存储器之外,实施例中装置所在的终端设备通常根据该终端设备的实际功能,还可以包括其他硬件,对此不再赘述。The embodiments of the digital certificate application device of this specification can be applied to a terminal device, which has a security element integrated therein. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of the terminal device where it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, as shown in Figure 5, it is a hardware structure diagram of the terminal device where the digital certificate application device of this specification is located. In addition to the processor, memory, network interface, and non-volatile memory shown in Figure 5, the terminal device where the device is located in the embodiment can generally include other hardware according to the actual function of the terminal device, which will not be described in detail.

图6是本说明书一示例性实施例示出的一种数字证书申请装置的框图。FIG6 is a block diagram of a digital certificate application device shown in an exemplary embodiment of this specification.

请参考图6,所述数字证书申请装置500可以应用在前述图5所示的终端设备中,包括:请求发送单元501、信息下发单元502以及数据发送单元503。Please refer to FIG. 6 , the digital certificate application apparatus 500 may be applied to the terminal device shown in FIG. 5 , and includes a request sending unit 501 , an information sending unit 502 , and a data sending unit 503 .

其中,请求发送单元501,向服务端发送数字证书申请请求,以供服务端根据该申请请求生成申请信息,并将该申请信息返回,所述申请信息包括:与所述申请请求唯一对应的申请标识;The request sending unit 501 sends a digital certificate application request to the server, so that the server generates application information according to the application request and returns the application information, wherein the application information includes: an application identifier uniquely corresponding to the application request;

信息下发单元502,将服务端返回的所述申请信息下发给安全元件,以供安全元件根据非对称算法生成公私钥对,采用私钥对所述申请标识进行签名,得到终端签名数据,并将该终端签名数据和公钥封装为指定格式后返回;The information sending unit 502 sends the application information returned by the server to the secure element, so that the secure element generates a public-private key pair according to an asymmetric algorithm, signs the application identifier with the private key to obtain terminal signature data, and encapsulates the terminal signature data and the public key into a specified format before returning the result.

数据发送单元503,将该指定格式数据发送给服务端,以供服务端在根据所述公钥确定所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、登录用户信息以及证书使用信息发送给CA。The data sending unit 503 sends the specified format data to the server, so that the server can send the public key, the terminal signature data, the login user information and the certificate usage information to the CA after determining that the terminal signature data has passed the verification based on the public key and the application identifier has also passed the verification.

可选的,所述申请信息中还包括:非对称算法信息以及签名算法信息;Optionally, the application information also includes: asymmetric algorithm information and signature algorithm information;

所述安全元件根据非对称算法生成公私钥对,并采用私钥对该申请标识进行签名,得到终端签名数据,包括:The security element generates a public-private key pair according to an asymmetric algorithm, and uses the private key to sign the application identifier to obtain terminal signature data, including:

所述安全元件根据所述申请信息中的非对称算法信息生成公私钥对,采用所述申请信息中的签名算法信息计算密钥长度和所述申请标识的摘要,并采用私钥对该摘要进行签名,得到终端签名数据。The security element generates a public-private key pair according to the asymmetric algorithm information in the application information, calculates the key length and the digest of the application identifier using the signature algorithm information in the application information, and signs the digest using the private key to obtain terminal signature data.

可选的,所述指定格式为TLV格式。Optionally, the specified format is TLV format.

与前述图2所示的数字证书申请方法的实施例相对应,本说明书还提供了数字证书申请装置的实施例。Corresponding to the embodiment of the digital certificate application method shown in FIG. 2 , this specification also provides an embodiment of a digital certificate application device.

本说明书数字证书申请装置的实施例可以应用在服务器上,装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在服务器的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图7所示,为本说明书数字证书申请装置所在服务器的一种硬件结构图,除了图7所示的处理器、内存、网络接口、以及非易失性存储器之外,实施例中装置所在的服务器通常根据该服务器的实际功能,还可以包括其他硬件,对此不再赘述。The embodiments of the digital certificate application device of this specification can be applied on a server, and the device embodiments can be implemented by software, hardware, or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of the server where it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, as shown in Figure 7, it is a hardware structure diagram of the server where the digital certificate application device of this specification is located. In addition to the processor, memory, network interface, and non-volatile memory shown in Figure 7, the server where the device is located in the embodiment can usually include other hardware according to the actual function of the server, which will not be described in detail.

图8是本说明书一示例性实施例示出的一种数字证书申请装置的框图。FIG8 is a block diagram of a digital certificate application device shown in an exemplary embodiment of this specification.

请参考图8,所述数字证书申请装置700可以应用在前述图7所示的服务器中,包括:信息生成单元701、数据接收单元702、数据验证单元703以及证书申请单元704。8 , the digital certificate application device 700 may be applied in the server shown in FIG. 7 , and includes an information generation unit 701 , a data receiving unit 702 , a data verification unit 703 , and a certificate application unit 704 .

其中,信息生成单元701,在接收到客户端发送的数字证书申请请求后,生成申请信息,并将该申请信息发送给客户端和CA,所述申请信息包括:与该申请请求唯一对应的申请标识;The information generating unit 701 generates application information after receiving the digital certificate application request sent by the client, and sends the application information to the client and the CA. The application information includes: an application identifier uniquely corresponding to the application request;

数据接收单元702,接收客户端发送的指定格式数据,所述指定格式数据由安全元件在生成公私钥对后,采用私钥对所述申请标识进行签名,得到终端签名数据,并对该终端签名数据和公钥封装而成;The data receiving unit 702 receives data in a specified format sent by the client. After the security element generates a public-private key pair, the security element uses the private key to sign the application identifier to obtain terminal signature data, and then encapsulates the terminal signature data and the public key.

数据验证单元703,解析所述指定格式数据,并根据所述公钥验证所述终端签名数据,得到终端签名数据中的申请标识;The data verification unit 703 parses the specified format data and verifies the terminal signature data according to the public key to obtain the application identifier in the terminal signature data;

证书申请单元704,当所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、所述客户端的登录用户信息以及证书使用信息发送给CA,以供CA在确定所述终端签名数据通过验证、且所述申请标识通过验证后,生成数字证书。The certificate application unit 704 sends the public key, the terminal signature data, the client's login user information and the certificate usage information to the CA when the terminal signature data passes the verification and the application identifier also passes the verification, so that the CA can generate a digital certificate after determining that the terminal signature data passes the verification and the application identifier passes the verification.

可选的,所述申请信息中还包括:非对称算法信息以及签名算法信息,用于供安全元件生成公私钥对并进行签名。Optionally, the application information also includes: asymmetric algorithm information and signature algorithm information, which are used for the security element to generate a public-private key pair and sign.

可选的,所述公钥被服务端封装为PKCS1格式。Optionally, the public key is encapsulated into PKCS1 format by the server.

可选的,所述证书申请单元704,还当所述终端签名数据通过验证,且所述申请标识也通过验证后,将服务端签名数据发送给CA,以供CA进行验证;Optionally, the certificate application unit 704 further sends the server signature data to the CA for verification when the terminal signature data passes verification and the application identifier also passes verification;

其中,所述服务端签名数据由服务端采用服务端私钥对服务端信息签名后生成。The server signature data is generated by the server using the server private key to sign the server information.

上述装置中各个单元的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本说明书方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying any creative work.

上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email transceiver, game console, tablet computer, wearable device, or any combination of these devices.

与前述图1所示的数字证书申请方法的实施例相对应,本说明书还提供一种数字证书申请装置,该数字证书申请装置包括:安全元件、处理器以及用于存储机器可执行指令的存储器。其中,处理器和存储器通常借由内部总线相互连接。在其他可能的实现方式中,所述设备还可能包括外部接口,以能够与其他设备或者部件进行通信。Corresponding to the embodiment of the digital certificate application method shown in FIG1 , this specification also provides a digital certificate application device, comprising: a secure element, a processor, and a memory for storing machine-executable instructions. The processor and memory are typically interconnected via an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.

在本实施例中,通过读取并执行所述存储器存储的与数字证书申请逻辑对应的机器可执行指令,所述处理器被促使:In this embodiment, by reading and executing the machine executable instructions corresponding to the digital certificate application logic stored in the memory, the processor is prompted to:

向服务端发送数字证书申请请求,以供服务端根据该申请请求生成申请信息,并将该申请信息返回,所述申请信息包括:与所述申请请求唯一对应的申请标识;Sending a digital certificate application request to the server, so that the server generates application information according to the application request and returns the application information, wherein the application information includes: an application identifier uniquely corresponding to the application request;

将服务端返回的所述申请信息下发给安全元件,以供安全元件根据非对称算法生成公私钥对,采用私钥对所述申请标识进行签名,得到终端签名数据,并将该终端签名数据和公钥封装为指定格式后返回;Sending the application information returned by the server to the secure element, so that the secure element generates a public-private key pair according to an asymmetric algorithm, signs the application identifier with the private key to obtain terminal signature data, and encapsulates the terminal signature data and the public key into a specified format before returning the result;

将该指定格式数据发送给服务端,以供服务端在根据所述公钥确定所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、登录用户信息以及证书使用信息发送给CA。The specified format data is sent to the server, so that after the server determines that the terminal signature data has passed the verification based on the public key and the application identifier has also passed the verification, the server sends the public key, the terminal signature data, the login user information and the certificate usage information to the CA.

与前述图2所示的数字证书申请方法的实施例相对应,本说明书还提供一种数字证书申请装置,该数字证书申请装置包括:处理器以及用于存储机器可执行指令的存储器。其中,处理器和存储器通常借由内部总线相互连接。在其他可能的实现方式中,所述设备还可能包括外部接口,以能够与其他设备或者部件进行通信。Corresponding to the embodiment of the digital certificate application method shown in FIG2 , this specification also provides a digital certificate application device, comprising a processor and a memory for storing machine-executable instructions. The processor and memory are typically interconnected via an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.

在本实施例中,通过读取并执行所述存储器存储的与数字证书申请逻辑对应的机器可执行指令,所述处理器被促使:In this embodiment, by reading and executing the machine executable instructions corresponding to the digital certificate application logic stored in the memory, the processor is prompted to:

在接收到客户端发送的数字证书申请请求后,生成申请信息,并将该申请信息发送给客户端和CA,所述申请信息包括:与该申请请求唯一对应的申请标识;After receiving the digital certificate application request from the client, generate application information and send the application information to the client and CA, the application information including: an application identifier uniquely corresponding to the application request;

接收客户端发送的指定格式数据,所述指定格式数据由安全元件在生成公私钥对后,采用私钥对所述申请标识进行签名,得到终端签名数据,并对该终端签名数据和公钥封装而成;Receiving data in a specified format sent by a client, wherein the security element generates a public-private key pair, signs the application identifier using the private key to obtain terminal signature data, and encapsulates the terminal signature data and the public key;

解析所述指定格式数据,并根据所述公钥验证所述终端签名数据,得到终端签名数据中的申请标识;Parsing the specified format data, and verifying the terminal signature data according to the public key to obtain the application identifier in the terminal signature data;

当所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、所述客户端的登录用户信息以及证书使用信息发送给CA,以供CA在确定所述终端签名数据通过验证、且所述申请标识通过验证后,生成数字证书。When the terminal signature data passes verification and the application identifier also passes verification, the public key, the terminal signature data, the client's login user information and the certificate usage information are sent to the CA, so that the CA can generate a digital certificate after determining that the terminal signature data passes verification and the application identifier passes verification.

与前述图1所示的数字证书申请方法的实施例相对应,本说明书还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,该程序被处理器执行时实现以下步骤:Corresponding to the embodiment of the digital certificate application method shown in FIG1 , this specification further provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the following steps are implemented:

向服务端发送数字证书申请请求,以供服务端根据该申请请求生成申请信息,并将该申请信息返回,所述申请信息包括:与所述申请请求唯一对应的申请标识;Sending a digital certificate application request to the server, so that the server generates application information according to the application request and returns the application information, wherein the application information includes: an application identifier uniquely corresponding to the application request;

将服务端返回的所述申请信息下发给安全元件,以供安全元件根据非对称算法生成公私钥对,采用私钥对所述申请标识进行签名,得到终端签名数据,并将该终端签名数据和公钥封装为指定格式后返回;Sending the application information returned by the server to the secure element, so that the secure element generates a public-private key pair according to an asymmetric algorithm, signs the application identifier with the private key to obtain terminal signature data, and encapsulates the terminal signature data and the public key into a specified format before returning the result;

将该指定格式数据发送给服务端,以供服务端在根据所述公钥确定所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、登录用户信息以及证书使用信息发送给CA。The specified format data is sent to the server, so that after the server determines that the terminal signature data has passed the verification based on the public key and the application identifier has also passed the verification, the server sends the public key, the terminal signature data, the login user information and the certificate usage information to the CA.

与前述图2所示的数字证书申请方法的实施例相对应,本说明书还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,该程序被处理器执行时实现以下步骤:Corresponding to the embodiment of the digital certificate application method shown in FIG2 , this specification further provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the following steps are implemented:

在接收到客户端发送的数字证书申请请求后,生成申请信息,并将该申请信息发送给客户端和CA,所述申请信息包括:与该申请请求唯一对应的申请标识;After receiving the digital certificate application request from the client, generate application information and send the application information to the client and CA, the application information including: an application identifier uniquely corresponding to the application request;

接收客户端发送的指定格式数据,所述指定格式数据由安全元件在生成公私钥对后,采用私钥对所述申请标识进行签名,得到终端签名数据,并对该终端签名数据和公钥封装而成;Receiving data in a specified format sent by a client, wherein the security element generates a public-private key pair, signs the application identifier using the private key to obtain terminal signature data, and encapsulates the terminal signature data and the public key;

解析所述指定格式数据,并根据所述公钥验证所述终端签名数据,得到终端签名数据中的申请标识;Parsing the specified format data, and verifying the terminal signature data according to the public key to obtain the application identifier in the terminal signature data;

当所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、所述客户端的登录用户信息以及证书使用信息发送给CA,以供CA在确定所述终端签名数据通过验证、且所述申请标识通过验证后,生成数字证书。When the terminal signature data passes verification and the application identifier also passes verification, the public key, the terminal signature data, the client's login user information and the certificate usage information are sent to the CA, so that the CA can generate a digital certificate after determining that the terminal signature data passes verification and the application identifier passes verification.

上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

以上所述仅为本说明书的较佳实施例而已,并不用以限制本说明书,凡在本说明书的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书保护的范围之内。The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

Claims (16)

1.一种数字证书申请方法,应用于终端设备,所述终端设备集成有安全元件,并装载有客户端软件,该方法包括:1. A digital certificate application method, applied to a terminal device, said terminal device integrating a security element and loading client software, the method comprising: 客户端向服务端发送数字证书申请请求,以供服务端根据该申请请求生成申请信息,并将该申请信息返回给客户端,所述申请信息包括:与所述申请请求唯一对应的申请标识;The client sends a digital certificate application request to the server, so that the server can generate application information based on the application request and return the application information to the client. The application information includes: an application identifier that uniquely corresponds to the application request; 客户端将服务端返回的所述申请信息下发给安全元件;The client sends the application information returned by the server to the secure element; 安全元件根据非对称算法生成公私钥对,采用私钥对所述申请标识进行签名,得到终端签名数据,并将该终端签名数据和公钥封装为指定格式后发送给客户端;The secure element generates a public-private key pair based on an asymmetric algorithm, signs the application identifier with the private key to obtain terminal signature data, and encapsulates the terminal signature data and the public key into a specified format before sending it to the client. 客户端将该指定格式数据发送给服务端,以供服务端在根据所述公钥确定所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、所述客户端的登录用户信息以及证书使用信息发送给CA。The client sends the specified formatted data to the server, so that the server, after verifying the terminal signature data and the application identifier based on the public key, can send the public key, the terminal signature data, the client's login user information, and certificate usage information to the CA. 2.根据权利要求1所述的方法,2. The method according to claim 1, 所述申请信息中还包括:非对称算法信息以及签名算法信息;The application information also includes: asymmetric algorithm information and signature algorithm information; 所述安全元件根据非对称算法生成公私钥对,并采用私钥对该申请标识进行签名,得到终端签名数据,包括:The secure element generates a public-private key pair according to an asymmetric algorithm, and uses the private key to sign the application identifier to obtain terminal signature data, including: 所述安全元件根据所述申请信息中的非对称算法信息生成公私钥对,采用所述申请信息中的签名算法信息计算密钥长度和所述申请标识的摘要,并采用私钥对该摘要进行签名,得到终端签名数据。The secure element generates a public-private key pair based on the asymmetric algorithm information in the application information, calculates the key length and the digest of the application identifier using the signature algorithm information in the application information, and signs the digest using the private key to obtain terminal signature data. 3.根据权利要求1所述的方法,3. The method according to claim 1, 所述指定格式为TLV格式。The specified format is TLV format. 4.一种数字证书申请方法,应用于服务端,所述服务端用于与终端设备中装载的客户端软件交互,所述终端设备还集成有安全元件,该方法包括:4. A digital certificate application method, applied to a server, the server being used to interact with client software installed in a terminal device, the terminal device further integrating a security element, the method comprising: 在接收到客户端发送的数字证书申请请求后,生成申请信息,并将该申请信息发送给客户端和CA,所述申请信息包括:与该申请请求唯一对应的申请标识;After receiving a digital certificate application request from the client, the system generates application information and sends the application information to the client and the CA. The application information includes an application identifier that uniquely corresponds to the application request. 接收客户端发送的指定格式数据,所述指定格式数据由安全元件在生成公私钥对后,采用私钥对所述申请标识进行签名,得到终端签名数据,并对该终端签名数据和公钥封装而成;The system receives data in a specified format sent by the client. This specified format data is generated by the security element, which uses the private key to sign the application identifier after generating a public-private key pair, to obtain terminal signature data. The terminal signature data and the public key are then encapsulated together. 解析所述指定格式数据,并根据所述公钥验证所述终端签名数据,得到终端签名数据中的申请标识;Parse the specified format data and verify the terminal signature data according to the public key to obtain the application identifier in the terminal signature data; 当所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、所述客户端的登录用户信息以及证书使用信息发送给CA,以供CA在确定所述终端签名数据通过验证、且所述申请标识通过验证后,生成数字证书。Once the terminal signature data and the application identifier are verified, the public key, the terminal signature data, the client's login user information, and the certificate usage information are sent to the CA, so that the CA can generate a digital certificate after confirming that the terminal signature data and the application identifier have been verified. 5.根据权利要求4所述的方法,5. The method according to claim 4, 所述申请信息中还包括:非对称算法信息以及签名算法信息,用于供安全元件生成公私钥对并进行签名。The application information also includes: asymmetric algorithm information and signature algorithm information, which are used by the security element to generate public-private key pairs and perform signatures. 6.根据权利要求4所述的方法,6. The method according to claim 4, 所述公钥被服务端封装为PKCS1格式。The public key is encapsulated in PKCS1 format by the server. 7.根据权利要求4所述的方法,还包括:7. The method according to claim 4, further comprising: 当所述终端签名数据通过验证,且所述申请标识也通过验证后,将服务端签名数据发送给CA,以供CA进行验证;Once the terminal signature data is verified and the application identifier is also verified, the server signature data is sent to the CA for verification by the CA. 其中,所述服务端签名数据由服务端采用服务端私钥对服务端信息签名后生成。The server-side signature data is generated by the server signing the server-side information using the server-side private key. 8.一种数字证书申请装置,应用于终端设备,所述终端设备还集成有安全元件,该装置包括:8. A digital certificate application device, applied to a terminal device, the terminal device further integrating a security element, the device comprising: 请求发送单元,向服务端发送数字证书申请请求,以供服务端根据该申请请求生成申请信息,并将该申请信息返回,所述申请信息包括:与所述申请请求唯一对应的申请标识;The request sending unit sends a digital certificate application request to the server, so that the server can generate application information based on the application request and return the application information. The application information includes: an application identifier that uniquely corresponds to the application request. 信息下发单元,将服务端返回的所述申请信息下发给安全元件,以供安全元件根据非对称算法生成公私钥对,采用私钥对所述申请标识进行签名,得到终端签名数据,并将该终端签名数据和公钥封装为指定格式后返回;The information distribution unit distributes the application information returned by the server to the security element, so that the security element can generate a public-private key pair according to the asymmetric algorithm, sign the application identifier with the private key to obtain terminal signature data, and encapsulate the terminal signature data and the public key into a specified format and return it. 数据发送单元,将该指定格式数据发送给服务端,以供服务端在根据所述公钥确定所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、登录用户信息以及证书使用信息发送给CA。The data sending unit sends the specified format data to the server, so that after the server determines that the terminal signature data has been verified based on the public key and the application identifier has also been verified, it sends the public key, the terminal signature data, the login user information, and the certificate usage information to the CA. 9.根据权利要求8所述的装置,9. The apparatus according to claim 8, 所述申请信息中还包括:非对称算法信息以及签名算法信息;The application information also includes: asymmetric algorithm information and signature algorithm information; 所述安全元件根据非对称算法生成公私钥对,并采用私钥对该申请标识进行签名,得到终端签名数据,包括:The secure element generates a public-private key pair according to an asymmetric algorithm, and uses the private key to sign the application identifier to obtain terminal signature data, including: 所述安全元件根据所述申请信息中的非对称算法信息生成公私钥对,采用所述申请信息中的签名算法信息计算密钥长度和所述申请标识的摘要,并采用私钥对该摘要进行签名,得到终端签名数据。The secure element generates a public-private key pair based on the asymmetric algorithm information in the application information, calculates the key length and the digest of the application identifier using the signature algorithm information in the application information, and signs the digest using the private key to obtain terminal signature data. 10.根据权利要求8所述的装置,10. The apparatus according to claim 8, 所述指定格式为TLV格式。The specified format is TLV format. 11.一种数字证书申请装置,应用于服务端,所述装置用于与终端设备中装载的客户端软件交互,所述终端设备还集成有安全元件,该装置包括:11. A digital certificate application device, applied on a server side, the device being used to interact with client software installed in a terminal device, the terminal device further integrating a security element, the device comprising: 信息生成单元,在接收到客户端发送的数字证书申请请求后,生成申请信息,并将该申请信息发送给客户端和CA,所述申请信息包括:与该申请请求唯一对应的申请标识;The information generation unit generates application information after receiving a digital certificate application request from the client, and sends the application information to the client and the CA. The application information includes an application identifier that uniquely corresponds to the application request. 数据接收单元,接收客户端发送的指定格式数据,所述指定格式数据由安全元件在生成公私钥对后,采用私钥对所述申请标识进行签名,得到终端签名数据,并对该终端签名数据和公钥封装而成;The data receiving unit receives data in a specified format sent by the client. The specified format data is generated by the security element after generating a public-private key pair, and the application identifier is signed with the private key to obtain terminal signature data. The terminal signature data and the public key are then encapsulated together. 数据验证单元,解析所述指定格式数据,并根据所述公钥验证所述终端签名数据,得到终端签名数据中的申请标识;The data verification unit parses the specified format data and verifies the terminal signature data according to the public key to obtain the application identifier in the terminal signature data; 证书申请单元,当所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、所述客户端的登录用户信息以及证书使用信息发送给CA,以供CA在确定所述终端签名数据通过验证、且所述申请标识通过验证后,生成数字证书。The certificate application unit sends the public key, the terminal signature data, the client's login user information, and certificate usage information to the CA after the terminal signature data and the application identifier have been verified. The CA then generates a digital certificate after confirming that the terminal signature data and the application identifier have been verified. 12.根据权利要求11所述的装置,12. The apparatus according to claim 11, 所述申请信息中还包括:非对称算法信息以及签名算法信息,用于供安全元件生成公私钥对并进行签名。The application information also includes: asymmetric algorithm information and signature algorithm information, which are used by the security element to generate public-private key pairs and perform signatures. 13.根据权利要求11所述的装置,13. The apparatus according to claim 11, 所述公钥被服务端封装为PKCS1格式。The public key is encapsulated in PKCS1 format by the server. 14.根据权利要求11所述的装置,14. The apparatus according to claim 11, 所述证书申请单元,还当所述终端签名数据通过验证,且所述申请标识也通过验证后,将服务端签名数据发送给CA,以供CA进行验证;The certificate application unit also sends the server-side signature data to the CA for verification after the terminal signature data and the application identifier have been verified. 其中,所述服务端签名数据由服务端采用服务端私钥对服务端信息签名后生成。The server-side signature data is generated by the server signing the server-side information using the server-side private key. 15.一种数字证书申请装置,应用于终端设备,该装置包括:15. A digital certificate application device, applied to a terminal device, the device comprising: 安全元件;Safety components; 处理器;processor; 用于存储机器可执行指令的存储器;Memory used to store machine-executable instructions; 其中,通过读取并执行所述存储器存储的与数字证书申请逻辑对应的机器可执行指令,所述处理器被促使:Specifically, the processor is prompted to: read and execute the machine-executable instructions stored in the memory corresponding to the digital certificate application logic. 向服务端发送数字证书申请请求,以供服务端根据该申请请求生成申请信息,并将该申请信息返回,所述申请信息包括:与所述申请请求唯一对应的申请标识;Send a digital certificate application request to the server so that the server can generate application information based on the application request and return the application information, wherein the application information includes: an application identifier that uniquely corresponds to the application request; 将服务端返回的所述申请信息下发给安全元件,以供安全元件根据非对称算法生成公私钥对,采用私钥对所述申请标识进行签名,得到终端签名数据,并将该终端签名数据和公钥封装为指定格式后返回;The application information returned by the server is sent to the security element, which generates a public-private key pair according to an asymmetric algorithm, signs the application identifier with the private key to obtain terminal signature data, and encapsulates the terminal signature data and the public key into a specified format and returns it. 将该指定格式数据发送给服务端,以供服务端在根据所述公钥确定所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、登录用户信息以及证书使用信息发送给CA。The specified format data is sent to the server so that, after the server determines that the terminal signature data has been verified based on the public key and the application identifier has also been verified, it can send the public key, the terminal signature data, the login user information, and the certificate usage information to the CA. 16.一种数字证书申请装置,应用于服务器,该装置包括:16. A digital certificate application device, applied to a server, the device comprising: 处理器;processor; 用于存储机器可执行指令的存储器;Memory used to store machine-executable instructions; 其中,通过读取并执行所述存储器存储的与数字证书申请逻辑对应的机器可执行指令,所述处理器被促使:Specifically, the processor is prompted to: read and execute the machine-executable instructions stored in the memory corresponding to the digital certificate application logic. 在接收到客户端发送的数字证书申请请求后,生成申请信息,并将该申请信息发送给客户端和CA,所述申请信息包括:与该申请请求唯一对应的申请标识;After receiving a digital certificate application request from the client, the system generates application information and sends the application information to the client and the CA. The application information includes an application identifier that uniquely corresponds to the application request. 接收客户端发送的指定格式数据,所述指定格式数据由安全元件在生成公私钥对后,采用私钥对所述申请标识进行签名,得到终端签名数据,并对该终端签名数据和公钥封装而成;The system receives data in a specified format sent by the client. This specified format data is generated by the security element, which uses the private key to sign the application identifier after generating a public-private key pair, to obtain terminal signature data. The terminal signature data and the public key are then encapsulated together. 解析所述指定格式数据,并根据所述公钥验证所述终端签名数据,得到终端签名数据中的申请标识;Parse the specified format data and verify the terminal signature data according to the public key to obtain the application identifier in the terminal signature data; 当所述终端签名数据通过验证,且所述申请标识也通过验证后,将所述公钥、所述终端签名数据、所述客户端的登录用户信息以及证书使用信息发送给CA,以供CA在确定所述终端签名数据通过验证、且所述申请标识通过验证后,生成数字证书。Once the terminal signature data and the application identifier are verified, the public key, the terminal signature data, the client's login user information, and the certificate usage information are sent to the CA, so that the CA can generate a digital certificate after confirming that the terminal signature data and the application identifier have been verified.
HK18108073.3A 2018-06-22 Digital certificate applying method and device HK1249295B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
HK18108073.3A HK1249295B (en) 2018-06-22 Digital certificate applying method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
HK18108073.3A HK1249295B (en) 2018-06-22 Digital certificate applying method and device

Publications (2)

Publication Number Publication Date
HK1249295A1 HK1249295A1 (en) 2018-10-26
HK1249295B true HK1249295B (en) 2021-04-01

Family

ID=

Similar Documents

Publication Publication Date Title
TWI696931B (en) Digital certificate application method and device
CN112671720B (en) Token construction method, device and equipment for cloud platform resource access control
US11716206B2 (en) Certificate based security using post quantum cryptography
EP3484125B1 (en) Method and device for scheduling interface of hybrid cloud
CN106101258B (en) Interface calling method, device and system of hybrid cloud
CN107493291B (en) Identity authentication method and device based on Secure Element (SE)
CN110177124B (en) Identity authentication method based on block chain and related equipment
CN107888656A (en) Service the call method and calling device of end interface
CN111241492A (en) Product multi-tenant secure credit granting method, system and electronic equipment
CN114282193A (en) Application authorization method, device, device and storage medium
WO2014206171A1 (en) Public key cryptography processing method, device and system
CN110866265A (en) Data storage method, device and storage medium based on block chain
CN110851851B (en) Authority management method, device and equipment in block chain type account book
CN114565378B (en) NFT ownership transfer method, computer device and storage medium
CN113656497A (en) A blockchain-based data verification method and device
CN111628863A (en) Data signature method and device, electronic equipment and storage medium
CN109818915B (en) Information processing method and device, server and readable storage medium
CN110889146A (en) Electronic signature method, device and storage medium
Chen et al. Practical cloud storage auditing using serverless computing
CN109710692B (en) A method, device and storage medium for processing user information in a blockchain network
KR101946620B1 (en) Method and server for generating a block of data comprising signature of the server
HK1249295B (en) Digital certificate applying method and device
CN113806798B (en) A method, system, device and medium for client authentication
CN112242901A (en) Service verification method, device, device and computer storage medium
CN111292082B (en) Public key management method, device and equipment in block chain type account book