WO2019178763A1 - 一种证书导入方法及终端 - Google Patents

一种证书导入方法及终端 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
English (en)
French (fr)
Inventor
王明伟
徐永标
Original Assignee
福建联迪商用设备有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 福建联迪商用设备有限公司 filed Critical 福建联迪商用设备有限公司
Priority to CN201880000201.8A priority Critical patent/CN108496323B/zh
Priority to PCT/CN2018/079746 priority patent/WO2019178763A1/zh
Publication of WO2019178763A1 publication Critical patent/WO2019178763A1/zh

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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Storage Device Security (AREA)

Abstract

本发明涉及信息安全领域,尤其涉及一种证书导入方法及终端。本发明通过编译预设的根证书至可执行文件;当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥;所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。实现在不增加硬件成本的前提下提高证书的有效性。

Description

一种证书导入方法及终端 技术领域
本发明涉及信息安全领域,尤其涉及一种证书导入方法及终端。
背景技术
随着数字证书技术的广泛使用,越来越多的***平台和交易终端采用X.509的证书体系来完成安全认证或者敏感数据下载的交易。因为X.509证书自带真实性和完整性验证,因此其应用非常广泛,在电子支付领域,支付终端证书可以作为终端的身份凭证,实现与交互后台的身份认证,此外,支付终端与收单后台的密钥下载业务前置可使用证书来进行终端主密钥的下载。
X.509证书,特别是根证书和证书链,是交易双方进行相互认证的信任基础。虽然证书本身带有完整性验证,但是***或终端如果不进行合理存储和保管,根证书或证书链被替换,或者被攻击者***恶意的根证书及证书链,由证书建立的信任大厦便岌岌可危了。尤其是在一些敏感的应用场景中,比如远程下载金融密钥的密钥管理***中,如果***存在该漏洞,极易造成金融机构密钥泄露,由此带来严重的安全事故。采用X.509证书认证体系进行身份认证,密钥管理***中的X.509证书是重要的数据,其是保证认证体系可靠性的关键,任何无意的修改或是恶意的攻击,都可能导致整个远程密钥分发体系陷于风险之中,威胁到分发密钥的安全性。
当前常见的做法,如下:
方式1:证书直接以文本形式存储在数据库或者文件***中,比如使用STUNNEL代理建立安全通信链路时,证书文件配置的文本文件中,可随意修改,增加或删除证书;如果被攻击者访问到了存储证书的数据库或文件,那么攻击者极易添加、删除、修改***中的证书和证书链。
方式2:使用专门的物理设备存储证书,比如银行***中用于验证客户端身份的U盾。该方式并不适合***端证书存储,且基于硬件设备的存储方式也会增加额外的成本。
技术问题
本发明所要解决的技术问题是:如何在不增加硬件成本的前提下提高证书的有效性。
技术解决方案
为了解决上述技术问题,本发明采用的技术方案为:
本发明提供一种证书导入方法,包括:
S1、编译预设的根证书至可执行文件;
S2、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥;
S3、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;
S4、当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。
本发明还提供一种证书导入终端,包括一个或多个处理器及存储器,所述存储器存储有程序,并且被配置成由所述一个或多个处理器执行以下步骤:
S1、编译预设的根证书至可执行文件;
S2、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥;
S3、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;
S4、当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。
有益效果
本发明的有益效果在于:本发明通过将用于验证待导入的证书有效性的根证书编译至可执行文件中,使得在编译时即将根证书载入到可执行文件,因此在可执行文件运行过程中,没有任何方法可以替换、修改或增加根证书的信息。在接收到一证书的导入请求时,需先使用根证书对其进行数字签名验证,只有有效的证书才可被成功导入到数据库中,不法分子无法对数据库中存储的根证书进行修改操作,从而无法成功地导入恶意证书至数据库。实现在不增加硬件成本的前提下,有效地提高了数据库中存储的证书的有效性。
附图说明
图1为本发明提供的一种证书导入方法的具体实施方式的流程框图;
图2为本发明提供的一种证书导入终端的具体实施方式的结构框图;
标号说明:
1、处理器;    2、存储器。
具体实施方式
本发明最关键的技术构思在于:本发明通过将用于验证待导入的证书有效性的根证书编译至可执行文件中,使得在可执行文件运行过程中,没有任何方法可以替换、修改或增加根证书的信息,从而实现在不增加硬件成本的前提下有效地提高了数据库中存储的证书的有效性。
请参照图1以及图2,
如图1所示,本发明提供一种证书导入方法,包括:
S1、编译预设的根证书至可执行文件;
S2、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥;
S3、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;
S4、当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。
进一步地,还包括:
获取身份信息;
当所述身份信息通过身份验证时,激活所述可执行文件的证书写入功能;所述证书写入功能用于接收与一证书对应的写入数据库请求。
由上述描述可知,只有通过合法途径编译链接生成的可执行程序才可以修改、替换、增加证书和证书链信息,且只有通过身份验证的合法操作员才可执行修改证书信息的操作,有效提高了数据库中存储的证书的有效性。
进一步地,还包括:
获取预设的验证密钥;
根据所述一证书和所述证书链,得到待验证数据;
根据所述验证密钥对所述待验证数据进行MAC运算,得到第一MAC值;
存储所述第一MAC值至所述数据库。
进一步地,还包括:
当接收到密钥分发请求时,从所述数据库中获取所述待验证数据;
根据所述验证密钥对所述待验证数据进行MAC运算,得到第二MAC值;
当所述第一MAC值和所述第二MAC值相同时,根据所述一证书分发密钥。
进一步地,还包括:
采用X9.19算法进行所述MAC运算。
进一步地,所述待验证数据包括写入所述一证书的时间、所述一证书和所述证书链。
进一步地,还包括:
注入所述验证密钥至硬件安全模块。
由上述描述可知,每次使用数据库中存储的证书进行密钥分发前,都强制对数据库中的证书信息进行MAC校验,因此,任何非法的对证书的修改都可以被检测到,提高密钥分发的安全性。
进一步地,还包括:
设置所述根证书的数据类型为常量。
由上述描述可知,本发明将根证书设计成可执行文件的常量,在可执行文件编译时,就已经被载入到***应用中,使得在可执行程序运行过程中不法分子无法篡改根证书的信息,提高了对待导入的证书有效性验证的可靠性,从而提高了数据库中存储的证书的有效性。
如图2所示,本发明还提供一种证书导入终端,包括一个或多个处理器1及存储器2,所述存储器2存储有程序,并且被配置成由所述一个或多个处理器1执行以下步骤:
S1、编译预设的根证书至可执行文件;
S2、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥;
S3、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;
S4、当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。
进一步地,还包括:
获取身份信息;
当所述身份信息通过身份验证时,激活所述可执行文件的证书写入功能;所述证书写入功能用于接收与一证书对应的写入数据库请求。
进一步地,还包括:
获取预设的验证密钥;
根据所述一证书和所述证书链,得到待验证数据;
根据所述验证密钥对所述待验证数据进行MAC运算,得到第一MAC值;
存储所述第一MAC值至所述数据库。
进一步地,还包括:
当接收到密钥分发请求时,从所述数据库中获取所述待验证数据;
根据所述验证密钥对所述待验证数据进行MAC运算,得到第二MAC值;
当所述第一MAC值和所述第二MAC值相同时,根据所述一证书分发密钥。
进一步地,还包括:
采用X9.19算法进行所述MAC运算。
进一步地,所述待验证数据包括写入所述一证书的时间、所述一证书和所述证书链。
进一步地,所述S2之前,还包括:
注入所述验证密钥至硬件安全模块。
进一步地,还包括:
设置所述根证书的数据类型为常量。
本发明的实施例一为:
本实施例提供一种证书导入方法,包括:
S1、编译预设的根证书至可执行文件。
可选地,设置所述根证书的数据类型为常量。
其中,根证书为受信任的CA证书。CA(Certification Authority)即认证中心,它是采用PKI(Public Key Infrastructure)公开密钥基础架构技术,专门提供网络身份认证服务,负责签发和管理数字证书。
因为本实施例涉及到公钥证书的验证,因此需要将受信任的CA证书中的公钥载入到***中。为了提高安全性,在本实施例中将CA证书的公钥设计成应用程序的常量,在应用程序编译时,就已经被载入到可执行文件中。
S2、注入预设的验证密钥至硬件安全模块。
其中,验证密钥是计算证书数据MAC值的密钥,是存储于数据库中的证书数据安全性和完整性保障的关键要素,在本实施例中,要求在***正式投入使用前,将验证密钥注入到HSM(High Security Machine,高安全设备,在该***中为硬件加密机)中,并将验证密钥配置到***参数中。
S3、获取身份信息;当所述身份信息通过身份验证时,激活所述可执行文件的证书写入功能;所述证书写入功能用于接收与一证书对应的写入数据库请求。
其中,只有授权的操作员可使用该可执行文件可对数据库中的证书进行增删改操作。
S4、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥。
S5、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。
其中,通过有效的方式导入X.509证书和证书链,生成公钥证书编号等相关信息;使用编译进可执行文件中的信任根CA证书公钥验证导入的X.509证书的数字签名,并分析证书主体信息,确定公钥证书的有效性;将通过验证的X.509证书写入到数据库中,同时写入的还有公钥证书编号等相关信息。
S6、获取所述验证密钥;根据所述一证书和所述证书链,得到待验证数据;所述待验证数据包括所述一证书、所述证书链、导入所述一证书、所述证书链的时间和所述身份信息;根据所述验证密钥对所述待验证数据进行MAC运算,得到第一MAC值;存储所述第一MAC值至所述数据库。
可选地,采用X9.19算法进行所述MAC运算。
S7、当接收到密钥分发请求时,从所述数据库中获取所述待验证数据;根据所述验证密钥对所述待验证数据进行MAC运算,得到第二MAC值;当所述第一MAC值和所述第二MAC值相同时,根据所述一证书分发密钥。
由上述描述可知,本实施例将信任根CA证书编译到了***应用中,只要是由合法CA签发的公钥证书,均可以通过RSA公开密码机制的验证体系,使用CA证书中的公钥验证合法性,这是确实可行的,有效的。
本实施例中设计了公钥证书进入***的唯一安全接口,应用编译阶段就将信任根CA证书数据编译进去,通过该接口导入的下级公钥证书必须通过信任根CA证书公钥的验证,之后使用验证密钥(验证密钥预先被注入到HSM中)对数据进行MAC运算,并写入到***数据库中,每次从数据库获取公钥证书数据时,均强制要求对数据进行MAC校验,从而保证使用的公钥证书的合法性;此外,公钥证书的是由符合安全标准的CA中心签发的,其安全性可以得到保障。综上,公钥证书在生成、处理、存储的时候均满足安全性的要求。
本实施例采用数据MAC值校验的方案,保证存储数据的完整性和可认证性。对通过验证的公钥证书数据、以及其相关内容使用验证公钥进行了X9.19算法的MAC运算,并作为关键的数据存储在***数据库中,每次使用公钥证书时,使用相同的算法即可对获得的公钥证书数据进行MAC校验。本实施例的数据具有完整性和可认证性的特点。
本发明的实施例二为:
本实施例提供一种证书导入终端,包括一个或多个处理器1及存储器2,所述存储器2存储有程序,并且被配置成由所述一个或多个处理器1执行以下步骤:
S1、编译预设的根证书至可执行文件。
可选地,设置所述根证书的数据类型为常量。
S2、注入预设的验证密钥至硬件安全模块。
S3、获取身份信息;当所述身份信息通过身份验证时,激活所述可执行文件的证书写入功能;所述证书写入功能用于接收与一证书对应的写入数据库请求。
S4、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥。
S5、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。
S6、获取所述验证密钥;根据所述一证书和所述证书链,得到待验证数据;所述待验证数据包括所述一证书、所述证书链、导入所述一证书、所述证书链的时间和所述身份信息;根据所述验证密钥对所述待验证数据进行MAC运算,得到第一MAC值;存储所述第一MAC值至所述数据库。
可选地,采用X9.19算法进行所述MAC运算。
S7、当接收到密钥分发请求时,从所述数据库中获取所述待验证数据;根据所述验证密钥对所述待验证数据进行MAC运算,得到第二MAC值;当所述第一MAC值和所述第二MAC值相同时,根据所述一证书分发密钥。
综上所述,本发明提供的一种证书导入方法及终端,通过将用于验证待导入的证书有效性的根证书编译至可执行文件中,使得在编译时即将根证书载入到可执行文件,因此在可执行文件运行过程中,没有任何方法可以替换、修改或增加根证书的信息。在接收到一证书的导入请求时,需先使用根证书对其进行数字签名验证,只有有效的证书才可被成功导入到数据库中,不法分子无法对数据库中存储的根证书进行修改操作,从而无法成功地导入恶意证书至数据库。实现在不增加硬件成本的前提下,有效地提高了数据库中存储的证书的有效性。进一步地,只有通过合法途径编译链接生成的可执行程序才可以修改、替换、增加证书和证书链信息,且只有通过身份验证的合法操作员才可执行修改证书信息的操作,有效提高了数据库中存储的证书的有效性。进一步地,每次使用数据库中存储的证书进行密钥分发前,都强制对数据库中的证书信息进行MAC校验,因此,任何非法的对证书的修改都可以被检测到,提高密钥分发的安全性。进一步地,本发明将根证书设计成可执行文件的常量,在可执行文件编译时,就已经被载入到***应用中,使得在可执行程序运行过程中不法分子无法篡改根证书的信息,提高了对待导入的证书有效性验证的可靠性,从而提高了数据库中存储的证书的有效性。

