WO2015161683A1 - Unified apk signing method and system thereof - Google Patents

Unified apk signing method and system thereof Download PDF

Info

Publication number
WO2015161683A1
WO2015161683A1 PCT/CN2015/070254 CN2015070254W WO2015161683A1 WO 2015161683 A1 WO2015161683 A1 WO 2015161683A1 CN 2015070254 W CN2015070254 W CN 2015070254W WO 2015161683 A1 WO2015161683 A1 WO 2015161683A1
Authority
WO
WIPO (PCT)
Prior art keywords
signature
file
public key
acquirer
signed
Prior art date
Application number
PCT/CN2015/070254
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 JP2016563849A priority Critical patent/JP6263644B2/en
Publication of WO2015161683A1 publication Critical patent/WO2015161683A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • 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

Definitions

  • the invention relates to APK The field of signature authentication, especially one that is unified APK Signature method and its system.
  • Bank card( BANK Card As a payment tool is becoming more and more popular, the usual bank card payment system includes a point-of-sale terminal ( Point Of Sale , POS ), POS Receipt system POSP ),password keyboard( PIN PAD ) and hardware encryption machine ( Hardware and Security Module , HSM ). among them POS The terminal can accept the bank card information, has the communication function, and accepts the instructions of the teller to complete the financial transaction information and the related information exchange device; POS Billing system POS Centralized management of terminals, including parameter download, key download, accept, process or forward POS Terminal transaction request, and POS The terminal returns the transaction result information, which is a centralized management and transaction processing system; POS The program above is downloaded and updated by the acquirer. due to Android The versatility of the system, the acquiring agency began to purchase Android systematic POS Terminal Equipment. Android System installation package is called APK , AndroidPackage abbreviation of.
  • POS There are many terminal equipment manufacturers, each manufacturer is improving POS The security of the terminal device will be installed to or allowed to be downloaded.
  • POS The program in the process performs signature verification, and only legitimate signature programs are allowed to install or run. And because the vendor implementation mechanism is different, it can be downloaded and installed to different vendors.
  • Android system POS Terminal APK The signed file format is inconsistent, resulting in the acquisition of different manufacturers by the acquirer. Android system POS Terminal equipment, need to maintain different at the same time APK Signing tool and pair APK Maintaining different versions of signed documents brings cumbersome maintenance work and great maintenance costs to the acquirer, so it is necessary to propose a unified APK Signed scheme, reducing the acquirer’s APK The maintenance cost of the signature.
  • the object of the present invention is to provide a convenient acquiring institution to uniformly manage different manufacturers.
  • the acquirer signature server invokes the encryption device to generate a first public private key pair and a second public private key pair, and the acquirer signature server uses the first private key to perform a signature operation on the second public key to generate an acquirer work public key certificate, which will be a public key is distributed to different vendors CA server;
  • the signing server of the acquiring institution generates the acquiring institution signature information according to the signed source file and the acquiring institution working public key certificate, and then calculates the hash value of the signed source file and the acquiring institution signature information, and generates the hash value.
  • Filling the generated signature file encrypting the signed file with the second private key to generate the acquirer signature data; including the signed source file, the acquirer signature information, the acquirer signature data, and the acquirer work public key certificate
  • Signed APK The file provides downloads of terminal devices from different vendors, where the signed source files include the original APK file;
  • the server After the server generates the acquirer root public key certificate by using the first public key according to the respective certificate generation mechanism, the server pre-installs the acquirer root public key certificate in the vendor's respective terminal device;
  • the terminal device downloads the signed APK File when signed from APK
  • the document extracts the work order public key certificate of the acquirer, and the terminal device verifies the legality of the work order public key certificate of the acquirer by using the acquirer root public key certificate stored in the terminal device, and after the legality verification of the work public key certificate is passed,
  • the terminal device extracts the second public key by using the acquiring public key certificate of the acquiring institution, and decrypts the signature data of the acquiring institution by using the second public key. After the decryption succeeds, the hash value is obtained, and the terminal device signs the signed source file and the acquiring institution.
  • the information calculation generates a verification hash value, and the terminal device determines whether the hash value and the verification hash value are equal, and if they are equal, the original is allowed.
  • APK File installation and operation The document extracts the work order public key certificate of the acquirer, and the terminal device verifies the legality of the work order public key certificate of the acquirer by using the acquirer root public key
  • a unity APK a system for signing, comprising an acquirer server and a terminal device server, the acquirer server comprising a first signature module, a key distribution module, a second signature module, a first computing module, and a first encryption module;
  • the first signing module the encryption device for the acquiring institution generates the first public private key pair and the second public private key pair, and the signing server of the acquiring institution uses the first private key to perform the signature operation on the second public key to generate the acquiring Institutional work public key certificate;
  • the key distribution module is configured to distribute the first public key to different vendors CA server;
  • the second signature module is configured to generate, by the signature server of the acquiring institution, the acquiring institution signature information according to the signed source file and the acquiring institution working public key certificate;
  • the first computing module is configured to calculate, by the signature server of the acquiring institution, the hash value of the signed source file and the acquiring institution signature information, and fill the hash value to generate the signed file;
  • the first encryption module is configured to: the acquiring institution encrypts the signed file by using the second private key to generate the acquiring institution signature data; and includes the signed source file, the acquiring institution signature information, the acquiring institution signature data, and the receiving Single agency work public key certificate signed APK
  • the file provides downloads of terminal devices from different vendors, where the signed source files include the original APK file;
  • the terminal device server includes a second encryption module, a signature file acquisition module, a first decryption module, a second decryption module, and a third decryption module;
  • the second encryption module is used by different vendors CA After the server generates the different acquirer root public key certificates according to the respective mechanisms, the server pre-installs the acquirer root public key certificate in the manufacturer's terminal device;
  • the signature file obtaining module is configured to: sign the signed source file, the acquiring institution signature information, the acquiring institution signature data, and the acquiring institution working public key certificate APK Download files to terminal devices of different vendors;
  • the first decryption module is configured for the terminal device to be signed APK
  • the document extracts the work order public key certificate of the acquiring institution, and the terminal device verifies the legality of the work order public key certificate of the acquiring institution by using the acquirer root public key certificate stored in the terminal device, and the legality of the working public key certificate when the acquiring institution works
  • the second decryption module is sent to the second decryption module;
  • the second decryption module is configured to: the terminal device extracts the second public key by using the occupant working public key certificate, and decrypts the signature data of the acquiring institution by using the second public key, and obtains a hash value after the decryption succeeds;
  • the third decryption module is configured to calculate, by the terminal device, a verification hash value by using the signature source file and the acquirer signature information, and the terminal device determines whether the hash value and the verification hash value are equal, and if they are equal, allow original APK File installation and operation.
  • the acquiring institution only needs to generate a unified signature APK
  • the file can be downloaded to different terminal devices through the verification mechanism of the terminal device, and the signed certificate is guaranteed.
  • APK The integrity of the data in the data transfer process and APK
  • the acquiring institution only needs to maintain a signed document and a set of signature checking mechanism for the terminal equipment of different manufacturers, which greatly reduces the APK The maintenance cost of the signature.
  • Figure 1 Is a unified in an embodiment of the present invention
  • APK An execution flow diagram of the method of signing
  • Figure 2 Is a unified in an embodiment of the present invention
  • APK a composition diagram of the signature system
  • Figure 3 Is a unified in an embodiment of the present invention
  • APK The composition diagram of the terminal device server in the signature system.
  • First signature module 2 Key distribution module; 3 Second signature module;
  • Third decryption module 11 Filling module; 12 First storage module;
  • the invention generates a unified signature by the acquiring institution APK After the file is downloaded, it can be downloaded to the terminal equipment of different manufacturers.
  • the terminal equipment uses the public key distributed by the acquiring institution to carry out the respective inspections to ensure the signature.
  • APK The integrity of the file during the data transfer process and APK
  • the acquiring institution only needs to maintain a signed document and a set of signature implementation mechanism for the terminal equipment of different manufacturers, which greatly reduces the APK The maintenance cost of the signature.
  • APK A block diagram of the method of signing.
  • the unity APK The signature method is applied to the acquirer and the terminal device, and the method includes the following:
  • step S1 The acquirer signature server invokes the encryption device to generate a first public private key pair and a second public private key pair, and the acquirer signature server uses the first private key to perform a signature operation on the second public key to generate an acquirer work public key certificate, which will
  • the first public key is distributed to different vendors CA server;
  • step S2 The signing server of the acquiring institution generates the acquiring institution signature information according to the signed source file and the acquiring institution working public key certificate, and then calculates the hash value of the signed source file and the acquiring institution signature information, and generates a hash value.
  • the file provides downloads of terminal devices from different vendors, where the signed source files include the original APK file;
  • step S3 different manufacturers CA After the server generates the acquirer root public key certificate by using the first public key according to the respective certificate generation mechanism, the server pre-installs the acquirer root public key certificate in the vendor's respective terminal device;
  • step S4 The terminal device downloads the signed APK File when signed from APK
  • the document extracts the work order public key certificate of the acquirer, and the terminal device verifies the legality of the work order public key certificate of the acquirer by using the acquirer root public key certificate stored in the terminal device, and after the legality verification of the work public key certificate is passed,
  • the terminal device extracts the second public key by using the acquiring public key certificate of the acquiring institution, and decrypts the signature data of the acquiring institution by using the second public key. After the decryption succeeds, the hash value is obtained, and the terminal device signs the signed source file and the acquiring institution.
  • the information calculation generates a verification hash value, and the terminal device determines whether the hash value and the verification hash value are equal, and if they are equal, the original is allowed.
  • APK File installation and operation The document extracts the work order public key certificate of the acquirer, and the terminal device verifies the legality of the work order public key certificate of the acquirer by using the acquirer
  • the server After the server generates the acquirer root public key certificate by using the first public key according to the respective certificate generation algorithm, the server pre-installs the acquirer root public key certificate in the manufacturer's terminal device, and the acquirer root generated by each vendor Public key certificates are different and are used for signatures received by each future check.
  • APK file The signed APK The file is verified when different vendors need the program to download and install or the device periodically self-tests. After the verification is passed, the installation and operation are allowed. APK file.
  • the signing server of the acquiring institution uses the hash value according to PKCS#1
  • the signature standard pair is filled to obtain the signed file, and then the second private key is used to encrypt the signed file to generate the acquiring institution signature information, and the acquiring institution working public key certificate, the acquiring institution signature information, and the signature acquiring institution Signature information and signed source files
  • APK Constitute signed APK File then will be signed APK
  • the file is downloaded to the terminal device of different manufacturers, and the hash value is obtained by signing information and original to the acquirer.
  • APK The file is generated by the operation;
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • the method further includes: the step of generating the signed source file before the “signing server of the acquiring institution generates the acquiring institution signature information according to the signed source file and the acquiring institution working public key certificate” Specifically, including:
  • the acquirer signature server will be original APK File tail padding 0x00
  • the four-byte complement is used as the signed source file.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • the “acquisition institution signature information” is used to store a public key certificate including an acquirer work. ID Number, algorithm used for signature, and signature time;
  • the file also includes a signature file header and a signed source file;
  • the signature file header storage includes the original APK File length, signed source file length, acquirer signature information offset and length, used to identify the offset and length of the file that has been signed and signed.
  • the algorithm used by the signature stored in the signature information of the signature authority is preferably SHA-256 with RSA
  • the offset position of the acquirer signature information and the offset length of the signature file are the offset lengths calculated from the beginning of the file.
  • APK A composition diagram of the signature system and a unified embodiment of the present invention
  • APK The composition diagram of the terminal device server in the signature system. Another technical solution provided by the present invention is:
  • a unity APK a signed system comprising an acquirer server and a terminal device server, the acquirer server comprising a first signature module 1 Key distribution module 2 Second signature module 3 First arithmetic module 4 And the first encryption module 5 ;
  • the first signature module 1 The encryption device for the acquiring institution generates the first public private key pair and the second public private key pair, and the signing server of the acquiring institution uses the first private key to perform the signature operation on the second public key to generate the acquiring institution working public key certificate;
  • Key distribution module 2 For distributing the first public key to different vendors CA server;
  • the second signature module 3 The signature server for the acquiring institution generates the acquiring institution signature information according to the signed source file and the acquiring institution working public key certificate;
  • the first computing module 4 The signature server for the acquiring institution calculates the hash value of the signed source file and the acquiring institution signature information, and fills the hash value to generate the signed file;
  • the first encryption module 5 used by the acquiring institution to encrypt the signed document by using the second private key to generate the acquiring institution signature data; and will include the signed source file, the acquiring institution signature information, the acquiring institution signature data, and the acquiring institution working public key certificate.
  • Signed APK The file provides downloads of terminal devices from different vendors, where the signed source files include the original APK file;
  • the terminal device server includes a second encryption module 6 Signature file acquisition module 7 First decryption module 8 Second decryption module 9 And third decryption module 10 ;
  • the second encryption module 6 For different manufacturers CA After the server generates the different acquirer root public key certificates according to the respective mechanisms, the server pre-installs the acquirer root public key certificate in the manufacturer's terminal device;
  • the signature file acquisition module 7 For signatures including signed source files, acquirer signature information, acquirer signature data, and acquirer work public key certificates APK Download files to terminal devices of different vendors;
  • the first decryption module 8 For terminal devices from signed APK The document extracts the work order public key certificate of the acquiring institution, and the terminal device verifies the legality of the work order public key certificate of the acquiring institution by using the acquirer root public key certificate stored in the terminal device, and the legality of the working public key certificate when the acquiring institution works After the verification is passed, the second decryption module is sent to the second decryption module. 9 ;
  • the second decryption module 9 the terminal device uses the acquirer work public key certificate to extract the second public key, and uses the second public key to decrypt the acquirer signature data, and obtains a hash value after successful decryption;
  • the third decryption module 10 And the terminal device calculates, by using the signature source file and the acquiring institution signature information, a verification hash value, and the terminal device determines whether the hash value and the verification hash value are equal, and if they are equal, the original is allowed.
  • APK File installation and operation is used.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • the acquiring institution server further includes a filling module. 11 ;
  • the filling module 11 the signature server used for the acquirer will be original APK File tail padding 0x00 Four bytes are filled to ensure original APK End of file 0x00 After the end, it is used as the encryption source file.
  • the filling module 11 In order to guarantee the original APK The last four bytes of the file are aligned, and the insufficient bits are padded at the end of the file. 0x00 And then make up 4 One 0x00 To ensure that the end of the signed source file is 0x00 .
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • a storage module is further included on the basis of the foregoing solution, and the storage module includes a first storage module. 12 And the second storage module 13 ;
  • the first storage module 12 And storing the work order public key certificate of the acquirer in the signing information of the acquirer ID Number, algorithm used for signature, and signature time;
  • the file also includes a signature file header and a signed source file;
  • the second storage module 13 For storing the signature file header including the original APK
  • the file length, the length of the signed source file, the signing information of the acquiring institution, and the offset position of the signing information of the acquiring institution are used to identify the offset length of the file that has been signed and the signature file.
  • the algorithm used by the signature stored in the signature information of the signature authority is preferably SHA-256 with RSA
  • the offset position of the acquirer signature information and the offset length of the signature file are the offset lengths calculated from the beginning of the file.
  • a uniform provided by the present invention APK
  • the signature method and its system enable the acquirer to generate only one unified signature
  • the file can be downloaded to different terminal devices through the verification mechanism of the terminal device, and the signed certificate is guaranteed.
  • APK File data integrity and data in the data transfer process APK
  • the acquiring institution only needs to maintain a signed document and a set of signature checking mechanism for the terminal equipment of different manufacturers, which greatly reduces the APK The maintenance cost of the signature.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)

