CN111797434A - File editing method and device - Google Patents

File editing method and device Download PDF

Info

Publication number
CN111797434A
CN111797434A CN202010443420.2A CN202010443420A CN111797434A CN 111797434 A CN111797434 A CN 111797434A CN 202010443420 A CN202010443420 A CN 202010443420A CN 111797434 A CN111797434 A CN 111797434A
Authority
CN
China
Prior art keywords
file
signed
official seal
data
signature
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010443420.2A
Other languages
Chinese (zh)
Other versions
CN111797434B (en
Inventor
李月华
刘浩楠
杜晓董
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Information and Telecommunication Co Ltd
Beijing Guodiantong Network Technology Co Ltd
Original Assignee
State Grid Information and Telecommunication Co Ltd
Beijing Guodiantong Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Information and Telecommunication Co Ltd, Beijing Guodiantong Network Technology Co Ltd filed Critical State Grid Information and Telecommunication Co Ltd
Priority to CN202010443420.2A priority Critical patent/CN111797434B/en
Publication of CN111797434A publication Critical patent/CN111797434A/en
Application granted granted Critical
Publication of CN111797434B publication Critical patent/CN111797434B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Bioethics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)
  • Document Processing Apparatus (AREA)

Abstract

本说明书一个或多个实施例提供一种文件编辑方法及装置,该方法包括对所述文件进行电子签盖公章;获取所述文件的待签名数据及所述电子签盖公章的公章列表域;调用CA接口在所述公章列表域处对所述待签名数据进行数字签名并生成签名后的文件。该方法中文件的待签名数据是自行获取的,并不是借助第三方接口获取待签名数据,并且,在获取待签名数据过程中,对文件结构进行解析,向公章列表域中添加数字证书,签名结构完全独立组装处理,没有依赖第三方接口,在功能扩展和优化方面更方便,并且软件对运行环境依赖小,用户使用更快捷。

Figure 202010443420

One or more embodiments of this specification provide a method and device for editing a file, the method includes electronically signing and stamping the file; obtaining the to-be-signed data of the file and the official seal list field of the electronically signed and stamped official seal; The CA interface is called to digitally sign the data to be signed at the official seal list field and generate a signed file. In this method, the data to be signed of the file is obtained by itself, instead of using a third-party interface to obtain the data to be signed, and in the process of obtaining the data to be signed, the file structure is parsed, a digital certificate is added to the official seal list field, and the signature The structure is completely independent for assembly and processing, without relying on third-party interfaces, which is more convenient in function expansion and optimization, and the software has less dependence on the operating environment, and users can use it more quickly.

Figure 202010443420

Description

一种文件编辑方法及装置A file editing method and device

技术领域technical field

本说明书一个或多个实施例涉及文件处理技术领域,尤其涉及一种文件编辑方法及装置。One or more embodiments of this specification relate to the technical field of file processing, and in particular, to a file editing method and apparatus.

背景技术Background technique

目前,在电子招投标行业中,传统的投标工具主要采用C/C+或C#等语言开发,在对投标文件进行数字签名过程中,获取投标文件中的待签名内容时主要依赖于调用第三方接口实现,从而过于依赖系统环境,不能跨平台运行,不利于功能的扩展。At present, in the electronic bidding industry, traditional bidding tools are mainly developed in languages such as C/C+ or C#. In the process of digitally signing bidding documents, the acquisition of the content to be signed in the bidding documents mainly relies on calling a third-party interface Therefore, it is too dependent on the system environment and cannot run across platforms, which is not conducive to the expansion of functions.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本说明书一个或多个实施例的目的在于提出一种文件编辑方法及装置,以解决现有对投标文件进行数字签名时过于依赖于调用第三方接口的问题。In view of this, the purpose of one or more embodiments of the present specification is to propose a file editing method and apparatus to solve the problem of excessively relying on invoking a third-party interface when digitally signing bidding documents.

基于上述目的,本说明书一个或多个实施例第一方面提供了一种文件编辑方法,所述方法包括:Based on the above purpose, a first aspect of one or more embodiments of this specification provides a file editing method, the method comprising:

对所述文件进行电子签盖公章;Electronically sign and seal the documents;

获取所述文件的待签名数据及所述电子签盖公章的公章列表域;Obtain the data to be signed of the document and the official seal list field of the electronic signature and official seal;

调用CA接口在所述公章列表域处对所述待签名数据进行数字签名并生成签名后的文件。The CA interface is called to digitally sign the data to be signed at the official seal list field and generate a signed file.

可选地,所述获取所述文件的待签名数据及所述电子签盖公章的公章列表域,包括:Optionally, the acquisition of the to-be-signed data of the document and the official seal list field of the electronically signed official seal includes:

获取所述文件的各结构对象及交叉引用表,其中,所述交叉引用表中存储有所述各结构对象在文件中的位置信息;Obtain each structural object and a cross-reference table of the file, wherein the cross-reference table stores position information of the structural objects in the file;

获取所述文件中电子签盖公章的公章列表域,以确定进行数字签名的位置;Obtain the official seal list field of the electronically signed official seal in the document to determine the position for digital signature;

设定所述文件中需求的数字签名格式;Set the required digital signature format in the document;

确定所述文件中的签名预留字节空间,其中,所述签名预留字节空间用于存储返回的签名后的待签名数据;Determine the signature reserved byte space in the file, wherein the signature reserved byte space is used to store the returned signed data to be signed;

更新所述各结构对象及所述各结构对象的偏移地址;updating the structure objects and the offset addresses of the structure objects;

根据更新后的所述各结构对象的偏移地址,获取所述文件的待签名数据。Acquire the data to be signed of the file according to the updated offset addresses of the structural objects.

可选地,所述调用CA接口在所述公章列表域处对所述待签名数据进行数字签名并生成签名后的文件,包括:Optionally, the calling CA interface digitally signs the data to be signed at the official seal list field and generates a signed file, including:

调用CA接口在所述公章列表域处对所述待签名数据进行数字签名;Call the CA interface to digitally sign the data to be signed at the official seal list field;

将签名后的所述待签名数据回写到所述签名预留字节空间中,生成签名后的文件。The signed data to be signed is written back into the signature reserved byte space to generate a signed file.

可选地,所述对所述文件进行电子签盖公章,包括:Optionally, the electronically signing and stamping the document with an official seal includes:

获取单位公章,并将所述单位公章转化为公章图片对象;Obtain the official seal of the unit, and convert the official seal of the unit into an official seal image object;

将所述公章图片对象绑定为当前鼠标形状;Binding the official seal picture object as the current mouse shape;

响应于用户点击鼠标的操作,确定所述文件需求的实际盖章位置坐标;In response to the operation of the user clicking the mouse, the actual stamping position coordinates of the document requirements are determined;

根据所述实际盖章位置坐标,将所述公章图片对象写入所述文件。According to the coordinates of the actual stamping position, the official stamp picture object is written into the file.

可选地,所述响应于用户点击鼠标的操作,确定所述文件需求的实际盖章位置坐标,包括:Optionally, in response to the operation of the user clicking the mouse, determining the actual stamping position coordinates of the document requirements, including:

响应于用户点击鼠标的操作,获取用户点击位置的窗口坐标;In response to the operation of the user clicking the mouse, obtain the window coordinates of the position where the user clicks;

获取用户的屏幕分辨率;Get the user's screen resolution;

根据所述窗口坐标、所述屏幕分辨率、横向滚动条位置和纵向滚动条位置,确定所述文件需求的实际盖章位置坐标。According to the window coordinates, the screen resolution, the horizontal scroll bar position and the vertical scroll bar position, the actual stamping position coordinates of the document requirement are determined.

可选地,在所述根据所述实际盖章位置坐标,将所述公章图片对象写入所述文件的步骤之前,所述方法还包括:Optionally, before the step of writing the official seal picture object into the file according to the actual seal position coordinates, the method further includes:

判断所述实际盖章位置坐标是否超出所述文件的页面坐标值;Judging whether the coordinates of the actual stamping position exceed the page coordinates of the file;

若是,则根据所述文件的页面坐标值与所述公章图片对象的大小再次确定实际盖章位置坐标;If so, then determine the actual seal position coordinates again according to the page coordinate value of the document and the size of the official seal picture object;

