WO2019178763A1 - Certificate importing method and terminal - Google Patents

Certificate importing method and terminal Download PDF

Info

Publication number
WO2019178763A1
WO2019178763A1 PCT/CN2018/079746 CN2018079746W WO2019178763A1 WO 2019178763 A1 WO2019178763 A1 WO 2019178763A1 CN 2018079746 W CN2018079746 W CN 2018079746W WO 2019178763 A1 WO2019178763 A1 WO 2019178763A1
Authority
WO
WIPO (PCT)
Prior art keywords
certificate
verification
key
executable file
database
Prior art date
Application number
PCT/CN2018/079746
Other languages
French (fr)
Chinese (zh)
Inventor
王明伟
徐永标
Original Assignee
福建联迪商用设备有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 福建联迪商用设备有限公司 filed Critical 福建联迪商用设备有限公司
Priority to PCT/CN2018/079746 priority Critical patent/WO2019178763A1/en
Priority to CN201880000201.8A priority patent/CN108496323B/en
Publication of WO2019178763A1 publication Critical patent/WO2019178763A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/33User authentication using certificates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3263Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3263Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
    • H04L9/3268Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements using certificate validation, registration, distribution or revocation, e.g. certificate revocation list [CRL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Definitions

  • the present invention relates to the field of information security, and in particular, to a certificate importing method and a terminal.
  • the payment terminal certificate can be used as the identity certificate of the terminal to realize the identity authentication with the interactive background.
  • the background key download service front-end can use the certificate to download the terminal master key.
  • X.509 certificates are the basis for trust between the two parties to authenticate each other.
  • the certificate itself has integrity verification, if the system or terminal is not properly stored and kept, the root certificate or certificate chain is replaced, or the attacker inserts a malicious root certificate and certificate chain, the trust building established by the certificate is at risk. It is.
  • the X.509 certificate authentication system is used for identity authentication.
  • the X.509 certificate in the key management system is important data, which is the key to ensuring the reliability of the authentication system. Any unintentional modification or malicious attack may result in the whole process.
  • the remote key distribution system is at risk, threatening the security of the distribution key.
  • Method 1 The certificate is directly stored in the database or the file system in text form.
  • the text file of the certificate file configuration can be modified at will, and the certificate can be added or deleted; if the attacker accesses it.
  • the database or file that stores the certificate so the attacker can easily add, delete, and modify the certificate and certificate chain in the system.
  • Method 2 Use a special physical device to store certificates, such as the U shield used to verify the identity of the client in the banking system. This approach is not suitable for system-side certificate storage, and hardware-based storage methods add additional cost.
  • the technical problem to be solved by the present invention is how to improve the validity of the certificate without increasing the hardware cost.
  • the technical solution adopted by the present invention is:
  • the invention provides a certificate importing method, comprising:
  • the executable file When receiving a write database request corresponding to a certificate, the executable file acquires a public key corresponding to the root certificate;
  • the executable file verifies the digital signature of the certificate according to the public key, and obtains a verification result; the verification result includes a verification pass and a verification fails;
  • the executable file writes the certificate and the certificate chain corresponding to the one certificate to a database.
  • the present invention also provides a certificate import terminal comprising one or more processors and a memory, the memory storing a program, and being configured to perform the following steps by the one or more processors:
  • the executable file When receiving a write database request corresponding to a certificate, the executable file acquires a public key corresponding to the root certificate;
  • the executable file verifies the digital signature of the certificate according to the public key, and obtains a verification result; the verification result includes a verification pass and a verification fails;
  • the executable file writes the certificate and the certificate chain corresponding to the one certificate to a database.
  • the invention has the beneficial effects that the present invention compiles the root certificate into the executable file at compile time by compiling the root certificate for verifying the validity of the certificate to be imported, so the executable file is run. There is no way to replace, modify, or add information about the root certificate during the process.
  • When receiving an import request for a certificate it must first use the root certificate to digitally verify it. Only valid certificates can be successfully imported into the database, and the criminal cannot modify the root certificate stored in the database. Unable to successfully import a malicious certificate to the database.
  • the implementation effectively improves the validity of the certificate stored in the database without increasing the hardware cost.
  • FIG. 1 is a flow chart of a specific implementation manner of a certificate importing method provided by the present invention
  • FIG. 2 is a structural block diagram of a specific implementation manner of a certificate importing terminal provided by the present invention
  • the most critical technical idea of the present invention is that the present invention compiles the root certificate for verifying the validity of the certificate to be imported into the executable file, so that no method can be replaced, modified or added during the execution of the executable file.
  • the information of the root certificate thereby effectively improving the validity of the certificate stored in the database without increasing the hardware cost.
  • FIG. 1 and FIG. 2 Please refer to FIG. 1 and FIG. 2,
  • the present invention provides a certificate importing method, including:
  • the executable file When receiving a write database request corresponding to a certificate, the executable file acquires a public key corresponding to the root certificate;
  • the executable file verifies the digital signature of the certificate according to the public key, and obtains a verification result; the verification result includes a verification pass and a verification fails;
  • the executable file writes the certificate and the certificate chain corresponding to the one certificate to a database.
  • the certificate writing function of the executable file is activated when the identity information is authenticated; the certificate writing function is configured to receive a write database request corresponding to a certificate.
  • the key is distributed according to the one certificate.
  • the MAC operation is performed using the X9.19 algorithm.
  • the data to be verified includes a time for writing the certificate, the certificate, and the certificate chain.
  • the verification key is injected into the hardware security module.
  • the present invention designs the root certificate as a constant of the executable file, and when the executable file is compiled, it has been loaded into the system application, so that the illegal element cannot tamper with the root certificate during the execution of the executable program.
  • the information improves the reliability of the validity verification of the certificate to be imported, thereby improving the validity of the certificate stored in the database.
  • the present invention further provides a certificate import terminal including one or more processors 1 and a memory 2, the memory 2 storing a program and configured to be configured by the one or more processors 1 Perform the following steps:
  • the executable file When receiving a write database request corresponding to a certificate, the executable file acquires a public key corresponding to the root certificate;
  • the executable file verifies the digital signature of the certificate according to the public key, and obtains a verification result; the verification result includes a verification pass and a verification fails;
  • the executable file writes the certificate and the certificate chain corresponding to the one certificate to a database.
  • the certificate writing function of the executable file is activated when the identity information is authenticated; the certificate writing function is configured to receive a write database request corresponding to a certificate.
  • the key is distributed according to the one certificate.
  • the MAC operation is performed using the X9.19 algorithm.
  • the data to be verified includes a time for writing the certificate, the certificate, and the certificate chain.
  • the method further includes:
  • the verification key is injected into the hardware security module.
  • Embodiment 1 of the present invention is:
  • This embodiment provides a certificate importing method, including:
  • the data type of the root certificate is set to be a constant.
  • CA Certificate Authority
  • PKI Public Key Infrastructure
  • the public key in the trusted CA certificate needs to be loaded into the system.
  • the public key of the CA certificate is designed as a constant of the application, and is already loaded into the executable file when the application is compiled.
  • the verification key is a key for calculating the MAC value of the certificate data, and is a key element of the security and integrity guarantee of the certificate data stored in the database. In this embodiment, it is required to verify the password before the system is officially put into use.
  • the key is injected into the HSM (High Security Machine, which is a hardware encryptor in the system) and the authentication key is configured into the system parameters.
  • HSM High Security Machine
  • the executable file When receiving a write database request corresponding to a certificate, the executable file acquires a public key corresponding to the root certificate.
  • the executable file verifies the digital signature of the certificate according to the public key, and obtains a verification result; the verification result includes a verification pass and a verification fails; when the verification result is a verification pass, the executable file may The execution file writes the certificate and the certificate chain corresponding to the one certificate to the database.
  • the X.509 certificate and the certificate chain are imported in an effective manner, and the public key certificate number and other related information are generated; and the digital signature of the imported X.509 certificate is verified by using the trusted root CA certificate public key compiled into the executable file, and Analyze the certificate body information, determine the validity of the public key certificate; write the verified X.509 certificate to the database, and also write the relevant information such as the public key certificate number.
  • S6 Acquire the verification key; obtain data to be verified according to the one certificate and the certificate chain; the data to be verified includes the certificate, the certificate chain, importing the certificate, and the certificate The time of the chain and the identity information; performing MAC operations on the data to be verified according to the verification key to obtain a first MAC value; and storing the first MAC value to the database.
  • the MAC operation is performed using an X9.19 algorithm.
  • the trusted root CA certificate is compiled into the system application.
  • the public key certificate issued by the legal CA can be verified by the RSA public password mechanism, the public key in the CA certificate is used to verify the legality. Sex, this is indeed feasible and effective.
  • the unique security interface of the public key certificate entering the system is designed, and the trusted root CA certificate data is compiled into the application compiling stage.
  • the lower-level public key certificate imported through the interface must be verified by the root certificate of the trusted root CA certificate.
  • the data is MAC-calculated using the verification key (the verification key is injected into the HSM in advance) and written into the system database.
  • the public key certificate data is obtained from the database, the data is forcibly required to perform MAC verification. Therefore, the validity of the public key certificate used is guaranteed; in addition, the public key certificate is issued by the CA center that meets the security standard, and the security can be guaranteed.
  • the public key certificate meets the security requirements when it is generated, processed, and stored.
  • the data MAC value verification scheme is adopted to ensure the integrity and certifiability of the stored data.
  • the public key certificate data of the verification and its related content are subjected to the MAC operation of the X9.19 algorithm using the verification public key, and are stored as key data in the system database, and the same algorithm is used each time the public key certificate is used.
  • the obtained public key certificate data can be MAC-checked.
  • the data of this embodiment has the characteristics of integrity and certifiability.
  • Embodiment 2 of the present invention is:
  • the embodiment provides a certificate import terminal including one or more processors 1 and a memory 2, the memory 2 storing a program, and being configured to perform the following steps by the one or more processors 1:
  • the data type of the root certificate is set to be a constant.
  • the executable file When receiving a write database request corresponding to a certificate, the executable file acquires a public key corresponding to the root certificate.
  • the executable file verifies the digital signature of the certificate according to the public key, and obtains a verification result; the verification result includes a verification pass and a verification fails; when the verification result is a verification pass, the executable file may The execution file writes the certificate and the certificate chain corresponding to the one certificate to the database.
  • S6 Acquire the verification key; obtain data to be verified according to the one certificate and the certificate chain; the data to be verified includes the certificate, the certificate chain, importing the certificate, and the certificate The time of the chain and the identity information; performing MAC operations on the data to be verified according to the verification key to obtain a first MAC value; and storing the first MAC value to the database.
  • the MAC operation is performed using an X9.19 algorithm.
  • the present invention provides a certificate import method and a terminal, by compiling a root certificate for verifying the validity of a certificate to be imported into an executable file, so that the root certificate is loaded into an executable at compile time.
  • File so there is no way to replace, modify, or add information about the root certificate while the executable is running.
  • When receiving an import request for a certificate it must first use the root certificate to digitally verify it. Only valid certificates can be successfully imported into the database, and the criminal cannot modify the root certificate stored in the database. Unable to successfully import a malicious certificate to the database.
  • the implementation effectively improves the validity of the certificate stored in the database without increasing the hardware cost.
  • the executable program generated by the legal way to compile the link can modify, replace, and add the certificate and certificate chain information, and only the legal operator who performs the authentication can perform the operation of modifying the certificate information, thereby effectively improving the database.
  • the validity of the stored certificate each time the key stored in the database is used for key distribution, the certificate information in the database is forced to be MAC-checked. Therefore, any illegal modification of the certificate can be detected, and the key distribution is improved. safety.
  • the present invention designs the root certificate as a constant of the executable file, and when the executable file is compiled, it is already loaded into the system application, so that the illegal element cannot tamper with the root certificate information during the execution of the executable program. Improves the reliability of certificate validation for imported certificates, thereby increasing the validity of certificates stored in the database.

Abstract

The present invention relates to the field of information security, and in particular to a certificate importing method and a terminal. In the present invention, a preset root certificate is compiled into an executable file. When a database write request corresponding to a certificate is received, the executable file acquires a public key corresponding to the root certificate. The executable file verifies a digital signature of the certificate according to the public key, and obtains a verification result, the verification result comprising one of a verification success and a verification failure. If the verification result is a verification success, the executable file writes the certificate and a certificate chain corresponding to the certificate into a database. The present invention improves the effectiveness of certificates without increasing hardware costs.

Description

一种证书导入方法及终端Certificate importing method and terminal 技术领域Technical field
本发明涉及信息安全领域,尤其涉及一种证书导入方法及终端。The present invention relates to the field of information security, and in particular, to a certificate importing method and a terminal.
背景技术Background technique
随着数字证书技术的广泛使用,越来越多的系统平台和交易终端采用X.509的证书体系来完成安全认证或者敏感数据下载的交易。因为X.509证书自带真实性和完整性验证,因此其应用非常广泛,在电子支付领域,支付终端证书可以作为终端的身份凭证,实现与交互后台的身份认证,此外,支付终端与收单后台的密钥下载业务前置可使用证书来进行终端主密钥的下载。With the widespread use of digital certificate technology, more and more system platforms and transaction terminals use the X.509 certificate system to complete secure authentication or sensitive data download transactions. Because the X.509 certificate comes with authenticity and integrity verification, its application is very extensive. In the field of electronic payment, the payment terminal certificate can be used as the identity certificate of the terminal to realize the identity authentication with the interactive background. In addition, the payment terminal and the receipt The background key download service front-end can use the certificate to download the terminal master key.
X.509证书,特别是根证书和证书链,是交易双方进行相互认证的信任基础。虽然证书本身带有完整性验证,但是系统或终端如果不进行合理存储和保管,根证书或证书链被替换,或者被攻击者插入恶意的根证书及证书链,由证书建立的信任大厦便岌岌可危了。尤其是在一些敏感的应用场景中,比如远程下载金融密钥的密钥管理系统中,如果系统存在该漏洞,极易造成金融机构密钥泄露,由此带来严重的安全事故。采用X.509证书认证体系进行身份认证,密钥管理系统中的X.509证书是重要的数据,其是保证认证体系可靠性的关键,任何无意的修改或是恶意的攻击,都可能导致整个远程密钥分发体系陷于风险之中,威胁到分发密钥的安全性。X.509 certificates, especially the root certificate and certificate chain, are the basis for trust between the two parties to authenticate each other. Although the certificate itself has integrity verification, if the system or terminal is not properly stored and kept, the root certificate or certificate chain is replaced, or the attacker inserts a malicious root certificate and certificate chain, the trust building established by the certificate is at risk. It is. Especially in some sensitive application scenarios, such as a key management system for remotely downloading financial keys, if the system has this vulnerability, it is easy to cause a financial institution key to leak, thereby causing serious security incidents. The X.509 certificate authentication system is used for identity authentication. The X.509 certificate in the key management system is important data, which is the key to ensuring the reliability of the authentication system. Any unintentional modification or malicious attack may result in the whole process. The remote key distribution system is at risk, threatening the security of the distribution key.
当前常见的做法,如下:The current common practices are as follows:
方式1:证书直接以文本形式存储在数据库或者文件系统中,比如使用STUNNEL代理建立安全通信链路时,证书文件配置的文本文件中,可随意修改,增加或删除证书;如果被攻击者访问到了存储证书的数据库或文件,那么攻击者极易添加、删除、修改系统中的证书和证书链。Method 1: The certificate is directly stored in the database or the file system in text form. For example, when the STUNNEL agent is used to establish a secure communication link, the text file of the certificate file configuration can be modified at will, and the certificate can be added or deleted; if the attacker accesses it. The database or file that stores the certificate, so the attacker can easily add, delete, and modify the certificate and certificate chain in the system.
方式2:使用专门的物理设备存储证书,比如银行系统中用于验证客户端身份的U盾。该方式并不适合系统端证书存储,且基于硬件设备的存储方式也会增加额外的成本。Method 2: Use a special physical device to store certificates, such as the U shield used to verify the identity of the client in the banking system. This approach is not suitable for system-side certificate storage, and hardware-based storage methods add additional cost.
技术问题technical problem
本发明所要解决的技术问题是:如何在不增加硬件成本的前提下提高证书的有效性。The technical problem to be solved by the present invention is how to improve the validity of the certificate without increasing the hardware cost.
技术解决方案Technical solution
为了解决上述技术问题,本发明采用的技术方案为:In order to solve the above technical problems, the technical solution adopted by the present invention is:
本发明提供一种证书导入方法,包括:The invention provides a certificate importing method, comprising:
S1、编译预设的根证书至可执行文件;S1, compiling the preset root certificate to the executable file;
S2、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥;S2. When receiving a write database request corresponding to a certificate, the executable file acquires a public key corresponding to the root certificate;
S3、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;S3. The executable file verifies the digital signature of the certificate according to the public key, and obtains a verification result; the verification result includes a verification pass and a verification fails;
S4、当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。S4. When the verification result is verification pass, the executable file writes the certificate and the certificate chain corresponding to the one certificate to a database.
本发明还提供一种证书导入终端,包括一个或多个处理器及存储器,所述存储器存储有程序,并且被配置成由所述一个或多个处理器执行以下步骤:The present invention also provides a certificate import terminal comprising one or more processors and a memory, the memory storing a program, and being configured to perform the following steps by the one or more processors:
S1、编译预设的根证书至可执行文件;S1, compiling the preset root certificate to the executable file;
S2、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥;S2. When receiving a write database request corresponding to a certificate, the executable file acquires a public key corresponding to the root certificate;
S3、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;S3. The executable file verifies the digital signature of the certificate according to the public key, and obtains a verification result; the verification result includes a verification pass and a verification fails;
S4、当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。S4. When the verification result is verification pass, the executable file writes the certificate and the certificate chain corresponding to the one certificate to a database.
有益效果Beneficial effect
本发明的有益效果在于:本发明通过将用于验证待导入的证书有效性的根证书编译至可执行文件中,使得在编译时即将根证书载入到可执行文件,因此在可执行文件运行过程中,没有任何方法可以替换、修改或增加根证书的信息。在接收到一证书的导入请求时,需先使用根证书对其进行数字签名验证,只有有效的证书才可被成功导入到数据库中,不法分子无法对数据库中存储的根证书进行修改操作,从而无法成功地导入恶意证书至数据库。实现在不增加硬件成本的前提下,有效地提高了数据库中存储的证书的有效性。The invention has the beneficial effects that the present invention compiles the root certificate into the executable file at compile time by compiling the root certificate for verifying the validity of the certificate to be imported, so the executable file is run. There is no way to replace, modify, or add information about the root certificate during the process. When receiving an import request for a certificate, it must first use the root certificate to digitally verify it. Only valid certificates can be successfully imported into the database, and the criminal cannot modify the root certificate stored in the database. Unable to successfully import a malicious certificate to the database. The implementation effectively improves the validity of the certificate stored in the database without increasing the hardware cost.
附图说明DRAWINGS
图1为本发明提供的一种证书导入方法的具体实施方式的流程框图;1 is a flow chart of a specific implementation manner of a certificate importing method provided by the present invention;
图2为本发明提供的一种证书导入终端的具体实施方式的结构框图;2 is a structural block diagram of a specific implementation manner of a certificate importing terminal provided by the present invention;
标号说明:Label description:
1、处理器;    2、存储器。1, the processor; 2, memory.
具体实施方式detailed description
本发明最关键的技术构思在于:本发明通过将用于验证待导入的证书有效性的根证书编译至可执行文件中,使得在可执行文件运行过程中,没有任何方法可以替换、修改或增加根证书的信息,从而实现在不增加硬件成本的前提下有效地提高了数据库中存储的证书的有效性。The most critical technical idea of the present invention is that the present invention compiles the root certificate for verifying the validity of the certificate to be imported into the executable file, so that no method can be replaced, modified or added during the execution of the executable file. The information of the root certificate, thereby effectively improving the validity of the certificate stored in the database without increasing the hardware cost.
请参照图1以及图2,Please refer to FIG. 1 and FIG. 2,
如图1所示,本发明提供一种证书导入方法,包括:As shown in FIG. 1, the present invention provides a certificate importing method, including:
S1、编译预设的根证书至可执行文件;S1, compiling the preset root certificate to the executable file;
S2、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥;S2. When receiving a write database request corresponding to a certificate, the executable file acquires a public key corresponding to the root certificate;
S3、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;S3. The executable file verifies the digital signature of the certificate according to the public key, and obtains a verification result; the verification result includes a verification pass and a verification fails;
S4、当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。S4. When the verification result is verification pass, the executable file writes the certificate and the certificate chain corresponding to the one certificate to a database.
进一步地,还包括:Further, it also includes:
获取身份信息;Obtain identity information;
当所述身份信息通过身份验证时,激活所述可执行文件的证书写入功能;所述证书写入功能用于接收与一证书对应的写入数据库请求。The certificate writing function of the executable file is activated when the identity information is authenticated; the certificate writing function is configured to receive a write database request corresponding to a certificate.
由上述描述可知,只有通过合法途径编译链接生成的可执行程序才可以修改、替换、增加证书和证书链信息,且只有通过身份验证的合法操作员才可执行修改证书信息的操作,有效提高了数据库中存储的证书的有效性。It can be seen from the above description that only the executable program generated by the legally compiled link can modify, replace, and add the certificate and certificate chain information, and only the authorized operator who performs the authentication can perform the operation of modifying the certificate information, thereby effectively improving the operation. The validity of the certificate stored in the database.
进一步地,还包括:Further, it also includes:
获取预设的验证密钥;Obtain a preset verification key;
根据所述一证书和所述证书链,得到待验证数据;Obtaining data to be verified according to the certificate and the certificate chain;
根据所述验证密钥对所述待验证数据进行MAC运算,得到第一MAC值;Performing a MAC operation on the to-be-verified data according to the verification key to obtain a first MAC value;
存储所述第一MAC值至所述数据库。Storing the first MAC value to the database.
进一步地,还包括:Further, it also includes:
当接收到密钥分发请求时,从所述数据库中获取所述待验证数据;Obtaining the to-be-verified data from the database when receiving a key distribution request;
根据所述验证密钥对所述待验证数据进行MAC运算,得到第二MAC值;Performing a MAC operation on the data to be verified according to the verification key to obtain a second MAC value;
当所述第一MAC值和所述第二MAC值相同时,根据所述一证书分发密钥。When the first MAC value and the second MAC value are the same, the key is distributed according to the one certificate.
进一步地,还包括:Further, it also includes:
采用X9.19算法进行所述MAC运算。The MAC operation is performed using the X9.19 algorithm.
进一步地,所述待验证数据包括写入所述一证书的时间、所述一证书和所述证书链。Further, the data to be verified includes a time for writing the certificate, the certificate, and the certificate chain.
进一步地,还包括:Further, it also includes:
注入所述验证密钥至硬件安全模块。The verification key is injected into the hardware security module.
由上述描述可知,每次使用数据库中存储的证书进行密钥分发前,都强制对数据库中的证书信息进行MAC校验,因此,任何非法的对证书的修改都可以被检测到,提高密钥分发的安全性。It can be seen from the above description that each time the key stored in the database is used for key distribution, the certificate information in the database is forced to be MAC-checked. Therefore, any illegal modification of the certificate can be detected, and the key is improved. The security of the distribution.
进一步地,还包括:Further, it also includes:
设置所述根证书的数据类型为常量。Set the data type of the root certificate to a constant.
由上述描述可知,本发明将根证书设计成可执行文件的常量,在可执行文件编译时,就已经被载入到系统应用中,使得在可执行程序运行过程中不法分子无法篡改根证书的信息,提高了对待导入的证书有效性验证的可靠性,从而提高了数据库中存储的证书的有效性。It can be seen from the above description that the present invention designs the root certificate as a constant of the executable file, and when the executable file is compiled, it has been loaded into the system application, so that the illegal element cannot tamper with the root certificate during the execution of the executable program. The information improves the reliability of the validity verification of the certificate to be imported, thereby improving the validity of the certificate stored in the database.
如图2所示,本发明还提供一种证书导入终端,包括一个或多个处理器1及存储器2,所述存储器2存储有程序,并且被配置成由所述一个或多个处理器1执行以下步骤:As shown in FIG. 2, the present invention further provides a certificate import terminal including one or more processors 1 and a memory 2, the memory 2 storing a program and configured to be configured by the one or more processors 1 Perform the following steps:
S1、编译预设的根证书至可执行文件;S1, compiling the preset root certificate to the executable file;
S2、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥;S2. When receiving a write database request corresponding to a certificate, the executable file acquires a public key corresponding to the root certificate;
S3、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;S3. The executable file verifies the digital signature of the certificate according to the public key, and obtains a verification result; the verification result includes a verification pass and a verification fails;
S4、当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。S4. When the verification result is verification pass, the executable file writes the certificate and the certificate chain corresponding to the one certificate to a database.
进一步地,还包括:Further, it also includes:
获取身份信息;Obtain identity information;
当所述身份信息通过身份验证时,激活所述可执行文件的证书写入功能;所述证书写入功能用于接收与一证书对应的写入数据库请求。The certificate writing function of the executable file is activated when the identity information is authenticated; the certificate writing function is configured to receive a write database request corresponding to a certificate.
进一步地,还包括:Further, it also includes:
获取预设的验证密钥;Obtain a preset verification key;
根据所述一证书和所述证书链,得到待验证数据;Obtaining data to be verified according to the certificate and the certificate chain;
根据所述验证密钥对所述待验证数据进行MAC运算,得到第一MAC值;Performing a MAC operation on the to-be-verified data according to the verification key to obtain a first MAC value;
存储所述第一MAC值至所述数据库。Storing the first MAC value to the database.
进一步地,还包括:Further, it also includes:
当接收到密钥分发请求时,从所述数据库中获取所述待验证数据;Obtaining the to-be-verified data from the database when receiving a key distribution request;
根据所述验证密钥对所述待验证数据进行MAC运算,得到第二MAC值;Performing a MAC operation on the data to be verified according to the verification key to obtain a second MAC value;
当所述第一MAC值和所述第二MAC值相同时,根据所述一证书分发密钥。When the first MAC value and the second MAC value are the same, the key is distributed according to the one certificate.
进一步地,还包括:Further, it also includes:
采用X9.19算法进行所述MAC运算。The MAC operation is performed using the X9.19 algorithm.
进一步地,所述待验证数据包括写入所述一证书的时间、所述一证书和所述证书链。Further, the data to be verified includes a time for writing the certificate, the certificate, and the certificate chain.
进一步地,所述S2之前,还包括:Further, before the S2, the method further includes:
注入所述验证密钥至硬件安全模块。The verification key is injected into the hardware security module.
进一步地,还包括:Further, it also includes:
设置所述根证书的数据类型为常量。Set the data type of the root certificate to a constant.
本发明的实施例一为:Embodiment 1 of the present invention is:
本实施例提供一种证书导入方法,包括:This embodiment provides a certificate importing method, including:
S1、编译预设的根证书至可执行文件。S1. Compile the default root certificate to the executable file.
可选地,设置所述根证书的数据类型为常量。Optionally, the data type of the root certificate is set to be a constant.
其中,根证书为受信任的CA证书。CA(Certification Authority)即认证中心,它是采用PKI(Public Key Infrastructure)公开密钥基础架构技术,专门提供网络身份认证服务,负责签发和管理数字证书。Among them, the root certificate is a trusted CA certificate. CA (Certification Authority) is a certification center. It uses PKI (Public Key Infrastructure) public key infrastructure technology, which provides network identity authentication services and is responsible for issuing and managing digital certificates.
因为本实施例涉及到公钥证书的验证,因此需要将受信任的CA证书中的公钥载入到系统中。为了提高安全性,在本实施例中将CA证书的公钥设计成应用程序的常量,在应用程序编译时,就已经被载入到可执行文件中。Since this embodiment involves the verification of a public key certificate, the public key in the trusted CA certificate needs to be loaded into the system. In order to improve security, in the present embodiment, the public key of the CA certificate is designed as a constant of the application, and is already loaded into the executable file when the application is compiled.
S2、注入预设的验证密钥至硬件安全模块。S2: Inject a preset verification key into the hardware security module.
其中,验证密钥是计算证书数据MAC值的密钥,是存储于数据库中的证书数据安全性和完整性保障的关键要素,在本实施例中,要求在系统正式投入使用前,将验证密钥注入到HSM(High Security Machine,高安全设备,在该系统中为硬件加密机)中,并将验证密钥配置到系统参数中。The verification key is a key for calculating the MAC value of the certificate data, and is a key element of the security and integrity guarantee of the certificate data stored in the database. In this embodiment, it is required to verify the password before the system is officially put into use. The key is injected into the HSM (High Security Machine, which is a hardware encryptor in the system) and the authentication key is configured into the system parameters.
S3、获取身份信息;当所述身份信息通过身份验证时,激活所述可执行文件的证书写入功能;所述证书写入功能用于接收与一证书对应的写入数据库请求。S3. Acquire identity information; when the identity information passes the identity verification, activate a certificate writing function of the executable file; the certificate writing function is configured to receive a write database request corresponding to a certificate.
其中,只有授权的操作员可使用该可执行文件可对数据库中的证书进行增删改操作。Among them, only the authorized operator can use the executable file to add, delete, and modify the certificate in the database.
S4、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥。S4. When receiving a write database request corresponding to a certificate, the executable file acquires a public key corresponding to the root certificate.
S5、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。S5. The executable file verifies the digital signature of the certificate according to the public key, and obtains a verification result; the verification result includes a verification pass and a verification fails; when the verification result is a verification pass, the executable file may The execution file writes the certificate and the certificate chain corresponding to the one certificate to the database.
其中,通过有效的方式导入X.509证书和证书链,生成公钥证书编号等相关信息;使用编译进可执行文件中的信任根CA证书公钥验证导入的X.509证书的数字签名,并分析证书主体信息,确定公钥证书的有效性;将通过验证的X.509证书写入到数据库中,同时写入的还有公钥证书编号等相关信息。The X.509 certificate and the certificate chain are imported in an effective manner, and the public key certificate number and other related information are generated; and the digital signature of the imported X.509 certificate is verified by using the trusted root CA certificate public key compiled into the executable file, and Analyze the certificate body information, determine the validity of the public key certificate; write the verified X.509 certificate to the database, and also write the relevant information such as the public key certificate number.
S6、获取所述验证密钥;根据所述一证书和所述证书链,得到待验证数据;所述待验证数据包括所述一证书、所述证书链、导入所述一证书、所述证书链的时间和所述身份信息;根据所述验证密钥对所述待验证数据进行MAC运算,得到第一MAC值;存储所述第一MAC值至所述数据库。S6: Acquire the verification key; obtain data to be verified according to the one certificate and the certificate chain; the data to be verified includes the certificate, the certificate chain, importing the certificate, and the certificate The time of the chain and the identity information; performing MAC operations on the data to be verified according to the verification key to obtain a first MAC value; and storing the first MAC value to the database.
可选地,采用X9.19算法进行所述MAC运算。Optionally, the MAC operation is performed using an X9.19 algorithm.
S7、当接收到密钥分发请求时,从所述数据库中获取所述待验证数据;根据所述验证密钥对所述待验证数据进行MAC运算,得到第二MAC值;当所述第一MAC值和所述第二MAC值相同时,根据所述一证书分发密钥。S7: When the key distribution request is received, the data to be verified is obtained from the database; performing MAC operation on the data to be verified according to the verification key to obtain a second MAC value; When the MAC value and the second MAC value are the same, the key is distributed according to the one certificate.
由上述描述可知,本实施例将信任根CA证书编译到了系统应用中,只要是由合法CA签发的公钥证书,均可以通过RSA公开密码机制的验证体系,使用CA证书中的公钥验证合法性,这是确实可行的,有效的。As can be seen from the above description, in this embodiment, the trusted root CA certificate is compiled into the system application. As long as the public key certificate issued by the legal CA can be verified by the RSA public password mechanism, the public key in the CA certificate is used to verify the legality. Sex, this is indeed feasible and effective.
本实施例中设计了公钥证书进入系统的唯一安全接口,应用编译阶段就将信任根CA证书数据编译进去,通过该接口导入的下级公钥证书必须通过信任根CA证书公钥的验证,之后使用验证密钥(验证密钥预先被注入到HSM中)对数据进行MAC运算,并写入到系统数据库中,每次从数据库获取公钥证书数据时,均强制要求对数据进行MAC校验,从而保证使用的公钥证书的合法性;此外,公钥证书的是由符合安全标准的CA中心签发的,其安全性可以得到保障。综上,公钥证书在生成、处理、存储的时候均满足安全性的要求。In this embodiment, the unique security interface of the public key certificate entering the system is designed, and the trusted root CA certificate data is compiled into the application compiling stage. The lower-level public key certificate imported through the interface must be verified by the root certificate of the trusted root CA certificate. The data is MAC-calculated using the verification key (the verification key is injected into the HSM in advance) and written into the system database. Each time the public key certificate data is obtained from the database, the data is forcibly required to perform MAC verification. Therefore, the validity of the public key certificate used is guaranteed; in addition, the public key certificate is issued by the CA center that meets the security standard, and the security can be guaranteed. In summary, the public key certificate meets the security requirements when it is generated, processed, and stored.
本实施例采用数据MAC值校验的方案,保证存储数据的完整性和可认证性。对通过验证的公钥证书数据、以及其相关内容使用验证公钥进行了X9.19算法的MAC运算,并作为关键的数据存储在系统数据库中,每次使用公钥证书时,使用相同的算法即可对获得的公钥证书数据进行MAC校验。本实施例的数据具有完整性和可认证性的特点。In this embodiment, the data MAC value verification scheme is adopted to ensure the integrity and certifiability of the stored data. The public key certificate data of the verification and its related content are subjected to the MAC operation of the X9.19 algorithm using the verification public key, and are stored as key data in the system database, and the same algorithm is used each time the public key certificate is used. The obtained public key certificate data can be MAC-checked. The data of this embodiment has the characteristics of integrity and certifiability.
本发明的实施例二为:Embodiment 2 of the present invention is:
本实施例提供一种证书导入终端,包括一个或多个处理器1及存储器2,所述存储器2存储有程序,并且被配置成由所述一个或多个处理器1执行以下步骤:The embodiment provides a certificate import terminal including one or more processors 1 and a memory 2, the memory 2 storing a program, and being configured to perform the following steps by the one or more processors 1:
S1、编译预设的根证书至可执行文件。S1. Compile the default root certificate to the executable file.
可选地,设置所述根证书的数据类型为常量。Optionally, the data type of the root certificate is set to be a constant.
S2、注入预设的验证密钥至硬件安全模块。S2: Inject a preset verification key into the hardware security module.
S3、获取身份信息;当所述身份信息通过身份验证时,激活所述可执行文件的证书写入功能;所述证书写入功能用于接收与一证书对应的写入数据库请求。S3. Acquire identity information; when the identity information passes the identity verification, activate a certificate writing function of the executable file; the certificate writing function is configured to receive a write database request corresponding to a certificate.
S4、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥。S4. When receiving a write database request corresponding to a certificate, the executable file acquires a public key corresponding to the root certificate.
S5、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。S5. The executable file verifies the digital signature of the certificate according to the public key, and obtains a verification result; the verification result includes a verification pass and a verification fails; when the verification result is a verification pass, the executable file may The execution file writes the certificate and the certificate chain corresponding to the one certificate to the database.
S6、获取所述验证密钥;根据所述一证书和所述证书链,得到待验证数据;所述待验证数据包括所述一证书、所述证书链、导入所述一证书、所述证书链的时间和所述身份信息;根据所述验证密钥对所述待验证数据进行MAC运算,得到第一MAC值;存储所述第一MAC值至所述数据库。S6: Acquire the verification key; obtain data to be verified according to the one certificate and the certificate chain; the data to be verified includes the certificate, the certificate chain, importing the certificate, and the certificate The time of the chain and the identity information; performing MAC operations on the data to be verified according to the verification key to obtain a first MAC value; and storing the first MAC value to the database.
可选地,采用X9.19算法进行所述MAC运算。Optionally, the MAC operation is performed using an X9.19 algorithm.
S7、当接收到密钥分发请求时,从所述数据库中获取所述待验证数据;根据所述验证密钥对所述待验证数据进行MAC运算,得到第二MAC值;当所述第一MAC值和所述第二MAC值相同时,根据所述一证书分发密钥。S7: When the key distribution request is received, the data to be verified is obtained from the database; performing MAC operation on the data to be verified according to the verification key to obtain a second MAC value; When the MAC value and the second MAC value are the same, the key is distributed according to the one certificate.
综上所述,本发明提供的一种证书导入方法及终端,通过将用于验证待导入的证书有效性的根证书编译至可执行文件中,使得在编译时即将根证书载入到可执行文件,因此在可执行文件运行过程中,没有任何方法可以替换、修改或增加根证书的信息。在接收到一证书的导入请求时,需先使用根证书对其进行数字签名验证,只有有效的证书才可被成功导入到数据库中,不法分子无法对数据库中存储的根证书进行修改操作,从而无法成功地导入恶意证书至数据库。实现在不增加硬件成本的前提下,有效地提高了数据库中存储的证书的有效性。进一步地,只有通过合法途径编译链接生成的可执行程序才可以修改、替换、增加证书和证书链信息,且只有通过身份验证的合法操作员才可执行修改证书信息的操作,有效提高了数据库中存储的证书的有效性。进一步地,每次使用数据库中存储的证书进行密钥分发前,都强制对数据库中的证书信息进行MAC校验,因此,任何非法的对证书的修改都可以被检测到,提高密钥分发的安全性。进一步地,本发明将根证书设计成可执行文件的常量,在可执行文件编译时,就已经被载入到系统应用中,使得在可执行程序运行过程中不法分子无法篡改根证书的信息,提高了对待导入的证书有效性验证的可靠性,从而提高了数据库中存储的证书的有效性。In summary, the present invention provides a certificate import method and a terminal, by compiling a root certificate for verifying the validity of a certificate to be imported into an executable file, so that the root certificate is loaded into an executable at compile time. File, so there is no way to replace, modify, or add information about the root certificate while the executable is running. When receiving an import request for a certificate, it must first use the root certificate to digitally verify it. Only valid certificates can be successfully imported into the database, and the criminal cannot modify the root certificate stored in the database. Unable to successfully import a malicious certificate to the database. The implementation effectively improves the validity of the certificate stored in the database without increasing the hardware cost. Further, only the executable program generated by the legal way to compile the link can modify, replace, and add the certificate and certificate chain information, and only the legal operator who performs the authentication can perform the operation of modifying the certificate information, thereby effectively improving the database. The validity of the stored certificate. Further, each time the key stored in the database is used for key distribution, the certificate information in the database is forced to be MAC-checked. Therefore, any illegal modification of the certificate can be detected, and the key distribution is improved. safety. Further, the present invention designs the root certificate as a constant of the executable file, and when the executable file is compiled, it is already loaded into the system application, so that the illegal element cannot tamper with the root certificate information during the execution of the executable program. Improves the reliability of certificate validation for imported certificates, thereby increasing the validity of certificates stored in the database.

Claims (16)

  1. 一种证书导入方法,其特征在于,包括:A certificate importing method, comprising:
    S1、编译预设的根证书至可执行文件;S1, compiling the preset root certificate to the executable file;
    S2、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥;S2. When receiving a write database request corresponding to a certificate, the executable file acquires a public key corresponding to the root certificate;
    S3、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;S3. The executable file verifies the digital signature of the certificate according to the public key, and obtains a verification result; the verification result includes a verification pass and a verification fails;
    S4、当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。S4. When the verification result is verification pass, the executable file writes the certificate and the certificate chain corresponding to the one certificate to a database.
  2. 根据权利要求1所述的证书导入方法,其特征在于,所述S2之前,还包括:The certificate importing method according to claim 1, wherein before the S2, the method further comprises:
    获取身份信息;Obtain identity information;
    当所述身份信息通过身份验证时,激活所述可执行文件的证书写入功能;所述证书写入功能用于接收与一证书对应的写入数据库请求。The certificate writing function of the executable file is activated when the identity information is authenticated; the certificate writing function is configured to receive a write database request corresponding to a certificate.
  3. 根据权利要求1所述的证书导入方法,其特征在于,所述S4之后,还包括:The certificate importing method according to claim 1, wherein after the step S4, the method further comprises:
    获取预设的验证密钥;Obtain a preset verification key;
    根据所述一证书和所述证书链,得到待验证数据;Obtaining data to be verified according to the certificate and the certificate chain;
    根据所述验证密钥对所述待验证数据进行MAC运算,得到第一MAC值;Performing a MAC operation on the to-be-verified data according to the verification key to obtain a first MAC value;
    存储所述第一MAC值至所述数据库。Storing the first MAC value to the database.
  4. 根据权利要求3所述的证书导入方法,其特征在于,还包括:The certificate importing method according to claim 3, further comprising:
    当接收到密钥分发请求时,从所述数据库中获取所述待验证数据;Obtaining the to-be-verified data from the database when receiving a key distribution request;
    根据所述验证密钥对所述待验证数据进行MAC运算,得到第二MAC值;Performing a MAC operation on the data to be verified according to the verification key to obtain a second MAC value;
    当所述第一MAC值和所述第二MAC值相同时,根据所述一证书分发密钥。When the first MAC value and the second MAC value are the same, the key is distributed according to the one certificate.
  5. 根据权利要求3所述的证书导入方法,其特征在于,还包括:The certificate importing method according to claim 3, further comprising:
    采用X9.19算法进行所述MAC运算。The MAC operation is performed using the X9.19 algorithm.
  6. 根据权利要求3所述的证书导入方法,其特征在于,所述待验证数据包括写入所述一证书的时间、所述一证书和所述证书链。The certificate importing method according to claim 3, wherein the data to be verified includes a time for writing the certificate, the certificate, and the certificate chain.
  7. 根据权利要求3所述的证书导入方法,其特征在于,所述S2之前,还包括:The certificate importing method according to claim 3, wherein before the S2, the method further comprises:
    注入所述验证密钥至硬件安全模块。The verification key is injected into the hardware security module.
  8. 根据权利要求1所述的证书导入方法,其特征在于,还包括:The method for importing a certificate according to claim 1, further comprising:
    设置所述根证书的数据类型为常量。Set the data type of the root certificate to a constant.
  9. 一种证书导入终端,其特征在于,包括一个或多个处理器及存储器,所述存储器存储有程序,并且被配置成由所述一个或多个处理器执行以下步骤:A certificate import terminal, comprising: one or more processors and a memory, the memory storing a program, and being configured to perform the following steps by the one or more processors:
    S1、编译预设的根证书至可执行文件;S1, compiling the preset root certificate to the executable file;
    S2、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥;S2. When receiving a write database request corresponding to a certificate, the executable file acquires a public key corresponding to the root certificate;
    S3、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;S3. The executable file verifies the digital signature of the certificate according to the public key, and obtains a verification result; the verification result includes a verification pass and a verification fails;
    S4、当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。S4. When the verification result is verification pass, the executable file writes the certificate and the certificate chain corresponding to the one certificate to a database.
  10. 根据权利要求9所述的证书导入终端,其特征在于,所述S2之前,还包括:The certificate importing terminal according to claim 9, wherein before the S2, the method further comprises:
    获取身份信息;Obtain identity information;
    当所述身份信息通过身份验证时,激活所述可执行文件的证书写入功能;所述证书写入功能用于接收与一证书对应的写入数据库请求。The certificate writing function of the executable file is activated when the identity information is authenticated; the certificate writing function is configured to receive a write database request corresponding to a certificate.
  11. 根据权利要求9所述的证书导入终端,其特征在于,所述S4之后,还包括:The certificate importing terminal according to claim 9, wherein after the step S4, the method further comprises:
    获取预设的验证密钥;Obtain a preset verification key;
    根据所述一证书和所述证书链,得到待验证数据;Obtaining data to be verified according to the certificate and the certificate chain;
    根据所述验证密钥对所述待验证数据进行MAC运算,得到第一MAC值;Performing a MAC operation on the to-be-verified data according to the verification key to obtain a first MAC value;
    存储所述第一MAC值至所述数据库。Storing the first MAC value to the database.
  12. 根据权利要求11所述的证书导入终端,其特征在于,还包括:The certificate importing terminal according to claim 11, further comprising:
    当接收到密钥分发请求时,从所述数据库中获取所述待验证数据;Obtaining the to-be-verified data from the database when receiving a key distribution request;
    根据所述验证密钥对所述待验证数据进行MAC运算,得到第二MAC值;Performing a MAC operation on the data to be verified according to the verification key to obtain a second MAC value;
    当所述第一MAC值和所述第二MAC值相同时,根据所述一证书分发密钥。When the first MAC value and the second MAC value are the same, the key is distributed according to the one certificate.
  13. 根据权利要求11所述的证书导入终端,其特征在于,还包括:The certificate importing terminal according to claim 11, further comprising:
    采用X9.19算法进行所述MAC运算。The MAC operation is performed using the X9.19 algorithm.
  14. 根据权利要求11所述的证书导入终端,其特征在于,所述待验证数据包括写入所述一证书的时间、所述一证书和所述证书链。The certificate importing terminal according to claim 11, wherein the data to be verified includes a time for writing the certificate, the certificate, and the certificate chain.
  15. 根据权利要求11所述的证书导入终端,其特征在于,所述S2之前,还包括:The certificate importing terminal according to claim 11, wherein before the S2, the method further comprises:
    注入所述验证密钥至硬件安全模块。The verification key is injected into the hardware security module.
  16. 根据权利要求9所述的证书导入终端,其特征在于,还包括:The certificate importing terminal according to claim 9, further comprising:
    设置所述根证书的数据类型为常量。Set the data type of the root certificate to a constant.
PCT/CN2018/079746 2018-03-21 2018-03-21 Certificate importing method and terminal WO2019178763A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/079746 WO2019178763A1 (en) 2018-03-21 2018-03-21 Certificate importing method and terminal
CN201880000201.8A CN108496323B (en) 2018-03-21 2018-03-21 Certificate importing method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/079746 WO2019178763A1 (en) 2018-03-21 2018-03-21 Certificate importing method and terminal

Publications (1)

Publication Number Publication Date
WO2019178763A1 true WO2019178763A1 (en) 2019-09-26

Family

ID=63343520

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/079746 WO2019178763A1 (en) 2018-03-21 2018-03-21 Certificate importing method and terminal

Country Status (2)

Country Link
CN (1) CN108496323B (en)
WO (1) WO2019178763A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111641502A (en) * 2020-06-01 2020-09-08 中国农业银行股份有限公司 Electronic certificate downloading method and device based on super counter
CN115567314A (en) * 2022-10-14 2023-01-03 中电云数智科技有限公司 License security agent method and platform based on hardware trusted trust chain

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112532390B (en) * 2019-08-30 2022-05-10 华为技术有限公司 Method and device for loading certificate of digital certificate certification authority
CN110601855B (en) * 2019-09-20 2022-05-13 腾讯科技(深圳)有限公司 Root certificate management method and device, electronic equipment and storage medium
CN112073967B (en) * 2020-08-14 2022-10-25 中信银行股份有限公司 Method and device for downloading identity certificate of mobile phone shield equipment and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130227668A1 (en) * 2012-02-28 2013-08-29 Citrix Systems, Inc. Secure single sign-on
CN103731260A (en) * 2013-03-15 2014-04-16 福建联迪商用设备有限公司 Method and system for safe downloading of TMK
US20140250105A1 (en) * 2013-03-04 2014-09-04 Google Inc. Reliable content recommendations
CN105931042A (en) * 2015-09-22 2016-09-07 中国银联股份有限公司 Application authority management method and intelligent POS terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130091353A1 (en) * 2011-08-01 2013-04-11 General Instrument Corporation Apparatus and method for secure communication
CN104753670B (en) * 2013-12-27 2018-09-21 中国银联股份有限公司 Safety management system and its method are applied based on intelligent POS terminal more

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130227668A1 (en) * 2012-02-28 2013-08-29 Citrix Systems, Inc. Secure single sign-on
US20140250105A1 (en) * 2013-03-04 2014-09-04 Google Inc. Reliable content recommendations
CN103731260A (en) * 2013-03-15 2014-04-16 福建联迪商用设备有限公司 Method and system for safe downloading of TMK
CN105931042A (en) * 2015-09-22 2016-09-07 中国银联股份有限公司 Application authority management method and intelligent POS terminal

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111641502A (en) * 2020-06-01 2020-09-08 中国农业银行股份有限公司 Electronic certificate downloading method and device based on super counter
CN115567314A (en) * 2022-10-14 2023-01-03 中电云数智科技有限公司 License security agent method and platform based on hardware trusted trust chain
CN115567314B (en) * 2022-10-14 2024-01-30 中电云计算技术有限公司 License security agent method and platform based on hardware trusted trust chain

Also Published As

Publication number Publication date
CN108496323A (en) 2018-09-04
CN108496323B (en) 2020-01-21

Similar Documents

Publication Publication Date Title
US11880808B2 (en) Securing in-app purchases
JP7060362B2 (en) Event certificate for electronic devices
US9838205B2 (en) Network authentication method for secure electronic transactions
JP4067985B2 (en) Application authentication system and device
WO2019178763A1 (en) Certificate importing method and terminal
US8555075B2 (en) Methods and system for storing and retrieving identity mapping information
CN107124431A (en) Method for authenticating, device, computer-readable recording medium and right discriminating system
CN112671720B (en) Token construction method, device and equipment for cloud platform resource access control
CN110795126A (en) Firmware safety upgrading system
RU2011153984A (en) TRUSTED AUTHORITY ADMINISTRATOR (TIM)
CN110677376A (en) Authentication method, related device and system and computer readable storage medium
TWM595792U (en) Authorization system for cross-platform authorizing access to resources
CN112448946B (en) Log auditing method and device based on block chain
EP1886204A1 (en) Transaction method and verification method
CN114301617A (en) Identity authentication method and device for multi-cloud application gateway, computer equipment and medium
WO2019178762A1 (en) Method, server, and system for verifying validity of terminal
CN114117551B (en) Access verification method and device
CN113271207A (en) Escrow key using method and system based on mobile electronic signature, computer equipment and storage medium
CN111953477B (en) Terminal equipment, generation method of identification token of terminal equipment and interaction method of client
CN116896463A (en) Trusted environment authentication method and device based on blockchain
US20240113898A1 (en) Secure Module and Method for App-to-App Mutual Trust Through App-Based Identity
TW202116038A (en) Identification method and systerm of electronic device
TWI782678B (en) Authentication system and method applied to digital signature component
TWI778319B (en) Method for cross-platform authorizing access to resources and authorization system thereof
CN116703310A (en) Resource transfer method, device, computer equipment and storage medium

Legal Events

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

Ref document number: 18910971

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18910971

Country of ref document: EP

Kind code of ref document: A1