Abstract

Disclosed are a unified APK signing method and system thereof, comprising: a receipt institution generates a first public and private key pair and a second public and private key pair, and utilizes the first private key to sign the second public key to generate a receipt institution work public key certificate; the first public key is distributed to terminal devices to generate respective receipt institution root public key certificates to be pre-installed in the terminal device; the receipt institution generates receipt institution signature information according to a signed source file and the receipt institution work public key certificate, calculates the signed source file and the receipt institution signature information to generate a Hash value, fills with the Hash value to generate a signed file, encrypts the signed file using a second private key to generate receipt institution signature data, and downloads the signed APK file to the terminal device; the terminal device checks the validity of the receipt institution work public key certificate using the receipt institution root public key certificate, and then extracts the second public key to decrypt the receipt institution signature data to obtain a Hash value, calculates an authentication Hash value, and determines whether the Hash value is equal to the authentication Hash value; if yes, then allowing the installation and operation of an original APK file.

Description

一种统一APK签名的方法及其系统Method and system for unified APK signature
技术领域Technical field
本发明涉及The invention relates to APKAPK 签名认证领域,尤其涉及一种统一The field of signature authentication, especially one that is unified APKAPK 签名的方法及其系统。Signature method and its system.
背景技术Background technique --
银行卡(Bank card( BANK CardBANK Card )作为支付工具越来越普及,通常的银行卡支付系统包括销售点终端(As a payment tool is becoming more and more popular, the usual bank card payment system includes a point-of-sale terminal ( Point Of SalePoint Of Sale , POSPOS )、), POSPOS 收单系统(Receipt system POSPPOSP )、密码键盘(),password keyboard( PIN PADPIN PAD )和硬件加密机() and hardware encryption machine ( Hardware and Security ModuleHardware and Security Module , HSMHSM )。其中). among them POSPOS 终端能够接受银行卡信息,具有通讯功能,并接受柜员的指令完成金融交易信息和有关信息交换的设备;The terminal can accept the bank card information, has the communication function, and accepts the instructions of the teller to complete the financial transaction information and the related information exchange device; POSPOS 收单系统对Billing system POSPOS 终端进行集中管理,包括参数下载,密钥下载,接受、处理或转发Centralized management of terminals, including parameter download, key download, accept, process or forward POSPOS 终端的交易请求,并向Terminal transaction request, and POSPOS 终端回送交易结果信息,是集中管理和交易处理的系统;收单系统中的The terminal returns the transaction result information, which is a centralized management and transaction processing system; POSPOS 上的程序是由收单机构下载和更新。由于The program above is downloaded and updated by the acquirer. due to AndroidAndroid 系统的通用性,收单机构开始采购The versatility of the system, the acquiring agency began to purchase AndroidAndroid 系统的systematic POSPOS 终端设备。Terminal Equipment. AndroidAndroid 系统安装程序包称为System installation package is called APKAPK , AndroidPackageAndroidPackage 的缩写。abbreviation of.
但由于But because POSPOS 终端设备厂商很多,每个厂商为提高There are many terminal equipment manufacturers, each manufacturer is improving POSPOS 终端设备的安全性,都会对下载安装到或允许在The security of the terminal device will be installed to or allowed to be downloaded. POSPOS 中的程序进行签名验证,只有合法的签名程序才允许安装或运行。并且由于厂商实现机制不同,造成原本可以下载安装到不同厂商The program in the process performs signature verification, and only legitimate signature programs are allowed to install or run. And because the vendor implementation mechanism is different, it can be downloaded and installed to different vendors. AndroidAndroid 系统system POSPOS 终端的Terminal APKAPK ,签名后的文件格式都不一致,导致收单机构采购不同厂商的The signed file format is inconsistent, resulting in the acquisition of different manufacturers by the acquirer. AndroidAndroid 系统system POSPOS 终端设备,需要同时维护不同的Terminal equipment, need to maintain different at the same time APKAPK 签名工具和对同一个Signing tool and pair APKAPK 维护不同版本的已签名文件,给收单机构带来繁琐的维护工作和极大的维护成本,因此有必要提出一种统一Maintaining different versions of signed documents brings cumbersome maintenance work and great maintenance costs to the acquirer, so it is necessary to propose a unified APKAPK 签名的方案,降低收单机构对Signed scheme, reducing the acquirer’s APK APK 签名的维护成本。The maintenance cost of the signature.
发明内容Summary of the invention
本发明的目的在于提供一种方便收单机构统一管理不同厂商的The object of the present invention is to provide a convenient acquiring institution to uniformly manage different manufacturers. AndroidAndroid 系统终端设备的签名,缩减维护成本的一种统一Signature of system terminal equipment, reducing the uniformity of maintenance costs APKAPK 签名的方法及其系统。Signature method and its system.
为实现上述发明目的,本发明采用的一个技术方案是:In order to achieve the above object, one technical solution adopted by the present invention is:
一种统一a unity APKAPK 签名的方法,包括:Signature methods, including:
收单机构签名服务器调用加密设备生成第一公私钥对和第二公私钥对,收单机构签名服务器使用第一私钥对第二公钥进行签名操作生成收单机构工作公钥证书,将第一公钥分发至不同厂商的The acquirer signature server invokes the encryption device to generate a first public private key pair and a second public private key pair, and the acquirer signature server uses the first private key to perform a signature operation on the second public key to generate an acquirer work public key certificate, which will be a public key is distributed to different vendors CACA 服务器;server;
收单机构的签名服务器根据被签名源文件和收单机构工作公钥证书生成收单机构签名信息,然后对被签名源文件和收单机构签名信息进行计算生成哈希值,将哈希值进行填充生成被签名文件,使用第二私钥对被签名文件进行加密生成收单机构签名数据;将包括被签名源文件、收单机构签名信息、收单机构签名数据和收单机构工作公钥证书的已签名The signing server of the acquiring institution generates the acquiring institution signature information according to the signed source file and the acquiring institution working public key certificate, and then calculates the hash value of the signed source file and the acquiring institution signature information, and generates the hash value. Filling the generated signature file, encrypting the signed file with the second private key to generate the acquirer signature data; including the signed source file, the acquirer signature information, the acquirer signature data, and the acquirer work public key certificate Signed APK APK 文件提供不同厂商的终端设备下载,其中,被签名源文件包括原始The file provides downloads of terminal devices from different vendors, where the signed source files include the original APK APK 文件;file;
不同厂商的Different manufacturers CACA 服务器根据各自的证书生成机制使用第一公钥生成收单机构根公钥证书后,将所述收单机构根公钥证书预装在厂商各自的终端设备中;After the server generates the acquirer root public key certificate by using the first public key according to the respective certificate generation mechanism, the server pre-installs the acquirer root public key certificate in the vendor's respective terminal device;
终端设备下载所述已签名The terminal device downloads the signed APK APK 文件时,从已签名File when signed from APK APK 文件中提取收单机构工作公钥证书,终端设备使用存储在终端设备中的收单机构根公钥证书验证收单机构工作公钥证书的合法性,当工作公钥证书的合法性验证通过后,终端设备使用收单机构工作公钥证书提取第二公钥,使用第二公钥解密收单机构签名数据,解密成功后获得哈希值,终端设备通过对被签名源文件和收单机构签名信息计算生成验证哈希值,终端设备判断所述哈希值与验证哈希值是否相等,若相等则允许原始The document extracts the work order public key certificate of the acquirer, and the terminal device verifies the legality of the work order public key certificate of the acquirer by using the acquirer root public key certificate stored in the terminal device, and after the legality verification of the work public key certificate is passed, The terminal device extracts the second public key by using the acquiring public key certificate of the acquiring institution, and decrypts the signature data of the acquiring institution by using the second public key. After the decryption succeeds, the hash value is obtained, and the terminal device signs the signed source file and the acquiring institution. The information calculation generates a verification hash value, and the terminal device determines whether the hash value and the verification hash value are equal, and if they are equal, the original is allowed. APK APK 文件安装及运行。File installation and operation.
本发明采用的另一个技术方案是:Another technical solution adopted by the present invention is:
一种统一a unity APKAPK 签名的系统,包括收单机构服务器和终端设备服务器,所述收单机构服务器包括第一签名模块、密钥分发模块、第二签名模块、第一运算模块和第一加密模块;a system for signing, comprising an acquirer server and a terminal device server, the acquirer server comprising a first signature module, a key distribution module, a second signature module, a first computing module, and a first encryption module;
所述第一签名模块,用于收单机构的加密设备生成第一公私钥对和第二公私钥对,收单机构的签名服务器使用第一私钥对第二公钥进行签名操作生成收单机构工作公钥证书;The first signing module, the encryption device for the acquiring institution generates the first public private key pair and the second public private key pair, and the signing server of the acquiring institution uses the first private key to perform the signature operation on the second public key to generate the acquiring Institutional work public key certificate;
所述密钥分发模块,用于将所述第一公钥分发至不同厂商的The key distribution module is configured to distribute the first public key to different vendors CACA 服务器;server;
所述第二签名模块,用于收单机构的签名服务器根据被签名源文件和收单机构工作公钥证书生成收单机构签名信息;The second signature module is configured to generate, by the signature server of the acquiring institution, the acquiring institution signature information according to the signed source file and the acquiring institution working public key certificate;
所述第一运算模块,用于收单机构的签名服务器对被签名源文件和收单机构签名信息进行计算生成哈希值,将哈希值进行填充生成被签名文件;The first computing module is configured to calculate, by the signature server of the acquiring institution, the hash value of the signed source file and the acquiring institution signature information, and fill the hash value to generate the signed file;
所述第一加密模块:用于收单机构使用第二私钥对被签名文件进行加密生成收单机构签名数据;将包括被签名源文件、收单机构签名信息、收单机构签名数据和收单机构工作公钥证书的已签名The first encryption module is configured to: the acquiring institution encrypts the signed file by using the second private key to generate the acquiring institution signature data; and includes the signed source file, the acquiring institution signature information, the acquiring institution signature data, and the receiving Single agency work public key certificate signed APK APK 文件提供不同厂商的终端设备下载,其中,被签名源文件包括原始The file provides downloads of terminal devices from different vendors, where the signed source files include the original APK APK 文件;file;
所述终端设备服务器包括第二加密模块、签名文件获取模块、第一解密模块、第二解密模块和第三解密模块;The terminal device server includes a second encryption module, a signature file acquisition module, a first decryption module, a second decryption module, and a third decryption module;
所述第二加密模块,用于不同厂商的The second encryption module is used by different vendors CACA 服务器根据各自的机制将第一公钥生成不同收单机构根公钥证书后,将所述收单机构根公钥证书预装在厂商的终端设备中;After the server generates the different acquirer root public key certificates according to the respective mechanisms, the server pre-installs the acquirer root public key certificate in the manufacturer's terminal device;
所述签名文件获取模块,用于将包括被签名源文件、收单机构签名信息、收单机构签名数据和收单机构工作公钥证书的已签名The signature file obtaining module is configured to: sign the signed source file, the acquiring institution signature information, the acquiring institution signature data, and the acquiring institution working public key certificate APKAPK 文件下载至不同厂商的终端设备;Download files to terminal devices of different vendors;
所述第一解密模块,用于终端设备从已签名The first decryption module is configured for the terminal device to be signed APKAPK 文件中提取收单机构工作公钥证书,终端设备使用存储在终端设备中的收单机构根公钥证书验证收单机构工作公钥证书的合法性,当收单机构工作公钥证书的合法性验证通过后发送至所述第二解密模块;The document extracts the work order public key certificate of the acquiring institution, and the terminal device verifies the legality of the work order public key certificate of the acquiring institution by using the acquirer root public key certificate stored in the terminal device, and the legality of the working public key certificate when the acquiring institution works After the verification is passed, the second decryption module is sent to the second decryption module;
所述第二解密模块,用于终端设备使用收单机构工作公钥证书提取第二公钥,使用第二公钥解密收单机构签名数据,解密成功后获得哈希值;The second decryption module is configured to: the terminal device extracts the second public key by using the occupant working public key certificate, and decrypts the signature data of the acquiring institution by using the second public key, and obtains a hash value after the decryption succeeds;
所述第三解密模块,用于终端设备通过对被签名源文件和收单机构签名信息计算生成验证哈希值,终端设备判断所述哈希值与验证哈希值是否相等,若相等则允许原始The third decryption module is configured to calculate, by the terminal device, a verification hash value by using the signature source file and the acquirer signature information, and the terminal device determines whether the hash value and the verification hash value are equal, and if they are equal, allow original APKAPK 文件安装及运行。File installation and operation.
通过本发明,实现了收单机构只要生成一个经过统一签名的Through the invention, the acquiring institution only needs to generate a unified signature APKAPK 文件,就能下载到不同的终端设备上通过终端设备的验签机制,在保证已签名的The file can be downloaded to different terminal devices through the verification mechanism of the terminal device, and the signed certificate is guaranteed. APKAPK 文件在数据传输过程数据的完整性和The integrity of the data in the data transfer process and APKAPK 合法性的同时,收单机构针对不同厂商的终端设备也只需维护一个已签名的文件和一套签名验签机制,大大缩减了收单机构针对At the same time of legitimacy, the acquiring institution only needs to maintain a signed document and a set of signature checking mechanism for the terminal equipment of different manufacturers, which greatly reduces the APKAPK 签名的维护成本。The maintenance cost of the signature.
附图说明DRAWINGS
Figure 11 是本发明一实施方式中一种统一Is a unified in an embodiment of the present invention APKAPK 签名的方法的执行流程框图;An execution flow diagram of the method of signing;
Figure 22 是本发明一实施方式中一种统一Is a unified in an embodiment of the present invention APKAPK 签名系统的组成图;a composition diagram of the signature system;
Figure 33 是本发明一实施方式中一种统一Is a unified in an embodiment of the present invention APKAPK 签名系统中终端设备服务器的组成图。The composition diagram of the terminal device server in the signature system.
主要元件符号说明:The main component symbol description:
、第一签名模块;First signature module;      2 2 、密钥分发模块;Key distribution module;      33 、第二签名模块;Second signature module;
、第一运算模块;First arithmetic module;      55 、第一加密模块;First cryptographic module;      66 、第二加密模块;Second cryptographic module;
、签名文件获取模块;, signature file acquisition module; 8 8 、第一解密模块;First decryption module;      9 9 、第二解密模块;Second decryption module;
、第三解密模块;Third decryption module;         1111 、填充模块;Filling module;     1212 、第一存储模块;First storage module;
、第二存储模块。, the second storage module.
具体实施方式detailed description
本发明通过收单机构生成经过统一签名的The invention generates a unified signature by the acquiring institution APKAPK 文件后可以下载到不同厂商的终端设备,终端设备利用收单机构统一分发的公钥进行各自验签,保证已签名After the file is downloaded, it can be downloaded to the terminal equipment of different manufacturers. The terminal equipment uses the public key distributed by the acquiring institution to carry out the respective inspections to ensure the signature. APKAPK 文件在数据传输过程的完整性和The integrity of the file during the data transfer process and APKAPK 合法性的同时,收单机构针对不同厂商的终端设备也只需维护一个已签名的文件和一套签名实现机制,大大缩减了收单机构针对At the same time of legitimacy, the acquiring institution only needs to maintain a signed document and a set of signature implementation mechanism for the terminal equipment of different manufacturers, which greatly reduces the APKAPK 签名的维护成本。The maintenance cost of the signature.
为详细说明本发明的技术内容、构造特征、所实现目的及效果,以下结合实施方式并配合附图详予说明。The detailed description of the technical contents, structural features, and the objects and effects of the present invention will be described in detail below with reference to the accompanying drawings.
请参阅图Please refer to the picture 11 ,是本发明一实施方式中一种统一Is a unified in an embodiment of the present invention APKAPK 签名的方法的流程框图。该统一A block diagram of the method of signing. The unity APKAPK 签名方法运用于收单机构和终端设备中,该方法包括如下:The signature method is applied to the acquirer and the terminal device, and the method includes the following:
步骤step S1S1 :收单机构签名服务器调用加密设备生成第一公私钥对和第二公私钥对,收单机构签名服务器使用第一私钥对第二公钥进行签名操作生成收单机构工作公钥证书,将第一公钥分发至不同厂商的The acquirer signature server invokes the encryption device to generate a first public private key pair and a second public private key pair, and the acquirer signature server uses the first private key to perform a signature operation on the second public key to generate an acquirer work public key certificate, which will The first public key is distributed to different vendors CACA 服务器;server;
步骤step S2S2 :收单机构的签名服务器根据被签名源文件和收单机构工作公钥证书生成收单机构签名信息,然后对被签名源文件和收单机构签名信息进行计算生成哈希值,将哈希值进行填充生成被签名文件,使用第二私钥对被签名文件进行加密生成收单机构签名数据;将包括被签名源文件、收单机构签名信息、收单机构签名数据和收单机构工作公钥证书的已签名The signing server of the acquiring institution generates the acquiring institution signature information according to the signed source file and the acquiring institution working public key certificate, and then calculates the hash value of the signed source file and the acquiring institution signature information, and generates a hash value. Performing a padding to generate a signed file, and encrypting the signed file with a second private key to generate an acquirer signature data; including a signed source file, an acquirer signature information, an acquirer signature data, and an acquirer work public key Certificate signed APKAPK 文件提供不同厂商的终端设备下载,其中,被签名源文件包括原始The file provides downloads of terminal devices from different vendors, where the signed source files include the original APKAPK 文件;file;
步骤step S3S3 :不同厂商的: different manufacturers CACA 服务器根据各自的证书生成机制使用第一公钥生成收单机构根公钥证书后,将所述收单机构根公钥证书预装在厂商各自的终端设备中;After the server generates the acquirer root public key certificate by using the first public key according to the respective certificate generation mechanism, the server pre-installs the acquirer root public key certificate in the vendor's respective terminal device;
步骤step S4S4 :终端设备下载所述已签名: The terminal device downloads the signed APK APK 文件时,从已签名File when signed from APK APK 文件中提取收单机构工作公钥证书,终端设备使用存储在终端设备中的收单机构根公钥证书验证收单机构工作公钥证书的合法性,当工作公钥证书的合法性验证通过后,终端设备使用收单机构工作公钥证书提取第二公钥,使用第二公钥解密收单机构签名数据,解密成功后获得哈希值,终端设备通过对被签名源文件和收单机构签名信息计算生成验证哈希值,终端设备判断所述哈希值与验证哈希值是否相等,若相等则允许原始The document extracts the work order public key certificate of the acquirer, and the terminal device verifies the legality of the work order public key certificate of the acquirer by using the acquirer root public key certificate stored in the terminal device, and after the legality verification of the work public key certificate is passed, The terminal device extracts the second public key by using the acquiring public key certificate of the acquiring institution, and decrypts the signature data of the acquiring institution by using the second public key. After the decryption succeeds, the hash value is obtained, and the terminal device signs the signed source file and the acquiring institution. The information calculation generates a verification hash value, and the terminal device determines whether the hash value and the verification hash value are equal, and if they are equal, the original is allowed. APK APK 文件安装及运行。File installation and operation.
本方案中所述不同厂商的Different vendors described in this scenario CACA 服务器根据各自的证书生成算法使用第一公钥生成收单机构根公钥证书后,将所述收单机构根公钥证书预装在厂商的终端设备中,每个厂商生成的收单机构根公钥证书都是不一样的,用于日后验签各自收到的已签名After the server generates the acquirer root public key certificate by using the first public key according to the respective certificate generation algorithm, the server pre-installs the acquirer root public key certificate in the manufacturer's terminal device, and the acquirer root generated by each vendor Public key certificates are different and are used for signatures received by each future check. APK APK 文件。所述已签名file. The signed APKAPK 文件是在当不同厂商需要程序下载安装或设备周期性自检时进行验证,验证通过后允许安装和运行的合法The file is verified when different vendors need the program to download and install or the device periodically self-tests. After the verification is passed, the installation and operation are allowed. APKAPK 文件。file.
本方案中,收单机构的签名服务器使用将哈希值按照In this scenario, the signing server of the acquiring institution uses the hash value according to PKCS#1 PKCS#1 签名标准对进行填充后得到被签名文件,再使用第二私钥对被签名文件进行加密生成收单机构签名信息,将收单机构工作公钥证书、收单机构签名信息、签名收单机构的签名信息和被签名的源文件The signature standard pair is filled to obtain the signed file, and then the second private key is used to encrypt the signed file to generate the acquiring institution signature information, and the acquiring institution working public key certificate, the acquiring institution signature information, and the signature acquiring institution Signature information and signed source files APKAPK 构成已签名的Constitute signed APK APK 文件,然后将已签名的File, then will be signed APK APK 文件下载至不同厂商的终端设备,哈希值是通过对收单机构签名信息和原始The file is downloaded to the terminal device of different manufacturers, and the hash value is obtained by signing information and original to the acquirer. APKAPK 文件进行运算生成;The file is generated by the operation;
实施方式一:Embodiment 1:
在上述方案的基础上还包括,所述“收单机构的签名服务器根据被签名源文件和收单机构工作公钥证书生成收单机构签名信息”之前还包括所述被签名源文件的生成步骤,具体包括:And the method further includes: the step of generating the signed source file before the “signing server of the acquiring institution generates the acquiring institution signature information according to the signed source file and the acquiring institution working public key certificate” Specifically, including:
收单机构签名服务器将原始The acquirer signature server will be original APKAPK 文件尾填充File tail padding 0x000x00 四字节补齐作为被签名源文件。The four-byte complement is used as the signed source file.
本实施方式中,为保证所述原始In this embodiment, to ensure the original APKAPK 文件使之四字节对齐,将不足位的在文件尾填充The file is aligned in four bytes, filling the end of the file with insufficient bits 0x000x00 ,之后再补And then make up 44 One 0x000x00 ,确保被签名源文件的末尾为To ensure that the end of the signed source file is 0x000x00 .
实施方式二:Embodiment 2:
在上述方案的基础上还包括,所述“收单机构签名信息”用于存储包括收单机构工作公钥证书的In addition to the foregoing solution, the “acquisition institution signature information” is used to store a public key certificate including an acquirer work. IDID 号、签名使用的算法和签名时间;Number, algorithm used for signature, and signature time;
所述“已签名Said "signed APKAPK 文件”还包括签名文件头和被签名源文件;The file also includes a signature file header and a signed source file;
所述签名文件头存储包括原始The signature file header storage includes the original APKAPK 文件长度、被签名源文件长度、收单机构签名信息偏移和长度、用于标识该文件已被签名及签名文件的偏移及长度。File length, signed source file length, acquirer signature information offset and length, used to identify the offset and length of the file that has been signed and signed.
本实施方式中,所述签名机构签名信息中存储的签名使用的算法优选为In this embodiment, the algorithm used by the signature stored in the signature information of the signature authority is preferably SHA-256SHA-256 with RSARSA ;所述收单机构签名信息的偏移位置和签名文件的偏移长度均是从文件最开始处计算得出的偏移长度。The offset position of the acquirer signature information and the offset length of the signature file are the offset lengths calculated from the beginning of the file.
请参阅图Please refer to the picture 2-2- Figure 33 ,分别为本发明的一种统一, respectively, is a unity of the invention APKAPK 签名系统的组成图和本发明一实施方式中一种统一A composition diagram of the signature system and a unified embodiment of the present invention APKAPK 签名系统中终端设备服务器的组成图。本发明提供的另一种技术方案为:The composition diagram of the terminal device server in the signature system. Another technical solution provided by the present invention is:
一种统一a unity APKAPK 签名的系统,包括收单机构服务器和终端设备服务器,所述收单机构服务器包括第一签名模块a signed system comprising an acquirer server and a terminal device server, the acquirer server comprising a first signature module 11 、密钥分发模块Key distribution module 22 、第二签名模块Second signature module 33 、第一运算模块First arithmetic module 44 和第一加密模块And the first encryption module 55 ;
所述第一签名模块The first signature module 11 ,用于收单机构的加密设备生成第一公私钥对和第二公私钥对,收单机构的签名服务器使用第一私钥对第二公钥进行签名操作生成收单机构工作公钥证书;The encryption device for the acquiring institution generates the first public private key pair and the second public private key pair, and the signing server of the acquiring institution uses the first private key to perform the signature operation on the second public key to generate the acquiring institution working public key certificate;
所述密钥分发模块Key distribution module 22 ,用于将所述第一公钥分发至不同厂商的For distributing the first public key to different vendors CACA 服务器;server;
所述第二签名模块The second signature module 33 ,用于收单机构的签名服务器根据被签名源文件和收单机构工作公钥证书生成收单机构签名信息;The signature server for the acquiring institution generates the acquiring institution signature information according to the signed source file and the acquiring institution working public key certificate;
所述第一运算模块The first computing module 44 ,用于收单机构的签名服务器对被签名源文件和收单机构签名信息进行计算生成哈希值,将哈希值进行填充生成被签名文件;The signature server for the acquiring institution calculates the hash value of the signed source file and the acquiring institution signature information, and fills the hash value to generate the signed file;
所述第一加密模块The first encryption module 55 :用于收单机构使用第二私钥对被签名文件进行加密生成收单机构签名数据;将包括被签名源文件、收单机构签名信息、收单机构签名数据和收单机构工作公钥证书的已签名: used by the acquiring institution to encrypt the signed document by using the second private key to generate the acquiring institution signature data; and will include the signed source file, the acquiring institution signature information, the acquiring institution signature data, and the acquiring institution working public key certificate. Signed APKAPK 文件提供不同厂商的终端设备下载,其中,被签名源文件包括原始The file provides downloads of terminal devices from different vendors, where the signed source files include the original APKAPK 文件;file;
所述终端设备服务器包括第二加密模块The terminal device server includes a second encryption module 66 、签名文件获取模块Signature file acquisition module 77 、第一解密模块First decryption module 88 、第二解密模块Second decryption module 99 和第三解密模块And third decryption module 1010 ;
所述第二加密模块The second encryption module 66 ,用于不同厂商的For different manufacturers CACA 服务器根据各自的机制将第一公钥生成不同收单机构根公钥证书后,将所述收单机构根公钥证书预装在厂商的终端设备中;After the server generates the different acquirer root public key certificates according to the respective mechanisms, the server pre-installs the acquirer root public key certificate in the manufacturer's terminal device;
所述签名文件获取模块The signature file acquisition module 77 ,用于将包括被签名源文件、收单机构签名信息、收单机构签名数据和收单机构工作公钥证书的已签名For signatures including signed source files, acquirer signature information, acquirer signature data, and acquirer work public key certificates APKAPK 文件下载至不同厂商的终端设备;Download files to terminal devices of different vendors;
所述第一解密模块The first decryption module 88 ,用于终端设备从已签名For terminal devices from signed APKAPK 文件中提取收单机构工作公钥证书,终端设备使用存储在终端设备中的收单机构根公钥证书验证收单机构工作公钥证书的合法性,当收单机构工作公钥证书的合法性验证通过后发送至所述第二解密模块The document extracts the work order public key certificate of the acquiring institution, and the terminal device verifies the legality of the work order public key certificate of the acquiring institution by using the acquirer root public key certificate stored in the terminal device, and the legality of the working public key certificate when the acquiring institution works After the verification is passed, the second decryption module is sent to the second decryption module. 99 ;
所述第二解密模块The second decryption module 99 ,用于终端设备使用收单机构工作公钥证书提取第二公钥,使用第二公钥解密收单机构签名数据,解密成功后获得哈希值;, the terminal device uses the acquirer work public key certificate to extract the second public key, and uses the second public key to decrypt the acquirer signature data, and obtains a hash value after successful decryption;
所述第三解密模块The third decryption module 1010 ,用于终端设备通过对被签名源文件和收单机构签名信息计算生成验证哈希值,终端设备判断所述哈希值与验证哈希值是否相等,若相等则允许原始And the terminal device calculates, by using the signature source file and the acquiring institution signature information, a verification hash value, and the terminal device determines whether the hash value and the verification hash value are equal, and if they are equal, the original is allowed. APKAPK 文件安装及运行。File installation and operation.
实施例一:Embodiment 1:
在上述方案的基础上还包括,所述收单机构服务器还包括填充模块In addition to the foregoing solution, the acquiring institution server further includes a filling module. 1111 ;
所述填充模块The filling module 1111 ,用于收单机构的签名服务器将原始, the signature server used for the acquirer will be original APKAPK 文件尾填充File tail padding 0x000x00 四字节补齐,确保原始Four bytes are filled to ensure original APKAPK 文件尾以End of file 0x000x00 结尾后作为加密源文件。After the end, it is used as the encryption source file.
本实施方式中,填充模块In this embodiment, the filling module 1111 为了保证原始In order to guarantee the original APKAPK 文件尾四字节对齐,不足位的在文件尾填充The last four bytes of the file are aligned, and the insufficient bits are padded at the end of the file. 0x000x00 ,之后再补And then make up 44 One 0x000x00 ,确保被签名源文件的末尾为To ensure that the end of the signed source file is 0x000x00 .
实施例二:Embodiment 2:
在上述方案的基础上还包括存储模块,所述存储模块包括第一存储模块A storage module is further included on the basis of the foregoing solution, and the storage module includes a first storage module. 1212 和第二存储模块And the second storage module 1313 ;
所述第一存储模块The first storage module 1212 ,用于存储所述收单机构签名信息中的收单机构工作公钥证书的And storing the work order public key certificate of the acquirer in the signing information of the acquirer IDID 号、签名使用的算法和签名时间;Number, algorithm used for signature, and signature time;
所述“已签名Said "signed APKAPK 文件”还包括签名文件头和被签名源文件;The file also includes a signature file header and a signed source file;
所述第二存储模块The second storage module 1313 ,用于存储所述签名文件头中包括原始For storing the signature file header including the original APKAPK 文件长度、被签名源文件长度、收单机构签名信息、收单机构签名信息的偏移位置,用于标识该文件已被签名及签名文件的偏移长度。The file length, the length of the signed source file, the signing information of the acquiring institution, and the offset position of the signing information of the acquiring institution are used to identify the offset length of the file that has been signed and the signature file.
本实施方式中,所述签名机构签名信息中存储的签名使用的算法优选为In this embodiment, the algorithm used by the signature stored in the signature information of the signature authority is preferably SHA-256SHA-256 with RSARSA ;所述收单机构签名信息的偏移位置和签名文件的偏移长度均是从文件最开始处计算得出的偏移长度。The offset position of the acquirer signature information and the offset length of the signature file are the offset lengths calculated from the beginning of the file.
本发明提供的一种统一A uniform provided by the present invention APKAPK 签名的方法及其系统,实现了收单机构只需生成一个经过统一签名的The signature method and its system enable the acquirer to generate only one unified signature APKAPK 文件,就能下载到不同的终端设备上通过终端设备的验签机制,在保证已签名的The file can be downloaded to different terminal devices through the verification mechanism of the terminal device, and the signed certificate is guaranteed. APKAPK 文件在数据传输过程数据放入完整性和File data integrity and data in the data transfer process APKAPK 合法性的同时,收单机构针对不同厂商的终端设备也只需维护一个已签名的文件和一套签名验签机制,大大缩减了收单机构针对At the same time of legitimacy, the acquiring institution only needs to maintain a signed document and a set of signature checking mechanism for the terminal equipment of different manufacturers, which greatly reduces the APKAPK 签名的维护成本。The maintenance cost of the signature.
以上所述仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above is only the embodiment of the present invention, and is not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformation of the present invention and the contents of the drawings may be directly or indirectly applied to other related technologies. The fields are all included in the scope of patent protection of the present invention.
 