若否,则执行根据所述实际盖章位置坐标,将所述公章图片对象写入所述文件的步骤。If not, execute the step of writing the official seal picture object into the file according to the coordinates of the actual stamping position.

可选地,在所述对所述文件进行电子签盖公章的步骤之前,所述方法还包括Optionally, before the step of electronically signing and stamping the document with an official seal, the method further includes

响应于用户打开文件的操作,在展示界面展示所述文件。In response to the user's operation to open the file, the file is displayed on the display interface.

可选地,所述方法还包括:Optionally, the method further includes:

将签名后的文件上传至服务器端。Upload the signed file to the server.

可选地,所述将签名后的文件上传至服务器端,包括:Optionally, uploading the signed file to the server includes:

对所述签名后的文件进行对称加密,生成第一密文;Symmetrically encrypt the signed file to generate a first ciphertext;

对所述第一密文进行非对称加密,生成第二密文;performing asymmetric encryption on the first ciphertext to generate a second ciphertext;

对所述第二密文进行数据签名,生成签名数据;performing a data signature on the second ciphertext to generate signature data;

将所述第二密文和所述签名数据上传至服务器,以使所述服务器对所述第二密文和所述签名数据进行签名验证;uploading the second ciphertext and the signature data to a server, so that the server performs signature verification on the second ciphertext and the signature data;

当签名验证未通过时,重复上述步骤直至将签名后的文件成功上传至服务器端。When the signature verification fails, repeat the above steps until the signed file is successfully uploaded to the server.

基于相同的目的,本说明书一个或多个实施例第二方面提供了一种文件编辑装置,所述装置包括:Based on the same purpose, a second aspect of one or more embodiments of this specification provides a file editing apparatus, the apparatus comprising:

电子签盖公章模块,用于对所述文件进行电子签盖公章;The electronic signature and official seal module is used to electronically sign and affix the official seal to the document;

待签名数据获取模块,用于获取所述文件的待签名数据及所述电子签盖公章的公章列表域;A to-be-signed data acquisition module, used for acquiring the to-be-signed data of the document and the official seal list field of the electronic signature;

数字签名模块,用于调用CA接口在所述公章列表域处对所述待签名数据进行数字签名并生成签名后的文件。The digital signature module is used to call the CA interface to digitally sign the data to be signed at the official seal list field and generate a signed file.

可选地,所述待签名数据获取模块具体用于:Optionally, the to-be-signed data acquisition module is specifically used for:

获取所述文件的各结构对象及交叉引用表,其中,所述交叉引用表中存储有所述各结构对象在文件中的位置信息;Obtain each structural object and a cross-reference table of the file, wherein the cross-reference table stores position information of the structural objects in the file;

获取所述文件中电子签盖公章的公章列表域,以确定进行数字签名的位置;Obtain the official seal list field of the electronically signed official seal in the document to determine the position for digital signature;

设定所述文件中需求的数字签名格式;Set the required digital signature format in the document;

确定所述文件中的签名预留字节空间,其中,所述签名预留字节空间用于存储返回的签名后的待签名数据;Determine the signature reserved byte space in the file, wherein the signature reserved byte space is used to store the returned signed data to be signed;

更新所述各结构对象及所述各结构对象的偏移地址;updating the structure objects and the offset addresses of the structure objects;

根据更新后的所述各结构对象的偏移地址,获取所述文件的待签名数据。Acquire the data to be signed of the file according to the updated offset addresses of the structural objects.

可选地,所述数字签名模块,具体用于:Optionally, the digital signature module is specifically used for:

调用CA接口在所述公章列表域处对所述待签名数据进行数字签名;Call the CA interface to digitally sign the data to be signed at the official seal list field;

将签名后的所述待签名数据回写到所述签名预留字节空间中,生成签名后的文件。The signed data to be signed is written back into the signature reserved byte space to generate a signed file.

可选地,所述电子签盖公章模块,包括:Optionally, the electronic signature and seal module includes:

获取公章单元,用于获取单位公章,并将所述单位公章转化为公章图片对象;Obtain the official seal unit, which is used to obtain the official seal of the unit, and convert the official seal of the unit into an official seal image object;

公章图片对象绑定单元,用于将所述公章图片对象绑定为当前鼠标形状;an official seal image object binding unit, used for binding the official seal image object to the current mouse shape;

实际盖章位置坐标确定单元,用于响应于用户点击鼠标的操作,确定所述文件需求的实际盖章位置坐标;The actual stamping position coordinate determination unit is used to determine the actual stamping position coordinates required by the document in response to the operation of the user clicking the mouse;

公章图片对象写入单元,用于根据所述实际盖章位置坐标,将所述公章图片对象写入所述文件。The official seal image object writing unit is used for writing the official seal image object into the file according to the coordinates of the actual stamping position.

可选地,实际盖章位置坐标确定单元,具体用于:Optionally, a unit for determining the coordinates of the actual stamping position, which is specifically used for:

响应于用户点击鼠标的操作,获取用户点击位置的窗口坐标;In response to the operation of the user clicking the mouse, obtain the window coordinates of the position where the user clicks;

获取用户的屏幕分辨率;Get the user's screen resolution;

根据所述窗口坐标、所述屏幕分辨率、横向滚动条位置和纵向滚动条位置,确定所述文件需求的实际盖章位置坐标。According to the window coordinates, the screen resolution, the horizontal scroll bar position and the vertical scroll bar position, the actual stamping position coordinates of the document requirement are determined.

可选地,所述电子签盖公章模块,还包括:Optionally, the electronic signature and seal module also includes:

判断单元,用于判断所述实际盖章位置坐标是否超出所述文件的页面坐标值;若是,则实际盖章位置坐标确定单元根据所述文件的页面坐标值与所述公章图片对象的大小再次确定实际盖章位置坐标;若否,则公章图片对象写入单元根据所述实际盖章位置坐标,将所述公章图片对象写入所述文件。A judging unit, for judging whether the actual stamping position coordinates exceed the page coordinate value of the document; if so, the actual stamping position coordinate determining unit is again based on the page coordinate value of the document and the size of the official stamp picture object Determine the actual stamping position coordinates; if not, the official stamp picture object writing unit writes the official stamp picture object into the file according to the actual stamping position coordinates.

可选地,所述装置还包括文件展示模块,用于响应于用户打开文件的操作,在展示界面展示所述文件。Optionally, the apparatus further includes a file display module, configured to display the file on the display interface in response to the user's operation of opening the file.

可选地,所述装置还包括文件上传模块,用于将签名后的文件上传至服务器端。Optionally, the apparatus further includes a file uploading module for uploading the signed file to the server.

可选地,文件上传模块具体用于对所述签名后的文件进行对称加密,生成第一密文;Optionally, the file uploading module is specifically configured to symmetrically encrypt the signed file to generate a first ciphertext;

对所述第一密文进行非对称加密,生成第二密文;performing asymmetric encryption on the first ciphertext to generate a second ciphertext;

对所述第二密文进行数据签名,生成签名数据;performing a data signature on the second ciphertext to generate signature data;

将所述第二密文和所述签名数据上传至服务器,以使所述服务器对所述第二密文和所述签名数据进行签名验证;uploading the second ciphertext and the signature data to a server, so that the server performs signature verification on the second ciphertext and the signature data;

当签名验证未通过时,重复上述步骤直至将签名后的文件成功上传至服务器端。When the signature verification fails, repeat the above steps until the signed file is successfully uploaded to the server.

从上面所述可以看出,本说明书一个或多个实施例提供的文件编辑方法及装置,首先对文件进行电子签盖公章,然后获取文件的待签名数据以及电子签盖公章的公章列表域后,调用CA接口在公章列表域处对待签名数据进行数字签名,最后生成签名后的文件;文件的待签名数据是自行获取的,并不是借助第三方接口获取待签名数据,并且,在获取待签名数据过程中,对文件结构进行解析,向公章列表域中添加数字证书,签名结构完全独立组装处理,没有依赖第三方接口,在功能扩展和优化方面更方便,并且软件对运行环境依赖小,用户使用更快捷。As can be seen from the above, the file editing method and device provided by one or more embodiments of this specification firstly electronically sign and seal the file, and then obtain the data to be signed of the file and the official seal list field of the electronically signed official seal. , call the CA interface to digitally sign the data to be signed in the official seal list field, and finally generate the signed file; the data to be signed of the file is obtained by itself, not through a third-party interface to obtain the data to be signed. During the data process, the file structure is parsed, a digital certificate is added to the official seal list field, and the signature structure is completely assembled and processed independently, without relying on third-party interfaces, which is more convenient in function expansion and optimization, and the software has little dependence on the operating environment, users Faster to use.