Claims (16)

  1. 一种证书导入方法,其特征在于,包括:
    S1、编译预设的根证书至可执行文件;
    S2、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥;
    S3、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;
    S4、当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。
  2. 根据权利要求1所述的证书导入方法,其特征在于,所述S2之前,还包括:
    获取身份信息;
    当所述身份信息通过身份验证时,激活所述可执行文件的证书写入功能;所述证书写入功能用于接收与一证书对应的写入数据库请求。
  3. 根据权利要求1所述的证书导入方法,其特征在于,所述S4之后,还包括:
    获取预设的验证密钥;
    根据所述一证书和所述证书链,得到待验证数据;
    根据所述验证密钥对所述待验证数据进行MAC运算,得到第一MAC值;
    存储所述第一MAC值至所述数据库。
  4. 根据权利要求3所述的证书导入方法,其特征在于,还包括:
    当接收到密钥分发请求时,从所述数据库中获取所述待验证数据;
    根据所述验证密钥对所述待验证数据进行MAC运算,得到第二MAC值;
    当所述第一MAC值和所述第二MAC值相同时,根据所述一证书分发密钥。
  5. 根据权利要求3所述的证书导入方法,其特征在于,还包括:
    采用X9.19算法进行所述MAC运算。
  6. 根据权利要求3所述的证书导入方法,其特征在于,所述待验证数据包括写入所述一证书的时间、所述一证书和所述证书链。
  7. 根据权利要求3所述的证书导入方法,其特征在于,所述S2之前,还包括:
    注入所述验证密钥至硬件安全模块。
  8. 根据权利要求1所述的证书导入方法,其特征在于,还包括:
    设置所述根证书的数据类型为常量。
  9. 一种证书导入终端,其特征在于,包括一个或多个处理器及存储器,所述存储器存储有程序,并且被配置成由所述一个或多个处理器执行以下步骤:
    S1、编译预设的根证书至可执行文件;
    S2、当接收到与一证书对应的写入数据库请求时,所述可执行文件获取与所述根证书对应的公钥;
    S3、所述可执行文件根据所述公钥验证所述一证书的数字签名,得到验证结果;所述验证结果包括验证通过和验证未通过;
    S4、当所述验证结果为验证通过时,所述可执行文件写入所述一证书和与所述一证书对应的证书链至数据库。
  10. 根据权利要求9所述的证书导入终端,其特征在于,所述S2之前,还包括:
    获取身份信息;
    当所述身份信息通过身份验证时,激活所述可执行文件的证书写入功能;所述证书写入功能用于接收与一证书对应的写入数据库请求。
  11. 根据权利要求9所述的证书导入终端,其特征在于,所述S4之后,还包括:
    获取预设的验证密钥;
    根据所述一证书和所述证书链,得到待验证数据;
    根据所述验证密钥对所述待验证数据进行MAC运算,得到第一MAC值;
    存储所述第一MAC值至所述数据库。
  12. 根据权利要求11所述的证书导入终端,其特征在于,还包括:
    当接收到密钥分发请求时,从所述数据库中获取所述待验证数据;
    根据所述验证密钥对所述待验证数据进行MAC运算,得到第二MAC值;
    当所述第一MAC值和所述第二MAC值相同时,根据所述一证书分发密钥。
  13. 根据权利要求11所述的证书导入终端,其特征在于,还包括:
    采用X9.19算法进行所述MAC运算。
  14. 根据权利要求11所述的证书导入终端,其特征在于,所述待验证数据包括写入所述一证书的时间、所述一证书和所述证书链。
  15. 根据权利要求11所述的证书导入终端,其特征在于,所述S2之前,还包括:
    注入所述验证密钥至硬件安全模块。
  16. 根据权利要求9所述的证书导入终端,其特征在于,还包括:
    设置所述根证书的数据类型为常量。