Claims (6)

  1. 一种统一APK签名的方法,其特征在于,包括:A method for unifying APK signature, characterized in that it comprises:
    收单机构签名服务器调用加密设备生成第一公私钥对和第二公私钥对,收单机构签名服务器使用第一私钥对第二公钥进行签名操作生成收单机构工作公钥证书,将第一公钥分发至不同厂商的CA服务器;The acquirer signature server invokes the encryption device to generate a first public private key pair and a second public private key pair, and the acquirer signature server uses the first private key to perform a signature operation on the second public key to generate an acquirer work public key certificate, which will be A public key is distributed to CA servers of different vendors;
    收单机构的签名服务器根据被签名源文件和收单机构工作公钥证书生成收单机构签名信息,然后对被签名源文件和收单机构签名信息进行计算生成哈希值,将哈希值进行填充生成被签名文件,使用第二私钥对被签名文件进行加密生成收单机构签名数据;将包括被签名源文件、收单机构签名信息、收单机构签名数据和收单机构工作公钥证书的已签名APK文件提供不同厂商的终端设备下载,其中,被签名源文件包括原始APK文件;The signing server of the acquiring institution generates the acquiring institution signature information according to the signed source file and the acquiring institution working public key certificate, and then calculates the hash value of the signed source file and the acquiring institution signature information, and generates the hash value. Filling the generated signature file, encrypting the signed file with the second private key to generate the acquirer signature data; including the signed source file, the acquirer signature information, the acquirer signature data, and the acquirer work public key certificate The signed APK file provides downloading of terminal devices from different vendors, wherein the signed source file includes the original APK file;
    不同厂商的CA服务器根据各自的证书生成机制使用第一公钥生成收单机构根公钥证书后,将所述收单机构根公钥证书预装在厂商各自的终端设备中;After the CA server of different vendors generates the acquirer root public key certificate by using the first public key according to the respective certificate generation mechanism, the root public key certificate of the acquirer is pre-installed in the respective terminal devices of the manufacturer;
    终端设备下载所述已签名APK文件时,从已签名APK文件中提取收单机构工作公钥证书,终端设备使用存储在终端设备中的收单机构根公钥证书验证收单机构工作公钥证书的合法性,当工作公钥证书的合法性验证通过后,终端设备使用收单机构工作公钥证书提取第二公钥,使用第二公钥解密收单机构签名数据,解密成功后获得哈希值,终端设备通过对被签名源文件和收单机构签名信息计算生成验证哈希值,终端设备判断所述哈希值与验证哈希值是否相等,若相等则允许原始APK文件安装及运行。When the terminal device downloads the signed APK file, the acquiring institution work public key certificate is extracted from the signed APK file, and the terminal device verifies the acquiring institution working public key certificate by using the acquirer root public key certificate stored in the terminal device. Legitimacy, when the validity of the work public key certificate is verified, the terminal device extracts the second public key using the work order public key certificate of the acquirer, decrypts the signature data of the acquirer using the second public key, and obtains the hash after the decryption succeeds. The terminal device calculates and generates a verification hash value by using the signed source file and the acquirer signature information, and the terminal device determines whether the hash value and the verification hash value are equal. If they are equal, the original APK file is allowed to be installed and run.
  2. 根据权利要求1所述的一种统一APK签名的方法,其特征在于,所述“收单机构的签名服务器根据被签名源文件和收单机构工作公钥证书生成收单机构签名信息”之前还包括所述被签名源文件的生成步骤,具体包括:The method for unifying APK signature according to claim 1, wherein the "signing server of the acquiring institution generates the acquiring institution signature information according to the signed source file and the acquiring institution working public key certificate" The step of generating the signed source file includes:
    收单机构签名服务器将原始APK文件尾填充0x00四字节补齐作为被签名源文件。The acquirer signature server fills the original APK file with 0x00 four-byte padding as the signed source file.
  3. 根据权利要求1所述的一种统一APK签名的方法,其特征在于,所述“收单机构签名信息”用于存储包括收单机构工作公钥证书的ID号、签名使用的算法和签名时间;The method for unifying APK signature according to claim 1, wherein the "acquisition institution signature information" is used for storing an ID number including an occupant working public key certificate, an algorithm used for signature, and a signature time. ;
    所述“已签名APK文件”还包括签名文件头和被签名源文件;The "signed signature file" further includes a signature file header and a signed source file;
    所述签名文件头存储包括原始APK文件长度、被签名源文件长度、收单机构签名信息、收单机构签名信息的偏移位置,用于标识该文件已被签名及签名文件的偏移长度。The signature file header stores an offset position including an original APK file length, a signed source file length, an acquirer signature information, and an acquirer signature information, and is used to identify that the file has been signed and the offset length of the signature file.
     
  4. 一种统一APK签名的系统,其特征在于,包括收单机构服务器和终端设备服务器,所述收单机构服务器包括第一签名模块、密钥分发模块、第二签名模块、第一运算模块和第一加密模块;A unified APK signature system, comprising: an acquirer server and a terminal device server, wherein the acquirer server comprises a first signature module, a key distribution module, a second signature module, a first computing module, and a An encryption module;
    所述第一签名模块,用于收单机构的加密设备生成第一公私钥对和第二公私钥对,收单机构的签名服务器使用第一私钥对第二公钥进行签名操作生成收单机构工作公钥证书;The first signing module, the encryption device for the acquiring institution generates the first public private key pair and the second public private key pair, and the signing server of the acquiring institution uses the first private key to perform the signature operation on the second public key to generate the acquiring Institutional work public key certificate;
    所述密钥分发模块,用于将所述第一公钥分发至不同厂商的CA服务器;The key distribution module is configured to distribute the first public key to a CA server of a different vendor;
    所述第二签名模块,用于收单机构的签名服务器根据被签名源文件和收单机构工作公钥证书生成收单机构签名信息;The second signature module is configured to generate, by the signature server of the acquiring institution, the acquiring institution signature information according to the signed source file and the acquiring institution working public key certificate;
    所述第一运算模块,用于收单机构的签名服务器对被签名源文件和收单机构签名信息进行计算生成哈希值,将哈希值进行填充生成被签名文件;The first computing module is configured to calculate, by the signature server of the acquiring institution, the hash value of the signed source file and the acquiring institution signature information, and fill the hash value to generate the signed file;
    所述第一加密模块:用于收单机构使用第二私钥对被签名文件进行加密生成收单机构签名数据;将包括被签名源文件、收单机构签名信息、收单机构签名数据和收单机构工作公钥证书的已签名APK文件提供不同厂商的终端设备下载,其中,被签名源文件包括原始APK文件;The first encryption module is configured to: the acquiring institution encrypts the signed file by using the second private key to generate the acquiring institution signature data; and includes the signed source file, the acquiring institution signature information, the acquiring institution signature data, and the receiving The signed APK file of the single institution work public key certificate provides terminal device downloads of different vendors, wherein the signed source file includes the original APK file;
    所述终端设备服务器包括第二加密模块、签名文件获取模块、第一解密模块、第二解密模块和第三解密模块;The terminal device server includes a second encryption module, a signature file acquisition module, a first decryption module, a second decryption module, and a third decryption module;
    所述第二加密模块,用于不同厂商的CA服务器根据各自的机制将第一公钥生成不同收单机构根公钥证书后,将所述收单机构根公钥证书预装在厂商的终端设备中;The second encryption module is configured to: after the CA server of different vendors generates different acquirer root public key certificates according to respective mechanisms, pre-install the acquirer root public key certificate in the manufacturer's terminal. In the equipment;
    所述签名文件获取模块,用于将包括被签名源文件、收单机构签名信息、收单机构签名数据和收单机构工作公钥证书的已签名APK文件下载至不同厂商的终端设备;The signature file obtaining module is configured to download a signed APK file including a signed source file, an acquirer signature information, an acquirer signature data, and an acquirer work public key certificate to a terminal device of a different manufacturer;
    所述第一解密模块,用于终端设备从已签名APK文件中提取收单机构工作公钥证书,终端设备使用存储在终端设备中的收单机构根公钥证书验证收单机构工作公钥证书的合法性,当收单机构工作公钥证书的合法性验证通过后发送至所述第二解密模块;The first decryption module is configured to: the terminal device extracts an acquirer work public key certificate from the signed APK file, and the terminal device verifies the acquirer work public key certificate by using the acquirer root public key certificate stored in the terminal device. The legality is sent to the second decryption module after the legality verification of the work order public key certificate of the acquirer is passed;
    所述第二解密模块,用于终端设备使用收单机构工作公钥证书提取第二公钥,使用第二公钥解密收单机构签名数据,解密成功后获得哈希值;The second decryption module is configured to: the terminal device extracts the second public key by using the occupant working public key certificate, and decrypts the signature data of the acquiring institution by using the second public key, and obtains a hash value after the decryption succeeds;
    所述第三解密模块,用于终端设备通过对被签名源文件和收单机构签名信息计算生成验证哈希值,终端设备判断所述哈希值与验证哈希值是否相等,若相等则允许原始APK 文件安装及运行。The third decryption module is configured to calculate, by the terminal device, a verification hash value by using the signature source file and the acquirer signature information, and the terminal device determines whether the hash value and the verification hash value are equal, and if they are equal, allow The original APK file is installed and running.
  5. 根据权利要求4所述的一种统一APK签名的系统,其特征在于,所述收单机构服务器还包括填充模块;The unified APK signature system according to claim 4, wherein the acquirer server further comprises a filling module;
    所述填充模块,用于收单机构的签名服务器将原始APK文件尾填充0x00四字节补齐,确保原始APK文件尾以0x00结尾后作为加密源文件。The filling module is used by the signing server of the acquiring institution to fill the original APK file with 0x00 four-bytes to ensure that the original APK file ends with 0x00 and is used as the encryption source file.
  6. 根据权利要求4所述的一种统一APK签名的方法,其特征在于,还包括存储模块,所述存储模块包括第一存储模块和第二存储模块;A method for unifying APK signature according to claim 4, further comprising a storage module, the storage module comprising a first storage module and a second storage module;
    所述第一存储模块,用于存储所述收单机构签名信息中的收单机构工作公钥证书的ID号、签名使用的算法和签名时间;The first storage module is configured to store an ID number of the work function public key certificate of the acquirer in the signing information of the acquirer, an algorithm used by the signature, and a signature time;
    所述“已签名APK文件”还包括签名文件头和被签名源文件;The "signed signature file" further includes a signature file header and a signed source file;
    所述第二存储模块,用于存储所述签名文件头中包括原始APK文件长度、被签名源文件长度、收单机构签名信息、收单机构签名信息的偏移位置,用于标识该文件已被签名及签名文件的偏移长度。The second storage module is configured to store, in the signature file header, an offset position including an original APK file length, a signed source file length, an acquirer signature information, and an acquirer signature information, where the identifier is used to identify that the file has been The offset length of the signed and signed file.