附图说明Description of drawings

为了更清楚地说明本说明书一个或多个实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书一个或多个实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the following briefly introduces the accompanying drawings used in the description of the embodiments or the prior art. Obviously, in the following description The accompanying drawings are only one or more embodiments of the present specification, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.

图1为本说明书一个或多个实施例提供的一种文件编辑方法的流程示意图;1 is a schematic flowchart of a file editing method provided by one or more embodiments of this specification;

图2为本说明书一个或多个实施例提供的对于步骤S12的解释;FIG. 2 provides an explanation of step S12 in one or more embodiments of the present specification;

图3为本说明书一个或多个实施例提供的一种文件编辑装置的结构示意图。FIG. 3 is a schematic structural diagram of a file editing apparatus according to one or more embodiments of the present specification.

具体实施方式Detailed ways

为使本公开的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本公开进一步详细说明。In order to make the objectives, technical solutions and advantages of the present disclosure clearer, the present disclosure will be further described in detail below with reference to the specific embodiments and the accompanying drawings.

需要说明的是,除非另外定义,本说明书一个或多个实施例使用的技术术语或者科学术语应当为本公开所属领域内具有一般技能的人士所理解的通常意义。本说明书一个或多个实施例中使用的“第一”、“第二”以及类似的词语并不表示任何顺序、数量或者重要性,而只是用来区分不同的组成部分。It should be noted that, unless otherwise defined, the technical or scientific terms used in one or more embodiments of the present specification shall have the usual meanings understood by those with ordinary skill in the art to which this disclosure belongs. The terms "first," "second," and similar terms used in one or more embodiments of this specification do not denote any order, quantity, or importance, but are merely used to distinguish the various components.

目前,在电子招投标行业中,传统的投标工具主要采用C/C+或C#等语言开发,在对投标文件进行数字签名过程中,获取投标文件中的待签名内容时主要依赖于调用第三方接口实现,从而过于依赖系统环境,不能跨平台运行,不利于功能的扩展。At present, in the electronic bidding industry, traditional bidding tools are mainly developed in languages such as C/C+ or C#. In the process of digitally signing bidding documents, the acquisition of the content to be signed in the bidding documents mainly relies on calling a third-party interface Therefore, it is too dependent on the system environment and cannot run across platforms, which is not conducive to the expansion of functions.

为了解决上述问题,本说明书提供了一种文件编辑方法及装置,首先对文件进行电子签盖公章,然后获取文件的待签名数据以及电子签盖公章的公章列表域后,调用CA接口在公章列表域处对待签名数据进行数字签名,最后生成签名后的文件。该方法及装置可以应用于计算机、平板电脑、智能手机等,具体不做限定。In order to solve the above problems, this specification provides a file editing method and device. First, the file is electronically signed and sealed, and then the data to be signed and the official seal list field of the electronically signed and sealed official seal are obtained, and the CA interface is called in the official seal list. At the domain, the data to be signed is digitally signed, and finally a signed file is generated. The method and device can be applied to computers, tablet computers, smart phones, etc., which are not specifically limited.

为了便于理解,下面结合附图对该文件编辑方法进行详细说明。For ease of understanding, the file editing method is described in detail below with reference to the accompanying drawings.

图1为本说明书提供的文件编辑方法的流程示意图;如图1所示,该方法包括:Fig. 1 is a schematic flowchart of a file editing method provided by this specification; as shown in Fig. 1, the method includes:

S11、对文件进行电子签盖公章;S11. Electronically sign and seal the document;

S12、获取文件的待签名数据及电子签盖公章的公章列表域S12. Obtain the data to be signed of the document and the official seal list field of the electronically signed official seal

S13、调用CA接口在公章列表域处对待签名数据进行数字签名并生成签名后的文件。S13, calling the CA interface to digitally sign the data to be signed at the official seal list field and generate a signed file.

在实际应用中,文件可以为投标文件、财务报告、审计报告等等,具体不做限定。待签名数据指文件中含有的需要对其进行签名的内容。电子签盖公章的公章列表域即电子签盖公章的地址偏移量,指的是文件中电子签盖公章的位置。In practical applications, the documents may be bidding documents, financial reports, audit reports, etc., which are not specifically limited. The data to be signed refers to the content contained in the file that needs to be signed. The official seal list field of the electronic signature and official seal is the address offset of the official seal of the electronic signature, which refers to the position of the official seal of the electronic signature in the document.

执行本方法的电子设备(以下简称本电子设备)获取文件后,首先对该文件进行电子签盖公章,然后获取该电子签盖公章的公章列表域,并获取该文件内的待签名数据;获取电子签盖公章的公章列表域及待签名数据后,调用CA接口在公章列表域的位置对待签名数据进行数字签名,数字签名完成后生成签名后的文件,以完成对文件进行电子签盖公章及数字签名的过程。After the electronic device executing the method (hereinafter referred to as the electronic device) obtains the file, firstly electronically sign and seal the file, then obtain the official seal list field of the electronically signed and sealed official seal, and obtain the data to be signed in the file; obtain After the official seal list field of the electronic signature and the official seal and the data to be signed, call the CA interface to digitally sign the to-be-signed data at the position of the official seal list field. After the digital signature is completed, a signed file is generated to complete the electronic signature and official seal and The process of digital signature.

关于电子签盖公章的过程、待签名数据获取的过程均会在后续过程中将会进行详细说明,在此不再赘述。The process of electronically signing the official seal and the process of obtaining the data to be signed will be explained in detail in the subsequent process, and will not be repeated here.

可以理解的是,本电子设备自行完成文件的电子签盖公章,并且待签名数据也是自行获取的,并不是借助第三方接口获取待签名数据,此外,在获取待签名数据过程中,对文件结构进行解析,向公章列表域中添加数字证书,签名结构完全独立组装处理,没有依赖第三方接口,在功能扩展和优化方面更方便,并且软件对运行环境依赖小,用户使用更快捷。It can be understood that this electronic device completes the electronic signature and official seal of the file by itself, and the data to be signed is also obtained by itself, instead of obtaining the data to be signed through a third-party interface. In addition, in the process of obtaining the data to be signed, the file structure is Perform analysis, add a digital certificate to the official seal list field, and assemble and process the signature structure completely independently, without relying on third-party interfaces, which is more convenient in function expansion and optimization, and the software has less dependence on the operating environment, making it faster for users to use.

图2为本说明书提供的对于步骤S12的解释;在实际应用中,为了对文件进行编辑,在对文件进行电子签盖公章后,还需要继续获取该文件的待签名数据以及该电子签盖公章的公章列表域;则,如图2所示,在一些可能的实施方式中,获取文件的待签名数据及电子签盖公章的公章列表域,包括:FIG. 2 provides an explanation of step S12 in this specification; in practical applications, in order to edit the file, after the file is electronically signed and sealed, it is necessary to continue to obtain the data to be signed of the file and the electronic signature and seal. Then, as shown in Figure 2, in some possible implementations, obtain the data to be signed of the file and the official seal list field of the electronic signature, including:

S21、获取文件的各结构对象及交叉引用表,其中,交叉引用表中存储有各结构对象在文件中的位置信息。S21. Obtain each structural object and a cross-reference table of the file, wherein the cross-reference table stores position information of each structural object in the file.

为了获取文件的各结构对象以及各结构对象的偏移地址,首先获取trailer文件尾对象,Size文档对象数目和Root根对象,以及记录文件各结构对象相对位置的交叉引用表,由startxref关键字中的偏移地址可获取到交叉引用表开始的文档位置,然后根据交叉引用表各结构对象的位置信息分别获得文件中各结构对象的相对地址,进而分别根据各结构对象的相对地址访问文件的各结构对象。其中,偏移地址为段内某一地址相对于段首地址的偏移量,相对地址为段首地址+偏移地址。In order to obtain each structural object of the file and the offset address of each structural object, first obtain the trailer file tail object, the number of Size document objects and the Root root object, as well as the cross-reference table that records the relative position of each structural object in the file. The offset address of the cross-reference table can be obtained to obtain the document position at the beginning of the cross-reference table, and then the relative address of each structural object in the file can be obtained according to the position information of each structural object in the cross-reference table, and then the relative address of each structural object can be accessed. Structure object. The offset address is the offset of an address in the segment relative to the segment head address, and the relative address is the segment head address + offset address.