PCT/CN2018/079746 2018-03-21 2018-03-21 一种证书导入方法及终端 WO2019178763A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880000201.8A CN108496323B (zh) 2018-03-21 2018-03-21 一种证书导入方法及终端
PCT/CN2018/079746 WO2019178763A1 (zh) 2018-03-21 2018-03-21 一种证书导入方法及终端

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/079746 WO2019178763A1 (zh) 2018-03-21 2018-03-21 一种证书导入方法及终端

Publications (1)

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

Family

ID=63343520

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/079746 WO2019178763A1 (zh) 2018-03-21 2018-03-21 一种证书导入方法及终端

Country Status (2)

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

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111641502A (zh) * 2020-06-01 2020-09-08 中国农业银行股份有限公司 基于超级柜台的电子证书下载方法及装置
CN115567314A (zh) * 2022-10-14 2023-01-03 中电云数智科技有限公司 一种基于硬件可信信任链的License安全代理方法和平台

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112532390B (zh) * 2019-08-30 2022-05-10 华为技术有限公司 加载数字证书认证机构证书的方法及装置
CN110601855B (zh) * 2019-09-20 2022-05-13 腾讯科技(深圳)有限公司 一种根证书管理方法、装置及电子设备、存储介质
CN112073967B (zh) * 2020-08-14 2022-10-25 中信银行股份有限公司 一种手机盾设备身份证书下载的方法、装置和电子设备

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 (zh) * 2013-03-15 2014-04-16 福建联迪商用设备有限公司 一种终端主密钥tmk安全下载方法及***
US20140250105A1 (en) * 2013-03-04 2014-09-04 Google Inc. Reliable content recommendations
CN105931042A (zh) * 2015-09-22 2016-09-07 ***股份有限公司 一种应用权限管理方法以及智能pos终端

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 (zh) * 2013-12-27 2018-09-21 ***股份有限公司 基于智能pos终端的多应用安全管理***及其方法

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 (zh) * 2013-03-15 2014-04-16 福建联迪商用设备有限公司 一种终端主密钥tmk安全下载方法及***
CN105931042A (zh) * 2015-09-22 2016-09-07 ***股份有限公司 一种应用权限管理方法以及智能pos终端

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111641502A (zh) * 2020-06-01 2020-09-08 中国农业银行股份有限公司 基于超级柜台的电子证书下载方法及装置
CN115567314A (zh) * 2022-10-14 2023-01-03 中电云数智科技有限公司 一种基于硬件可信信任链的License安全代理方法和平台
CN115567314B (zh) * 2022-10-14 2024-01-30 中电云计算技术有限公司 一种基于硬件可信信任链的License安全代理方法和平台