PCT/CN2015/070254 2014-04-23 2015-01-07 Unified apk signing method and system thereof WO2015161683A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016563849A JP6263644B2 (en) 2014-04-23 2015-01-07 Method and system for unifying APK signature

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410165104.8A CN103905207B (en) 2014-04-23 2014-04-23 Method and system for unifying APK signature
CN201410165104.8 2014-04-23

Publications (1)

Publication Number Publication Date
WO2015161683A1 true WO2015161683A1 (en) 2015-10-29

Family

ID=50996364

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/070254 WO2015161683A1 (en) 2014-04-23 2015-01-07 Unified apk signing method and system thereof

Country Status (3)

Country Link
JP (1) JP6263644B2 (en)
CN (1) CN103905207B (en)
WO (1) WO2015161683A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020227316A3 (en) * 2019-05-07 2020-12-17 Qualcomm Incorporated Architecture for device ownership, data provenance, governance and trade
CN112364308A (en) * 2020-11-13 2021-02-12 四川长虹电器股份有限公司 Online authorized android APK signature method and device
CN114666063A (en) * 2022-03-21 2022-06-24 矩阵时光数字科技有限公司 Traditional Hash algorithm-based digital asset tracing method
CN117118759A (en) * 2023-10-24 2023-11-24 四川省数字证书认证管理中心有限公司 Method for reliable use of user control server terminal key

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103944903B (en) * 2014-04-23 2017-02-15 福建联迪商用设备有限公司 Multi-party authorized APK signature method and system
CN103905207B (en) * 2014-04-23 2017-02-01 福建联迪商用设备有限公司 Method and system for unifying APK signature
SG10201509221YA (en) 2015-11-06 2017-06-29 Huawei Int Pte Ltd System and method for managing installation of an application package requiring high-risk permission access
CN105391717B (en) * 2015-11-13 2019-01-04 福建联迪商用设备有限公司 A kind of APK signature authentication method and its system
CN106921497A (en) * 2015-12-25 2017-07-04 北京握奇智能科技有限公司 A kind of electric endorsement method and device
CN105553672A (en) * 2015-12-25 2016-05-04 北京握奇智能科技有限公司 Electronic signature method and device
CN105787357B (en) * 2016-03-28 2019-01-04 福建联迪商用设备有限公司 One kind being based on Android system APK method for down loading and its system
CN105743910B (en) * 2016-03-30 2019-01-04 福建联迪商用设备有限公司 Pass through the method and system of digital signature installation procedure
CN106130718B (en) * 2016-06-29 2019-05-21 谈建 A kind of the signed data generation method and verification method of digital record
CN106569865B (en) * 2016-11-14 2020-04-10 青岛海信移动通信技术股份有限公司 Method and device for manufacturing system upgrade file of terminal
CN106910066A (en) * 2017-01-22 2017-06-30 武汉慧通云信息科技有限公司 A kind of payment encryption storage system and method based on block chain technology
CN106656513B (en) * 2017-02-24 2019-09-13 福建魔方电子科技有限公司 The secondary packing signature verification method of APK file on Android platform
CN107769924B (en) * 2017-09-11 2023-04-14 福建新大陆支付技术有限公司 Method and system for verifying APK signature of POS machine
CN108595969A (en) * 2018-04-20 2018-09-28 浙江正泰仪器仪表有限责任公司 A kind of signature and method of calibration, device of file
CN110661621A (en) * 2018-06-28 2020-01-07 中车株洲电力机车研究所有限公司 Mixed encryption and decryption method based on HMAC, AES and RSA
CN109756340B (en) * 2018-12-03 2022-10-21 深圳市新国都支付技术有限公司 Digital signature verification method, device and storage medium
CN109670828B (en) * 2018-12-06 2020-12-11 福建联迪商用设备有限公司 Application online signature method and system
CN109948375A (en) * 2019-03-21 2019-06-28 北京深思数盾科技股份有限公司 A kind of verification method and encryption equipment of encryption lock
CN110880969B (en) * 2019-10-18 2021-10-22 如般量子科技有限公司 Method and system for generating QKD network authentication key based on alliance chain and implicit certificate
CN111787529B (en) * 2020-07-17 2021-06-29 江苏海全科技有限公司 Signature method and system suitable for Android intelligent POS machine application
CN112328279B (en) * 2020-11-02 2023-04-14 宁波和利时信息安全研究院有限公司 System firmware file upgrading method, device and system
CN114499891B (en) * 2022-03-21 2024-05-31 宁夏凯信特信息科技有限公司 Signature server system and signature verification method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101322349A (en) * 2005-12-12 2008-12-10 高通股份有限公司 Certify and split system and method for replacing cryptographic keys
CN102064939A (en) * 2009-11-13 2011-05-18 福建联迪商用设备有限公司 Method for authenticating point of sail (POS) file and method for maintaining authentication certificate
CN102467789A (en) * 2010-11-18 2012-05-23 卓望数码技术(深圳)有限公司 Retail outlet account transfer operating system and transaction data encryption transmission method
CN103067401A (en) * 2013-01-10 2013-04-24 天地融科技股份有限公司 Method and system for key protection
CN103684768A (en) * 2012-09-10 2014-03-26 中国银联股份有限公司 POS system and method for bidirectional authentication in POS system
CN103905207A (en) * 2014-04-23 2014-07-02 福建联迪商用设备有限公司 Method and system for unifying APK signature

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008136063A (en) * 2006-11-29 2008-06-12 Tadayuki Hattori P2p network application software program for efficiently distributing literary work in information communication network while protecting copyright and the distribution technique thereof
CN101938473B (en) * 2010-08-24 2013-09-11 北京易恒信认证科技有限公司 Single-point login system and single-point login method
CN101938520B (en) * 2010-09-07 2015-01-28 中兴通讯股份有限公司 Mobile terminal signature-based remote payment system and method
US8566937B2 (en) * 2010-10-04 2013-10-22 Panasonic Corporation Information processing apparatus and method for preventing unauthorized cooperation of applications
CN102087605B (en) * 2011-01-28 2014-05-07 宇龙计算机通信科技(深圳)有限公司 Android-based platform application installation control method and system
US8387141B1 (en) * 2011-09-27 2013-02-26 Green Head LLC Smartphone security system
JP5723760B2 (en) * 2011-12-28 2015-05-27 Kddi株式会社 Application analysis apparatus, application analysis system, and program
CN102891843B (en) * 2012-09-18 2015-04-29 北京深思洛克软件技术股份有限公司 Method for authorizing application program at android client side through local service unit
CN103473500A (en) * 2013-09-06 2013-12-25 成都三零瑞通移动通信有限公司 APK (Android Package) signature verification method in Android system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101322349A (en) * 2005-12-12 2008-12-10 高通股份有限公司 Certify and split system and method for replacing cryptographic keys
CN102064939A (en) * 2009-11-13 2011-05-18 福建联迪商用设备有限公司 Method for authenticating point of sail (POS) file and method for maintaining authentication certificate
CN102467789A (en) * 2010-11-18 2012-05-23 卓望数码技术(深圳)有限公司 Retail outlet account transfer operating system and transaction data encryption transmission method
CN103684768A (en) * 2012-09-10 2014-03-26 中国银联股份有限公司 POS system and method for bidirectional authentication in POS system
CN103067401A (en) * 2013-01-10 2013-04-24 天地融科技股份有限公司 Method and system for key protection
CN103905207A (en) * 2014-04-23 2014-07-02 福建联迪商用设备有限公司 Method and system for unifying APK signature

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020227316A3 (en) * 2019-05-07 2020-12-17 Qualcomm Incorporated Architecture for device ownership, data provenance, governance and trade
CN112364308A (en) * 2020-11-13 2021-02-12 四川长虹电器股份有限公司 Online authorized android APK signature method and device
CN114666063A (en) * 2022-03-21 2022-06-24 矩阵时光数字科技有限公司 Traditional Hash algorithm-based digital asset tracing method
CN114666063B (en) * 2022-03-21 2023-09-19 矩阵时光数字科技有限公司 Digital asset tracing method based on traditional hash algorithm
CN117118759A (en) * 2023-10-24 2023-11-24 四川省数字证书认证管理中心有限公司 Method for reliable use of user control server terminal key
CN117118759B (en) * 2023-10-24 2024-01-30 四川省数字证书认证管理中心有限公司 Method for reliable use of user control server terminal key