S22、获取文件中电子签盖公章的公章列表域,以确定进行数字签名的位置。S22. Obtain the official seal list field of the electronically signed official seal in the document, so as to determine the position for digital signature.

在实际应用中,对文件进行电子签盖公章后,还需要在电子签盖公章处进行数字签名,即需要在文件中电子签盖公章的公章列表域处进行数字签名,则需要首先获得文件中电子签盖公章的公章列表域。In practical applications, after electronically signing and affixing the official seal to the document, a digital signature needs to be performed at the place where the official seal is electronically signed. The official seal list field for electronic signatures and official seals.

为了获得文件中电子签盖公章的公章列表域,首先可以获取AcroForm对象的偏移地址,根据AcroForm对象的偏移地址获取Fields已盖公章列表;然后计算页面Annots的地址偏移量,将获得的页面Annots的地址偏移量写入Fields已盖公章列表数据中,再次计算AcroForm文档交互字典对象的地址偏移量,并设置SigFlags签名字段。In order to obtain the official seal list field of the electronic signature and official seal in the file, you can first obtain the offset address of the AcroForm object, and obtain the official seal list of Fields according to the offset address of the AcroForm object; then calculate the address offset of the page Annots, the obtained The address offset of the page Annots is written into the Fields official seal list data, the address offset of the AcroForm document interaction dictionary object is calculated again, and the SigFlags signature field is set.

S23、设定文件中需求的数字签名格式。S23. Set a digital signature format required in the file.

在实际应用中,对文件中的待签名内容进行数字签名之前,需要预先设定文件中需要的数字签名格式;则,可以将Filter对象的签名处理程序设置为Adobe.PPKLite,SubFilter对象的公钥加密签名定义值设置为adbe.pkcs7.detached。In practical applications, before digitally signing the content to be signed in the file, the digital signature format required in the file needs to be preset; then, the signature processing program of the Filter object can be set to Adobe.PPKLite, the public key of the SubFilter object The cryptographic signature definition value is set to adbe.pkcs7.detached.

S24、确定文件中的签名预留字节空间,其中,签名预留字节空间用于存储返回的签名后的待签名数据。S24. Determine the reserved byte space for the signature in the file, where the reserved byte space for the signature is used to store the returned signed data to be signed.

在实际应用中,为了存储签名后的待签名数据,需要预先在文件中确定签名预留字节空间;则,可以计算预留的字节范围空间值,写入ByteRange数组中,Contents签名预留字节空间精确匹配ByteRange中指定的范围空间,用指定长度0字节补充。In practical applications, in order to store the signed data to be signed, it is necessary to determine the reserved byte space for the signature in the file in advance; then, the reserved byte range space value can be calculated and written into the ByteRange array, where the Contents signature is reserved. The byte space exactly matches the range space specified in ByteRange, supplemented with the specified length of 0 bytes.

S25、更新各结构对象及各结构对象的偏移地址。S25. Update each structural object and the offset address of each structural object.

在实际应用中,为了更新各结构对象及各结构对象的偏移地址,可以首先写入流对象的压缩方式为zip的压缩算法,然后写入资源页面包含资源样式,将计算后各结构对象的地址偏移量写入交叉引用表中,更新trailer信息,获取签名预留字节空间以外得所有字节长度,计算ByteRange字节范围。In practical applications, in order to update each structure object and the offset address of each structure object, you can first write the compression algorithm of the stream object as the zip compression algorithm, and then write the resource page to include the resource style. The address offset is written into the cross-reference table, the trailer information is updated, the length of all bytes except the reserved byte space of the signature is obtained, and the byte range of the ByteRange is calculated.

S26、根据更新后的各结构对象的偏移地址,获取文件的待签名数据。S26: Acquire the data to be signed of the file according to the updated offset addresses of each structural object.

在实际应用中,将各结构对象及各结构对象的偏移地址进行更新后,可以进一步根据更新后的各结构对象的偏移地址,计算文件的待签名数据。In practical applications, after updating each structural object and the offset address of each structural object, the data to be signed of the file can be further calculated according to the updated offset address of each structural object.

可以理解的是,本电子设备自行获取文件中的待签名内容,并不是借助第三方接口获取待签名数据,并且,在获取待签名数据过程中,对文件结构进行解析,向公章列表域中添加数字证书,签名结构完全独立组装处理,没有依赖第三方接口,在功能扩展和优化方面更方便,并且软件对运行环境依赖小,用户使用更快捷。It can be understood that the electronic device obtains the content to be signed in the file by itself, instead of obtaining the data to be signed through a third-party interface, and in the process of obtaining the data to be signed, the file structure is parsed and added to the official seal list field. The digital certificate and signature structure are completely independently assembled and processed, without relying on third-party interfaces, which is more convenient in function expansion and optimization, and the software has less dependence on the operating environment, and users can use it more quickly.

在实际应用中,获得待签名数据、确定电子签盖公章的公章列表域后,则可以对待签名数据进行数字签名;则,在一些可能的实施方式中,调用CA接口在公章列表域处对待签名数据进行数字签名并生成签名后的文件,包括:In practical applications, after obtaining the data to be signed and determining the official seal list field of the electronic signature and the official seal, the data to be signed can be digitally signed; then, in some possible implementations, the CA interface is called to treat the signature in the official seal list field. The data is digitally signed and a signed file is generated, including:

调用CA接口在公章列表域处对待签名数据进行数字签名;Call the CA interface to digitally sign the data to be signed in the official seal list field;

将签名的待签名数据回写到签名预留字节空间中,生成签名后的文件。Write back the signed data to be signed into the reserved byte space for signature to generate a signed file.

为了对待签名数据进行数字签名,获得文件中的待签名数据并确定电子签盖公章的公章列表域后,可以首先调用CA接口在公章列表域处对文件中的待签名数据进行数字签名,获得签名后的待签名数据;然后将签名后的待签名数据以覆盖写的方式回写到ByteRange指定的签名预留字节空间中即Contents键中,重新生成签名后的文件。In order to digitally sign the data to be signed, after obtaining the data to be signed in the file and determining the official seal list field of the electronic signature and the official seal, you can first call the CA interface to digitally sign the data to be signed in the file at the official seal list field, and obtain the signature Then, the signed data to be signed is written back to the signature reserved byte space specified by ByteRange, that is, the Contents key, to regenerate the signed file.

在实际应用中,在对待签名数据进行数字签名前,可以首先对该文件进行电子签盖公章;则,在一些可能的实施方式中,对文件进行电子签盖公章,包括:In practical applications, before digitally signing the data to be signed, the document may be electronically signed and sealed; then, in some possible implementations, the document may be electronically signed and sealed, including:

获取单位公章,并将单位公章转化为公章图片对象;Obtain the official seal of the unit, and convert the official seal of the unit into an official seal image object;

将公章图片对象绑定为当前鼠标形状;Bind the official seal image object to the current mouse shape;

响应于用户点击鼠标的操作,确定文件需求的实际盖章位置坐标;In response to the operation of the user clicking the mouse, determine the actual stamping position coordinates of the document requirements;

根据实际盖章位置坐标,将公章图片对象写入文件。According to the actual stamp position coordinates, the official stamp image object is written into the file.

在实际应用中,对文件进行电子签盖公章时,可以仅对文件中的某一页进行盖章,也可以对文件中的多页进行批量盖章,例如,可以对文件中6页、8页或者10页进行盖章,具体不做限定。In practical applications, when electronically signing and stamping a document, you can only stamp a certain page in the document, or you can stamp multiple pages in the document in batches. For example, you can stamp 6 pages, 8 pages in the document Pages or 10 pages to be stamped, there is no specific limitation.

当用户选择对文件中的某一页进行单页盖章时,用户选定某一页并选定具体的坐标后,点击确定后,便可以只在选定页中的指定坐标位子加盖电子公章。When the user chooses to stamp a single page of a page in the file, after the user selects a page and selects specific coordinates, and clicks OK, the electronic stamp can only be placed on the specified coordinates in the selected page. Official seal.