Also Published As

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

Similar Documents

Publication Publication Date Title
US11880808B2 (en) Securing in-app purchases
JP7060362B2 (ja) 電子デバイスのためのイベント証明書
US9838205B2 (en) Network authentication method for secure electronic transactions
JP4067985B2 (ja) アプリケーション認証システムと装置
US8555075B2 (en) Methods and system for storing and retrieving identity mapping information
WO2019178763A1 (zh) 一种证书导入方法及终端
CN112671720B (zh) 一种云平台资源访问控制的令牌构造方法、装置及设备
CN112000951B (zh) 一种访问方法、装置、***、电子设备及存储介质
CN110795126A (zh) 一种固件安全升级***
CN107124431A (zh) 鉴权方法、装置、计算机可读存储介质和鉴权***
CN110677376A (zh) 认证方法、相关设备和***及计算机可读存储介质
US20090119505A1 (en) Transaction method and verification method
TWM595792U (zh) 跨平台授權存取資源的授權存取系統
CN112448946B (zh) 基于区块链的日志审计方法及装置
CN114301617A (zh) 多云应用网关的身份认证方法、装置、计算机设备及介质
WO2019178762A1 (zh) 一种验证终端合法性的方法、服务端及***
CN113271207A (zh) 基于移动电子签名的托管密钥使用方法、***、计算机设备及存储介质
CN111953477B (zh) 终端设备及其标识令牌的生成方法和客户端的交互方法
CN116896463A (zh) 一种基于区块链的可信环境认证方法及装置
US20240113898A1 (en) Secure Module and Method for App-to-App Mutual Trust Through App-Based Identity
TW202116038A (zh) 電子裝置之認證方法及系統
TWI782678B (zh) 應用於數位簽署元件的認證系統及方法
TWI778319B (zh) 跨平台授權存取資源方法及授權存取系統
CN117933993A (zh) 一种交易处理方法、交易处理装置、设备及存储介质
CN116703310A (zh) 资源转移方法、装置、计算机设备和存储介质

Legal Events

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

Ref document number: 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