Also Published As

Publication number Publication date
JP6263644B2 (en) 2018-01-17
CN103905207A (en) 2014-07-02
JP2017516134A (en) 2017-06-15
CN103905207B (en) 2017-02-01

Similar Documents

Publication Publication Date Title
WO2015161683A1 (en) Unified apk signing method and system thereof
JP6263643B2 (en) APK signing method and system for multiparty credit inquiry
EP3349393B1 (en) Mutual authentication of confidential communication
CN108241517B (en) Software upgrading method, client and electronic equipment
US20180276664A1 (en) Key download method and apparatus for pos terminal
WO2017166561A1 (en) Method of downloading android apk and system thereof
CN107464109B (en) Trusted mobile payment device, system and method
US20160028548A1 (en) Key downloading method, management method, downloading management method, device and system
US20150039890A1 (en) Method and device for secure communications over a network using a hardware security engine
CA3164765A1 (en) Secure communication method and device based on identity authentication
CN106789075B (en) POS digital signature anti-cutting system
WO2019080110A1 (en) Apk signature authentication method and system
JP2010514000A (en) Method for securely storing program state data in an electronic device
CN105162607A (en) Authentication method and system of payment bill voucher
US11966912B2 (en) System and method for cryptographic-chain-based verification of postage transaction records
WO2019178762A1 (en) Method, server, and system for verifying validity of terminal
CN111241492A (en) Product multi-tenant secure credit granting method, system and electronic equipment
CN107301545B (en) Transaction verification method based on timestamp
CN116909603A (en) Vehicle safety upgrading method and system
CN110210189B (en) Software verification method, software and hardware binding method and programmable device thereof
England et al. Towards a programmable TPM
CN109981264A (en) A kind of application key generation method and cipher machine apparatus assembly
TWI766608B (en) Program signing method
CN109816389B (en) POS machine signature verification method and system
CN114726539B (en) Trusted Cryptography Module (TCM) -based offline upgrading method

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: IDP00201606321

Country of ref document: ID

ENP Entry into the national phase

Ref document number: 2016563849

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15783583

Country of ref document: EP

Kind code of ref document: A1