当用户选择对文件中的多页进行批量盖章时,用户可以在本电子设备界面弹出的页码范围对话框内填写页码范围,并选定电子盖章的坐标位置,然后点击确定后,便可以在制定页码范围内同一坐标位置加盖电子公章。When the user chooses to stamp multiple pages in the file in batches, the user can fill in the page number range in the page number range dialog box that pops up on the interface of this electronic device, and select the coordinate position of the electronic stamp, and then click OK, then you can The electronic official seal shall be affixed to the same coordinate position within the specified page number range.

用户选定单页盖章或批量盖章后,本电子设备响应于用户的操作,可以首先调用第三方U盾接口获取当前uKey里的单位公章,然后将获取的单位公章转化为公章图片对象,并将该公章图片对象绑定为当前鼠标形状,用户点击鼠标时便可进行盖章操作,提升了用户体验。After the user selects a single-page seal or batch seal, the electronic device can first call the third-party U-shield interface to obtain the unit's official seal in the current uKey in response to the user's operation, and then convert the obtained unit's official seal into an official seal image object. The official seal picture object is bound to the current mouse shape, and the user can perform the stamping operation when the user clicks the mouse, which improves the user experience.

当用户点击鼠标时,本电子设备响应于用户的操作,可以确定文件需求的实际盖章位置坐标;为了获取文件需求的实际盖章位置坐标,本电子设备首先响应于用户点击鼠标的操作,获取用户点击位置的窗口坐标,然后获取用户的屏幕分辨率,根据用户点击位置的窗口坐标、屏幕分辨率、横向滚动条位置和纵向滚动条位置,确定文件需求的实际盖章位置坐标。When the user clicks the mouse, the electronic device responds to the user's operation to determine the actual stamping position coordinates required by the document; in order to obtain the actual stamping position coordinates required by the document, the electronic device first responds to the user's operation of clicking the mouse, obtains The window coordinates of the user's click position, and then the user's screen resolution is obtained. According to the window coordinates, screen resolution, horizontal scroll bar position and vertical scroll bar position of the user's click position, the actual stamp position coordinates of the file requirements are determined.

确定文件需求的实际盖章位置坐标后,根据需求的实际盖章位置坐标,将公章图片对象写入文件的某一页面中或指定的文件页码范围内,以完成对文件的电子签盖公章。After determining the actual stamping position coordinates of the document requirements, according to the actual stamping position coordinates of the requirements, write the official stamp image object into a certain page of the document or within the specified page number range of the document to complete the electronic signature and official stamping of the document.

在实际应用中,根据点击窗口坐标、屏幕分辨率、横向滚动条位置和纵向滚动条位置确定文件需求的实际盖章位置坐标后,还可以进一步判断获得的该实际盖章位置坐标是否可行;则,在一些可能的实施方式中,在根据实际盖章位置坐标,将公章图片对象写入文件的步骤之前,该方法还包括:In practical applications, after determining the actual stamping position coordinates required by the file according to the click window coordinates, screen resolution, horizontal scroll bar position and vertical scroll bar position, it can be further judged whether the obtained actual stamping position coordinates are feasible; then , in some possible implementations, before the step of writing the official seal image object into the file according to the actual stamping position coordinates, the method further includes:

判断实际盖章位置坐标是否超出文件的页面坐标值;Determine whether the actual stamp position coordinates exceed the page coordinates of the file;

若是,则根据文件的页面坐标值与公章图片对象的大小再次确定实际盖章位置坐标;If yes, then determine the actual seal position coordinates again according to the page coordinate value of the file and the size of the official seal image object;

若否,则执行根据实际盖章位置坐标,将公章图片对象写入文件的步骤。If not, execute the steps of writing the official seal image object into the file according to the actual stamping position coordinates.

一种情况下,当实际盖章位置坐标超出文件的页面坐标值时,表明实际盖章位置落在文件页面外;则需要根据文件的页面坐标值与公章图片对象的大小再次确定实际盖章位置坐标,以保证再次确定的实际盖章位置坐标不超出文件的页面坐标值,即实际盖章位置落在文件的页面内。当重新确定好实际盖章位置坐标后,根据重新确定的实际盖章位置坐标,将公章图片对象写入文件某一页面中或指定的文件页码范围内。In one case, when the coordinates of the actual stamping position exceed the page coordinates of the document, it indicates that the actual stamping position falls outside the document page; then the actual stamping position needs to be determined again according to the page coordinates of the document and the size of the official stamp image object. To ensure that the re-determined coordinates of the actual stamping position do not exceed the page coordinates of the document, that is, the actual stamping position falls within the page of the document. After the actual stamping position coordinates are re-determined, according to the re-determined actual stamping position coordinates, the official stamp image object is written into a certain page of the document or within the specified page number range of the document.

一种情况下,当实际盖章位置坐标未超出文件的页面坐标值时,即表明实际盖章位置落在文件页面内时,则可以直接根据实际盖章位置坐标,将公章图片对象写入文件某一页面中或指定的文件页码范围内。In one case, when the actual stamping position coordinates do not exceed the page coordinates of the file, it means that the actual stamping position falls within the file page, and the official stamp image object can be written into the file directly according to the actual stamping position coordinates. within a page or within a specified range of document page numbers.

可以理解的是,计算获得文件所需的实际盖章位置坐标后,首先判断实际盖章位置坐标是否超过文件页面坐标值,即保证实际盖章位置坐标落在文件页面内,保证电子签盖公章有效,提高编辑准确率。It is understandable that, after calculating the actual stamping position coordinates required for obtaining the document, first determine whether the actual stamping position coordinates exceed the document page coordinate value, that is, ensure that the actual stamping position coordinates fall within the document page, and ensure that the electronic signature is stamped with the official seal. Effective and improve editing accuracy.

在实际应用中,为了对文件进行编辑,需要首先展示该文件;则,在一些可能的实施方式中,在对文件进行电子签盖公章的步骤之前,该方法还包括:In practical applications, in order to edit a file, the file needs to be displayed first; then, in some possible implementations, before the step of electronically signing and sealing the file, the method further includes:

响应于用户打开文件的操作,在展示界面展示文件。In response to the user's operation of opening the file, the file is displayed on the display interface.

在实际应用中,为了对文件进行编辑,用户打开待编辑的文件,然后本电子设备根据文件大小确定如何在展示界面展示文件。In practical applications, in order to edit a file, the user opens the file to be edited, and then the electronic device determines how to display the file on the display interface according to the file size.

一种情况下,当文件大小小于等于10页时,则可以展示文件所有页码的缩略图,并显示文件的当前页面。In one case, when the file size is less than or equal to 10 pages, thumbnails of all page numbers of the file can be displayed, and the current page of the file can be displayed.

一种情况下,当文件大小大于10页时,可以首先展示文件前10页的缩略图,随着鼠标滚轮向下滚动时,本电子设备继续加载该文件页面,展示大于10页的内容,用户还可以根据目录结构、页面跳转、上一页、下一页等操作查看文档结构或跳转到指定页面进行操作,对该文件进行快速显示处理,大大提升了用户体验度。In one case, when the file size is larger than 10 pages, the thumbnails of the first 10 pages of the file can be displayed first. When scrolling down with the mouse wheel, the electronic device continues to load the file page and displays the content larger than 10 pages. You can also view the document structure according to the directory structure, page jump, previous page, next page, etc., or jump to the specified page for operation, and quickly display the file, which greatly improves the user experience.

在实际应用中,对文件编辑完成后,还可以将文件进一步处理;则,在一些可能的实施方式中,该方法还包括:In practical applications, after the editing of the file is completed, the file can be further processed; then, in some possible implementations, the method further includes:

将签名后的文件上传至服务器端。Upload the signed file to the server.

在文件上传过程中,为了保证文件的安全性,文件不被任意篡改,可以采用对文件进行加密的方式以保证文件在上传过程中的安全性;则,在一些可能的实施方式中,将签名后的文件上传至服务器端,包括:During the file uploading process, in order to ensure the security of the file and the file is not arbitrarily tampered with, the method of encrypting the file can be used to ensure the security of the file during the uploading process; then, in some possible implementations, the signature After uploading the files to the server, including:

对签名后的文件进行对称加密,生成第一密文;Symmetrically encrypt the signed file to generate the first ciphertext;

对第一密文进行非对称加密,生成第二密文;Perform asymmetric encryption on the first ciphertext to generate the second ciphertext;

对第二密文进行数据签名,生成签名数据;Perform data signature on the second ciphertext to generate signature data;

将第二密文和签名数据上传至服务器,以使服务器对第二密文和签名数据进行签名验证;uploading the second ciphertext and the signature data to the server, so that the server can perform signature verification on the second ciphertext and the signature data;

当签名验证未通过时,重复上述步骤直至将签名后的文件成功上传至服务器端。When the signature verification fails, repeat the above steps until the signed file is successfully uploaded to the server.

在实际应用中,对第二密文进行数据签名,生成签名数据的同时,亦会生成签名的摘要数据;再将第二密文和签名数据上传至服务器后,在服务器端会根据第二密文再次生成第二密文的摘要数据,然后验证第二密文的摘要数据和签名的摘要数据是否匹配。In practical applications, data signature is performed on the second ciphertext, and while the signature data is generated, the signed digest data will also be generated; after uploading the second ciphertext and the signature data to the server, the server will The text generates the digest data of the second ciphertext again, and then verifies whether the digest data of the second ciphertext matches the signed digest data.

如果第二密文的摘要数据和签名的摘要数据匹配,则签名验证通过,服务器将第二密文进行存储,文件上传成功。If the digest data of the second ciphertext matches the digest data of the signature, the signature verification is passed, the server stores the second ciphertext, and the file is uploaded successfully.

如果在文件上传过程中,第二密文被中途篡改,则第二密文的摘要数据和签名的摘要数据不匹配,签名验证失败,服务器端将反馈验证失败的信息至本电子设备,则基于验证失败的信息,本电子设备将会重复上述步骤,重新上传文件至服务器,直至签名验证通过,文件长传成功。If the second ciphertext is tampered with during the file uploading process, the digest data of the second ciphertext does not match the signed digest data, and the signature verification fails. The server will feed back the verification failure information to the electronic device. If the verification fails, the electronic device will repeat the above steps and re-upload the file to the server until the signature verification is passed, and the long-term file transfer is successful.

可以理解的是,在文件上传至服务器的过程中,采用加密的方式进行上传,保证了文件上传过程中不被篡改,提高了文件上述过程的安全性。It can be understood that, in the process of uploading the file to the server, the upload is performed in an encrypted manner, which ensures that the file is not tampered with during the uploading process, and improves the security of the above-mentioned process of the file.

需要说明的是,本说明书一个或多个实施例的方法可以由单个设备执行,例如一台计算机或服务器等。本实施例的方法也可以应用于分布式场景下,由多台设备相互配合来完成。在这种分布式场景的情况下,这多台设备中的一台设备可以只执行本说明书一个或多个实施例的方法中的某一个或多个步骤,这多台设备相互之间会进行交互以完成所述的方法。It should be noted that the methods of one or more embodiments of this specification may be executed by a single device, such as a computer or a server. The method in this embodiment can also be applied in a distributed scenario, and is completed by the cooperation of multiple devices. In the case of such a distributed scenario, one device among the multiple devices may only execute one or more steps in the method of one or more embodiments of the present specification, and the multiple devices may perform operations on each other. interact to complete the described method.

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

图3为本说明书提供的一种文件编辑装置的结构示意图;如图2所示,该装置包括:FIG. 3 is a schematic structural diagram of a file editing device provided by this specification; as shown in FIG. 2 , the device includes:

电子签盖公章模块31,用于对文件进行电子签盖公章;The electronic signature and official seal module 31 is used to electronically sign and seal the document;

待签名数据获取模块32,用于获取文件的待签名数据及电子签盖公章的公章列表域;The data to be signed acquisition module 32 is used to acquire the data to be signed of the file and the official seal list field of the electronic signature and official seal;

数字签名模块33,用于调用CA接口在公章列表域处对待签名数据进行数字签名并生成签名后的文件。The digital signature module 33 is used to call the CA interface to digitally sign the data to be signed at the official seal list field and generate a signed file.

在一种可能的实施方式中,待签名数据获取模块32具体用于:In a possible implementation, the to-be-signed data acquisition module 32 is specifically configured to:

获取文件的各结构对象及交叉引用表,其中,交叉引用表中存储有各结构对象在文件中的位置信息;Obtain each structural object and a cross-reference table of the file, wherein the cross-reference table stores the position information of each structural object in the file;

获取文件中电子签盖公章的公章列表域,以确定进行数字签名的位置;Obtain the official seal list field of the electronically signed official seal in the document to determine the location of the digital signature;

设定文件中需求的数字签名格式;Set the required digital signature format in the file;

确定文件中的签名预留字节空间,其中,签名预留字节空间用于存储返回的签名后的待签名数据;Determine the signature reserved byte space in the file, wherein the signature reserved byte space is used to store the returned signed data to be signed;

更新各结构对象及各结构对象的偏移地址;Update each structure object and the offset address of each structure object;

根据更新后的各结构对象的偏移地址,获取文件的待签名数据。According to the updated offset address of each structural object, the data to be signed of the file is obtained.

在一种可能的实施方式中,数字签名模块33,具体用于:In a possible implementation manner, the digital signature module 33 is specifically used for:

调用CA接口在公章列表域处对待签名数据进行数字签名;Call the CA interface to digitally sign the data to be signed in the official seal list field;

将签名后的待签名数据回写到签名预留字节空间中,生成签名后的文件。Write back the signed data to be signed into the reserved byte space for signature to generate a signed file.

在一种可能的实施方式中,电子签盖公章模块31,包括:In a possible implementation, the electronic signature and seal module 31 includes:

获取公章单元,用于获取单位公章,并将单位公章转化为公章图片对象;Get the official seal unit, which is used to obtain the official seal of the unit, and convert the official seal of the unit into an official seal image object;

公章图片对象绑定单元,用于将公章图片对象绑定为当前鼠标形状;The official seal image object binding unit is used to bind the official seal image object to the current mouse shape;

实际盖章位置坐标确定单元,用于响应于用户点击鼠标的操作,确定文件需求的实际盖章位置坐标;The actual stamping position coordinate determination unit is used to determine the actual stamping position coordinates required by the document in response to the operation of the user clicking the mouse;

公章图片对象写入单元,用于根据实际盖章位置坐标,将公章图片对象写入文件。The official seal image object writing unit is used to write the official seal image object into the file according to the actual stamping position coordinates.

在一种可能的实施方式中,实际盖章位置坐标确定单元,具体用于:In a possible implementation, the actual stamping position coordinate determination unit is specifically used for:

响应于用户点击鼠标的操作,获取用户点击位置的窗口坐标;In response to the operation of the user clicking the mouse, obtain the window coordinates of the position where the user clicks;

获取用户的屏幕分辨率;Get the user's screen resolution;

根据窗口坐标、屏幕分辨率、横向滚动条位置和纵向滚动条位置,确定文件需求的实际盖章位置坐标。According to the window coordinates, screen resolution, horizontal scroll bar position and vertical scroll bar position, determine the actual stamp position coordinates of the file requirements.

在一种可能的实施方式中,电子签盖公章模块31,还包括:In a possible implementation, the electronic signature and seal module 31 further includes:

判断单元,用于判断实际盖章位置坐标是否超出文件的页面坐标值;若是,则实际盖章位置坐标确定单元根据文件的页面坐标值与公章图片对象的大小再次确定实际盖章位置坐标;若否,则公章图片对象写入单元根据实际盖章位置坐标,将公章图片对象写入文件。The judgment unit is used to judge whether the actual stamping position coordinates exceed the page coordinate value of the document; if so, the actual stamping position coordinate determination unit determines the actual stamping position coordinates again according to the page coordinate value of the document and the size of the official stamp image object; if If not, the official seal image object writing unit writes the official seal image object to the file according to the actual stamping position coordinates.

在一种可能的实施方式中,该装置还包括文件展示模块(图中未示出),用于响应于用户打开文件的操作,在展示界面展示文件。In a possible implementation manner, the apparatus further includes a file display module (not shown in the figure), configured to display the file on the display interface in response to the user's operation of opening the file.

在一种可能的实施方式中,该装置还包括文件上传模块(图中未示出),用于将签名后的文件上传至服务器端。In a possible implementation manner, the apparatus further includes a file uploading module (not shown in the figure) for uploading the signed file to the server.

在一种可能的实施方式中,文件上传模块具体用于对签名后的文件进行对称加密,生成第一密文;In a possible implementation, the file uploading module is specifically configured to symmetrically encrypt the signed file to generate the first ciphertext;

对第一密文进行非对称加密,生成第二密文;Perform asymmetric encryption on the first ciphertext to generate the second ciphertext;

对第二密文进行数据签名,生成签名数据;Perform data signature on the second ciphertext to generate signature data;

将第二密文和签名数据上传至服务器,以使服务器对第二密文和签名数据进行签名验证;uploading the second ciphertext and the signature data to the server, so that the server can perform signature verification on the second ciphertext and the signature data;

当签名验证未通过时,重复上述步骤直至将签名后的文件成功上传至服务器端。When the signature verification fails, repeat the above steps until the signed file is successfully uploaded to the server.

为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书一个或多个实施例时可以把各模块的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, when describing the above device, the functions are divided into various modules and described respectively. Of course, when implementing one or more embodiments of this specification, the functions of each module may be implemented in one or more software and/or hardware.

上述实施例的装置用于实现前述实施例中相应的方法,并且具有相应的方法实施例的有益效果,在此不再赘述。The apparatuses in the foregoing embodiments are used to implement the corresponding methods in the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本公开的范围(包括权利要求)被限于这些例子;在本公开的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,步骤可以以任意顺序实现,并存在如上所述的本说明书一个或多个实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。It should be understood by those of ordinary skill in the art that the discussion of any of the above embodiments is only exemplary, and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples; under the spirit of the present disclosure, the above embodiments or Technical features in different embodiments may also be combined, steps may be carried out in any order, and there are many other variations of the different aspects of one or more embodiments of this specification as described above, which are not in detail for the sake of brevity supply.

此外,可以以框图的形式示出装置,以便避免使本说明书一个或多个实施例难以理解,并且这也考虑了以下事实,即关于这些框图装置的实施方式的细节是高度取决于将要实施本说明书一个或多个实施例的平台的(即,这些细节应当完全处于本领域技术人员的理解范围内)。在阐述了具体细节(例如,电路)以描述本公开的示例性实施例的情况下,对本领域技术人员来说显而易见的是,可以在没有这些具体细节的情况下或者这些具体细节有变化的情况下实施本说明书一个或多个实施例。因此,这些描述应被认为是说明性的而不是限制性的。Furthermore, devices may be shown in block diagram form in order to avoid obscuring one or more embodiments of this description, and this also takes into account the fact that details regarding the implementation of such block diagram devices are highly dependent on the implementation of the invention (ie, these details should be well within the understanding of those skilled in the art) of the platform describing one or more embodiments. Where specific details (eg, circuits) are set forth to describe exemplary embodiments of the present disclosure, it will be apparent to those skilled in the art that these specific details may be used without or with variations One or more embodiments of this specification are implemented below. Accordingly, these descriptions are to be considered illustrative rather than restrictive.

尽管已经结合了本公开的具体实施例对本公开进行了描述,但是根据前面的描述,这些实施例的很多替换、修改和变型对本领域普通技术人员来说将是显而易见的。Although the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations to these embodiments will be apparent to those of ordinary skill in the art from the foregoing description.

本说明书一个或多个实施例旨在涵盖落入所附权利要求的宽泛范围之内的所有这样的替换、修改和变型。因此,凡在本说明书一个或多个实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本公开的保护范围之内。The embodiment or embodiments of this specification are intended to cover all such alternatives, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of the present specification should be included within the protection scope of the present disclosure.

Claims (10)

1.一种文件编辑方法,其特征在于,所述方法包括:1. a file editing method, is characterized in that, described method comprises: 对所述文件进行电子签盖公章;Electronically sign and seal the documents; 获取所述文件的待签名数据及所述电子签盖公章的公章列表域;Obtain the data to be signed of the document and the official seal list field of the electronic signature and official seal; 调用CA接口在所述公章列表域处对所述待签名数据进行数字签名并生成签名后的文件。The CA interface is called to digitally sign the data to be signed at the official seal list field and generate a signed file. 2.根据权利要求1所述的文件编辑方法,其特征在于,所述获取所述文件的待签名数据及所述电子签盖公章的公章列表域,包括:2. file editing method according to claim 1, is characterized in that, described obtaining the data to be signed of described file and the official seal list field of described electronic signature seal, comprising: 获取所述文件的各结构对象及交叉引用表,其中,所述交叉引用表中存储有所述各结构对象在文件中的位置信息;Obtain each structural object and a cross-reference table of the file, wherein the cross-reference table stores position information of the structural objects in the file; 获取所述文件中电子签盖公章的公章列表域,以确定进行数字签名的位置;Obtain the official seal list field of the electronically signed official seal in the document to determine the position for digital signature; 设定所述文件中需求的数字签名格式;Set the required digital signature format in the document; 确定所述文件中的签名预留字节空间,其中,所述签名预留字节空间用于存储返回的签名后的待签名数据;Determine the signature reserved byte space in the file, wherein the signature reserved byte space is used to store the returned signed data to be signed; 更新所述各结构对象及所述各结构对象的偏移地址;updating the structure objects and the offset addresses of the structure objects; 根据更新后的所述各结构对象的偏移地址,获取所述文件的待签名数据。Acquire the data to be signed of the file according to the updated offset addresses of the structural objects. 3.根据权利要求2所述的文件编辑方法,其特征在于,所述调用CA接口在所述公章列表域处对所述待签名数据进行数字签名并生成签名后的文件,包括:3. file editing method according to claim 2, is characterized in that, described calling CA interface carries out digital signature to described data to be signed at described official seal list field place and generates the file after signature, comprising: 调用CA接口在所述公章列表域处对所述待签名数据进行数字签名;Call the CA interface to digitally sign the data to be signed at the official seal list field; 将签名后的所述待签名数据回写到所述签名预留字节空间中,生成签名后的文件。The signed data to be signed is written back into the signature reserved byte space to generate a signed file. 4.根据权利要求1所述的文件编辑方法,其特征在于,所述对所述文件进行电子签盖公章,包括:4. file editing method according to claim 1, is characterized in that, the described file is electronically signed and sealed, comprising: 获取单位公章,并将所述单位公章转化为公章图片对象;Obtain the official seal of the unit, and convert the official seal of the unit into an official seal image object; 将所述公章图片对象绑定为当前鼠标形状;Binding the official seal picture object as the current mouse shape; 响应于用户点击鼠标的操作,确定所述文件需求的实际盖章位置坐标;In response to the operation of the user clicking the mouse, the actual stamping position coordinates of the document requirements are determined; 根据所述实际盖章位置坐标,将所述公章图片对象写入所述文件。According to the coordinates of the actual stamping position, the official stamp picture object is written into the file. 5.根据权利要求4所述的文件编辑方法,其特征在于,所述响应于用户点击鼠标的操作,确定所述文件需求的实际盖章位置坐标,包括:5. The file editing method according to claim 4, wherein, in response to the operation of the user clicking the mouse, determining the actual stamping position coordinates of the file requirements, comprising: 响应于用户点击鼠标的操作,获取用户点击位置的窗口坐标;In response to the operation of the user clicking the mouse, obtain the window coordinates of the position where the user clicks; 获取用户的屏幕分辨率;Get the user's screen resolution; 根据所述窗口坐标、所述屏幕分辨率、横向滚动条位置和纵向滚动条位置,确定所述文件需求的实际盖章位置坐标。According to the window coordinates, the screen resolution, the horizontal scroll bar position and the vertical scroll bar position, the actual stamping position coordinates of the document requirement are determined. 6.根据权利要求4所述的文件编辑方法,其特征在于,在所述根据所述实际盖章位置坐标,将所述公章图片对象写入所述文件的步骤之前,所述方法还包括:6. The file editing method according to claim 4, characterized in that, before the step of writing the official seal picture object into the file according to the actual seal position coordinates, the method further comprises: 判断所述实际盖章位置坐标是否超出所述文件的页面坐标值;Judging whether the coordinates of the actual stamping position exceed the page coordinates of the file; 若是,则根据所述文件的页面坐标值与所述公章图片对象的大小再次确定实际盖章位置坐标;If so, then determine the actual seal position coordinates again according to the page coordinate value of the document and the size of the official seal picture object; 若否,则执行根据所述实际盖章位置坐标,将所述公章图片对象写入所述文件的步骤。If not, execute the step of writing the official seal picture object into the file according to the coordinates of the actual stamping position. 7.根据权利要求1所述的文件编辑方法,其特征在于,在所述对所述文件进行电子签盖公章的步骤之前,所述方法还包括7. The file editing method according to claim 1, wherein, before the step of electronically signing and stamping the file, the method further comprises: 响应于用户打开文件的操作,在展示界面展示所述文件。In response to the user's operation to open the file, the file is displayed on the display interface. 8.根据权利要求1所述的文件编辑方法,其特征在于,所述方法还包括:8. The file editing method according to claim 1, wherein the method further comprises: 将签名后的文件上传至服务器端。Upload the signed file to the server. 9.根据权利要求8所述的文件编辑方法,其特征在于,所述将签名后的文件上传至服务器端,包括:9. The file editing method according to claim 8, wherein the uploading the signed file to the server comprises: 对所述签名后的文件进行对称加密,生成第一密文;Symmetrically encrypt the signed file to generate a first ciphertext; 对所述第一密文进行非对称加密,生成第二密文;performing asymmetric encryption on the first ciphertext to generate a second ciphertext; 对所述第二密文进行数据签名,生成签名数据;performing a data signature on the second ciphertext to generate signature data; 将所述第二密文和所述签名数据上传至服务器,以使所述服务器对所述第二密文和所述签名数据进行签名验证;uploading the second ciphertext and the signature data to a server, so that the server performs signature verification on the second ciphertext and the signature data; 当签名验证未通过时,重复上述步骤直至将签名后的文件成功上传至服务器端。When the signature verification fails, repeat the above steps until the signed file is successfully uploaded to the server. 10.一种文件编辑装置,其特征在于,包括:10. A file editing device, comprising: 电子签盖公章模块,用于对所述文件进行电子签盖公章;The electronic signature and official seal module is used to electronically sign and affix the official seal to the document; 待签名数据获取模块,用于获取所述文件的待签名数据及所述电子签盖公章的公章列表域;A to-be-signed data acquisition module, used for acquiring the to-be-signed data of the document and the official seal list field of the electronic signature; 数字签名模块,用于调用CA接口在所述公章列表域处对所述待签名数据进行数字签名并生成签名后的文件。The digital signature module is used to call the CA interface to digitally sign the data to be signed at the official seal list field and generate a signed file.
CN202010443420.2A 2020-05-22 2020-05-22 File editing method and device Active CN111797434B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010443420.2A CN111797434B (en) 2020-05-22 2020-05-22 File editing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010443420.2A CN111797434B (en) 2020-05-22 2020-05-22 File editing method and device

Publications (2)

Publication Number Publication Date
CN111797434A true CN111797434A (en) 2020-10-20
CN111797434B CN111797434B (en) 2024-06-07

Family

ID=72805953

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010443420.2A Active CN111797434B (en) 2020-05-22 2020-05-22 File editing method and device

Country Status (1)

Country Link
CN (1) CN111797434B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115481445A (en) * 2022-08-16 2022-12-16 北京矩阵分解科技有限公司 Portable document format file signature checking method, device, equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2268699A1 (en) * 1998-05-12 1999-11-12 Wesley C. Sampson Method for the organizational indexing, storage, and retrieval of data according to data pattern signatures
US6058392A (en) * 1996-11-18 2000-05-02 Wesley C. Sampson Revocable Trust Method for the organizational indexing, storage, and retrieval of data according to data pattern signatures
JP2002236868A (en) * 2001-02-07 2002-08-23 Shachihata Inc Electronic seal system and recording medium for recording electronic seal program
CN1452090A (en) * 2003-05-21 2003-10-29 北京北大方正电子有限公司 Method for signature and authentication of electronic files using electronic official seal
US20160294561A1 (en) * 2013-12-19 2016-10-06 Siemens Aktiengesellschaft Method and apparatus for digitally signing a file
CN106961332A (en) * 2016-01-11 2017-07-18 腾讯科技(深圳)有限公司 A kind of purview certification method and device
US9720806B1 (en) * 2016-07-05 2017-08-01 Semmle Limited Generating stable file location identifiers for reference to locations in a file
GB201816901D0 (en) * 2018-10-17 2018-11-28 Shufti Pro Ltd Systems and methods for verifying and authenticating the remote signing
CN109753826A (en) * 2019-01-25 2019-05-14 杭州天谷信息科技有限公司 The endorsement method and system of dynamic electric stamp
CN110532811A (en) * 2019-08-30 2019-12-03 杭州天谷信息科技有限公司 A kind of PDF signature method and PDF sealing system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6058392A (en) * 1996-11-18 2000-05-02 Wesley C. Sampson Revocable Trust Method for the organizational indexing, storage, and retrieval of data according to data pattern signatures
CA2268699A1 (en) * 1998-05-12 1999-11-12 Wesley C. Sampson Method for the organizational indexing, storage, and retrieval of data according to data pattern signatures
JP2002236868A (en) * 2001-02-07 2002-08-23 Shachihata Inc Electronic seal system and recording medium for recording electronic seal program
CN1452090A (en) * 2003-05-21 2003-10-29 北京北大方正电子有限公司 Method for signature and authentication of electronic files using electronic official seal
US20160294561A1 (en) * 2013-12-19 2016-10-06 Siemens Aktiengesellschaft Method and apparatus for digitally signing a file
CN106961332A (en) * 2016-01-11 2017-07-18 腾讯科技(深圳)有限公司 A kind of purview certification method and device
US9720806B1 (en) * 2016-07-05 2017-08-01 Semmle Limited Generating stable file location identifiers for reference to locations in a file
GB201816901D0 (en) * 2018-10-17 2018-11-28 Shufti Pro Ltd Systems and methods for verifying and authenticating the remote signing
CN109753826A (en) * 2019-01-25 2019-05-14 杭州天谷信息科技有限公司 The endorsement method and system of dynamic electric stamp
CN110532811A (en) * 2019-08-30 2019-12-03 杭州天谷信息科技有限公司 A kind of PDF signature method and PDF sealing system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115481445A (en) * 2022-08-16 2022-12-16 北京矩阵分解科技有限公司 Portable document format file signature checking method, device, equipment and storage medium
CN115481445B (en) * 2022-08-16 2023-08-18 北京矩阵分解科技有限公司 Signature verification method, device and equipment for portable document format file and storage medium

Also Published As

Publication number Publication date
CN111797434B (en) 2024-06-07

Similar Documents

Publication Publication Date Title
USRE50043E1 (en) Method for associating third party content with online document signing
CN109614568B (en) A page generation method and device
CN102801779B (en) Interface presentation method, system and terminal
WO2019184138A1 (en) Bill information input method and apparatus, and computer device and storage medium
CN110362308A (en) Page generation method, device, computer equipment and storage medium
WO2020151333A1 (en) Page loading method, apparatus, computer device and storage medium
CN105807967B (en) Writing method and device of electronic whiteboard
WO2022088783A1 (en) Video production method and apparatus
US9231896B2 (en) Computer system and computer-implemented method for service and application load testing
US20080288471A1 (en) Apparatus and method for providing a data marketplace
US10067915B1 (en) Method and system for providing user interface objects in a mobile application that are scalable to mobile electronic device screens
CN110059278A (en) Web page configuration method, server and computer readable storage medium
CN111797434A (en) File editing method and device
CN111967875A (en) Block chain-based file uplink evidence storing method and device
CN108388461A (en) A kind of screen picture intercept method and device for firmware
US9304891B1 (en) Load-test generator
CN114491462A (en) Method, system, equipment and storage medium for signing multiple electronic documents once
CN111597151A (en) File generation method, apparatus, computer equipment and storage medium
CN111443992A (en) Docker mirror image difference derivation method, computer storage medium and electronic device
CN113784075A (en) Screen video reading method and system and computing device
JP7546728B1 (en) File signature processing device and file signature processing program
CN109344575B (en) Lua script file processing method and device and computing equipment
CN118468348B (en) A system, method, device and storage medium for stamping electronic archives
CN114500718B (en) A cloud mobile phone management method and device
CN113569182B (en) Data processing method, device, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant