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.)
Pending
Application number
CN202010443420.2A
Other languages
Chinese (zh)
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/CN111797434A/en
Publication of CN111797434A publication Critical patent/CN111797434A/en
Pending legal-status Critical Current

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

Abstract

One or more embodiments of the present specification provide a method and an apparatus for editing a file, the method including electronically signing and sealing the file; acquiring data to be signed of the file and a official seal list field of the electronic signature covered with the official seal; and calling a CA (certificate Authority) interface to carry out digital signature on the data to be signed at the official seal list domain and generate a signed file. According to the method, the data to be signed of the file is acquired by self, the data to be signed is not acquired by means of a third-party interface, in the process of acquiring the data to be signed, the file structure is analyzed, the digital certificate is added to the official seal list domain, the signature structure is completely and independently assembled and processed, the third-party interface is not relied on, the method is more convenient in the aspects of function expansion and optimization, the dependence of software on the operating environment is small, and the user can use the method more quickly.

Description

File editing method and device
Technical Field
One or more embodiments of the present disclosure relate to the field of file processing technologies, and in particular, to a method and an apparatus for editing a file.
Background
At present, in the electronic bidding industry, a traditional bidding tool is mainly developed by adopting languages such as C/C + or C #, and in the process of digitally signing a bidding document, the content to be signed in the bidding document is acquired by mainly calling a third-party interface, so that the system environment is excessively depended, the cross-platform operation is not realized, and the function expansion is not facilitated.
Disclosure of Invention
In view of the above, one or more embodiments of the present disclosure provide a method and an apparatus for editing a document, so as to solve the problem that the digital signature of a bidding document is too dependent on a third-party interface.
In view of the above object, a first aspect of one or more embodiments of the present specification provides a file editing method, including:
carrying out electronic signature and official seal on the file;
acquiring data to be signed of the file and a official seal list field of the electronic signature covered with the official seal;
and calling a CA (certificate Authority) interface to carry out digital signature on the data to be signed at the official seal list domain and generate a signed file.
Optionally, the obtaining of the data to be signed of the file and the official seal list field of the electronic signature covered with the official seal includes:
acquiring 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;
acquiring a official seal list field of the electronic signature covered with the official seal in the file to determine the position for carrying out digital signature;
setting a required digital signature format in the file;
determining a signature reserved byte space in the file, wherein the signature reserved byte space is used for storing returned signed data to be signed;
updating the structure objects and the offset addresses of the structure objects;
and acquiring the data to be signed of the file according to the updated offset address of each structural object.
Optionally, the invoking the CA interface digitally signs the data to be signed at the official seal list field and generates a signed file, including:
calling a CA (certificate Authority) interface to carry out digital signature on the data to be signed at the official seal list domain;
and writing the signed data to be signed back to the signature reserved byte space to generate a signed file.
Optionally, the electronically signing the document with a seal includes:
acquiring a unit official seal, and converting the unit official seal into an official seal picture object;
binding the official seal picture object into the shape of the current mouse;
responding to the operation of clicking a mouse by a user, and determining the actual stamping position coordinate of the file requirement;
and writing the official seal picture object into the file according to the actual stamping position coordinate.
Optionally, the determining, in response to an operation of clicking a mouse by a user, an actual stamping position coordinate of the file requirement includes:
responding to the operation of clicking the mouse by the user, and acquiring the window coordinate of the clicking position of the user;
acquiring the screen resolution of a user;
and determining the actual stamping position coordinate required by the file according to the window coordinate, the screen resolution, the position of the transverse scroll bar and the position of the longitudinal scroll bar.
Optionally, before the step of writing the official seal picture object into the file according to the actual stamping position coordinates, the method further includes:
judging whether the actual stamping position coordinate exceeds a page coordinate value of the file or not;
if so, determining the actual stamping position coordinate again according to the page coordinate value of the file and the size of the official seal picture object;
if not, the step of writing the official seal picture object into the file according to the actual seal position coordinate is executed.
Optionally, before the step of electronically signing the document with a seal, the method further comprises
And responding to the operation of opening the file by the user, and displaying the file on a display interface.
Optionally, the method further comprises:
and uploading the signed file to a server side.
Optionally, the uploading the signed file to the server includes:
symmetrically encrypting the signed file to generate a first ciphertext;
carrying out asymmetric encryption on the first ciphertext to generate a second ciphertext;
performing 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;
and when the signature verification fails, repeating the steps until the signed file is successfully uploaded to the server side.
A second aspect of one or more embodiments of the present specification provides, for the same purpose, a file editing apparatus, the apparatus including:
the electronic signature and seal covering module is used for carrying out electronic signature and seal covering on the file;
the data to be signed acquisition module is used for acquiring the data to be signed of the file and the official seal list field of the electronic signature covered official seal;
and the digital signature module is used for calling a CA (certificate Authority) interface to carry out digital signature on the data to be signed at the official seal list domain and generating a signed file.
Optionally, the to-be-signed data obtaining module is specifically configured to:
acquiring 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;
acquiring a official seal list field of the electronic signature covered with the official seal in the file to determine the position for carrying out digital signature;
setting a required digital signature format in the file;
determining a signature reserved byte space in the file, wherein the signature reserved byte space is used for storing returned signed data to be signed;
updating the structure objects and the offset addresses of the structure objects;
and acquiring the data to be signed of the file according to the updated offset address of each structural object.
Optionally, the digital signature module is specifically configured to:
calling a CA (certificate Authority) interface to carry out digital signature on the data to be signed at the official seal list domain;
and writing the signed data to be signed back to the signature reserved byte space to generate a signed file.
Optionally, the electronic signature is covered with a official seal module, including:
the official seal obtaining unit is used for obtaining a unit official seal and converting the unit official seal into an official seal picture object;
the official seal picture object binding unit is used for binding the official seal picture object into the shape of the current mouse;
the actual stamping position coordinate determination unit is used for responding to the operation of clicking a mouse by a user and determining the actual stamping position coordinate required by the file;
and the official seal picture object writing unit is used for writing the official seal picture object into the file according to the actual seal position coordinate.
Optionally, the actual stamping position coordinate determination unit is specifically configured to:
responding to the operation of clicking the mouse by the user, and acquiring the window coordinate of the clicking position of the user;
acquiring the screen resolution of a user;
and determining the actual stamping position coordinate required by the file according to the window coordinate, the screen resolution, the position of the transverse scroll bar and the position of the longitudinal scroll bar.
Optionally, the electronic signature module further includes:
the judging unit is used for judging whether the actual stamping position coordinate exceeds the page coordinate value of the file or not; if so, the actual stamping position coordinate determining unit determines the actual stamping position coordinate again according to the page coordinate value of the file and the size of the official seal picture object; and if not, the official seal picture object writing unit writes the official seal picture object into the file according to the actual seal position coordinate.
Optionally, the apparatus further includes a file presentation module, configured to present the file on a presentation interface in response to an operation of opening the file by a user.
Optionally, the apparatus further includes a file uploading module, configured to upload the signed file to a server.
Optionally, the file uploading module is specifically configured to symmetrically encrypt the signed file to generate a first ciphertext;
carrying out asymmetric encryption on the first ciphertext to generate a second ciphertext;
performing 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;
and when the signature verification fails, repeating the steps until the signed file is successfully uploaded to the server side.
As can be seen from the above, in the file editing method and apparatus provided in one or more embodiments of the present specification, firstly, an electronic signature is performed on a file, then, after obtaining data to be signed of the file and a official seal list field of the electronic signature on the official seal, a CA interface is called to perform digital signature on the data to be signed at the official seal list field, and finally, a signed file is generated; the data to be signed of the file is acquired by self, the data to be signed is not acquired by means of a third-party interface, in the process of acquiring the data to be signed, the file structure is analyzed, a digital certificate is added to a official seal list domain, the signature structure is completely and independently assembled and processed, the third-party interface is not relied on, the function expansion and optimization are more convenient, the dependence of software on the operating environment is small, and the use of a user is quicker.
Drawings
In order to more clearly illustrate one or more embodiments or prior art solutions of the present specification, the drawings that are needed in the description of the embodiments or prior art will be briefly described below, and it is obvious that the drawings in the following description are only one or more embodiments of the present specification, and that other drawings may be obtained by those skilled in the art without inventive effort from these drawings.
Fig. 1 is a schematic flowchart of a file editing method according to one or more embodiments of the present disclosure;
FIG. 2 is an explanation provided in one or more embodiments herein for step S12;
fig. 3 is a schematic structural diagram of a file editing apparatus according to one or more embodiments of the present disclosure.
Detailed Description
For the purpose of promoting a better understanding of the objects, aspects and advantages of the present disclosure, reference is made to the following detailed description taken in conjunction with the accompanying drawings.
It is to be noted that unless otherwise defined, technical or scientific terms used in one or more embodiments of the present specification should have the ordinary meaning as understood by those of ordinary skill in the art to which this disclosure belongs. The use of "first," "second," and similar terms in one or more embodiments of the specification is not intended to indicate any order, quantity, or importance, but rather is used to distinguish one element from another.
At present, in the electronic bidding industry, a traditional bidding tool is mainly developed by adopting languages such as C/C + or C #, and in the process of digitally signing a bidding document, the content to be signed in the bidding document is acquired by mainly calling a third-party interface, so that the system environment is excessively depended, the cross-platform operation is not realized, and the function expansion is not facilitated.
In order to solve the above problems, the present specification provides a method and an apparatus for editing a file, where an electronic signature is first performed on a file, then data to be signed of the file and a seal list field of the electronic signature covered with the seal are obtained, a CA interface is called to perform a digital signature on the data to be signed at the seal list field, and finally the signed file is generated. The method and the device can be applied to computers, tablet computers, smart phones and the like, and are not limited specifically.
For the convenience of understanding, the file editing method is described in detail below with reference to the accompanying drawings.
FIG. 1 is a schematic flow chart of a file editing method provided in the present specification; as shown in fig. 1, the method includes:
s11, carrying out electronic signature and seal stamping on the file;
s12, obtaining the data to be signed of the file and the official seal list field of the electronic signature with the official seal
And S13, calling the CA interface to digitally sign the data to be signed at the official seal list field and generating a signed file.
In practical applications, the document may be a bidding document, a financial report, an audit report, etc., and is not limited in particular. The data to be signed refers to the content which is contained in the file and needs to be signed. The official seal list field of the electronic signature plus official seal, namely the address offset of the electronic signature plus official seal, refers to the position of the electronic signature plus official seal in the file.
After an electronic device (hereinafter referred to as the electronic device) executing the method acquires a file, firstly, an electronic signature is carried out on the file, then, a official seal list field of the electronic signature covered with the official seal is acquired, and data to be signed in the file is acquired; and after acquiring the official seal list field of the electronic signature with the official seal and the data to be signed, calling a CA (certificate Authority) interface to carry out digital signature on the data to be signed at the position of the official seal list field, and generating a signed file after the digital signature is finished so as to finish the process of carrying out electronic signature with the official seal and the digital signature on the file.
The process of signing the seal with the electronic signature and the process of acquiring the data to be signed will be described in detail in the following processes, and will not be described herein again.
It can be understood that the electronic device completes the electronic signature of the file by itself to cover the official seal, and the data to be signed is also obtained by itself, and the data to be signed is not obtained by means of a third-party interface.
FIG. 2 is an explanation provided herein for step S12; in practical application, in order to edit a file, after an electronic signature is applied to the file, data to be signed of the file and a official seal list field of the electronic signature applied to the file need to be continuously acquired; then, as shown in fig. 2, in some possible embodiments, obtaining the data to be signed of the file and the official seal list field of the electronic signature covered with the official seal includes:
and S21, acquiring each structure object of the file and a cross reference table, wherein the cross reference table stores the position information of each structure object in the file.
In order to obtain each structure object of the file and the offset address of each structure object, firstly, a trailer file tail object, the number of Size document objects and a Root object are obtained, and a cross reference table for recording the relative position of each structure object of the file is recorded. The offset address is the offset of a certain address in the segment relative to the segment first address, and the relative address is the segment first address + the offset address.
And S22, acquiring a official seal list field of the electronic signature covered with the official seal in the file to determine the position for carrying out digital signature.
In practical applications, after the document is signed with the electronic signature and the seal is covered with the electronic signature, the digital signature is also required to be carried out at the position where the electronic signature and the seal are covered with the electronic signature, that is, the digital signature is required to be carried out at the position of the seal list field where the electronic signature and the seal are covered with the electronic signature in the document, and the seal list field where the electronic signature and the seal are covered with the electronic signature in the document is required to be obtained firstly.
In order to obtain a official seal list field of an electronic tag covered with an official seal in a file, firstly, an offset address of an Acroform object can be obtained, and a Fields covered official seal list is obtained according to the offset address of the Acroform object; and then calculating the address offset of the pages Anots, writing the obtained address offset of the pages Anots into the Fields covered official seal list data, calculating the address offset of the Acroform document interactive dictionary object again, and setting a SigFlags signature field.
And S23, setting the required digital signature format in the file.
In practical application, before digitally signing the content to be signed in a file, a digital signature format required in the file needs to be preset; then, the signature handler of the Filter object may be set to adobe.
And S24, determining a signature reserved byte space in the file, wherein the signature reserved byte space is used for storing the returned signed data to be signed.
In practical application, in order to store signed data to be signed, a signature reserved byte space needs to be determined in a file in advance; then, the reserved byte range space value may be calculated and written into the byterrange array with the Contents signature reserved byte space exactly matching the range space specified in byterrange, supplemented with the specified length of 0 bytes.
And S25, updating each structural object and the offset address of each structural object.
In practical application, in order to update each structure object and the offset address of each structure object, a zip compression algorithm as a compression mode of a stream object may be written first, then a resource page including a resource pattern is written, the calculated address offset of each structure object is written into a cross reference table, trailer information is updated, all byte lengths except a signature reserved byte space are obtained, and a ByteRange byte range is calculated.
And S26, acquiring the data to be signed of the file according to the updated offset addresses of the structural objects.
In practical application, after the structure objects and the offset addresses of the structure objects are updated, the data to be signed of the file can be further calculated according to the updated offset addresses of the structure objects.
It can be understood that the electronic device obtains the content to be signed in the file by itself, the data to be signed is not obtained by means of a third-party interface, in the process of obtaining the data to be signed, the file structure is analyzed, the digital certificate is added to the official seal list domain, the signature structure is completely and independently assembled and processed, the third-party interface is not relied on, the function expansion and optimization are more convenient, the dependence of software on the operating environment is small, and the use of a user is quicker.
In practical application, after data to be signed is obtained and a official seal list domain of an electronic signature covered with an official seal is determined, the data to be signed can be digitally signed; then, in some possible embodiments, invoking the CA interface to digitally sign the data to be signed at the official seal list field and generate a signed file includes:
calling a CA interface to perform digital signature on data to be signed at a official seal list domain;
and writing the signed data to be signed back to the signature reserved byte space to generate a signed file.
In order to perform digital signature on data to be signed, obtain the data to be signed in a file and determine a official seal list domain of an electronic signature covered with an official seal, a CA (certificate authority) interface can be called to perform digital signature on the data to be signed in the file at the official seal list domain to obtain the signed data to be signed; and then writing the signed data to be signed back to a signature reserved byte space, namely a Contents key, specified by the ByteRange in an overwriting mode, and regenerating the signed file.
In practical application, before the data to be signed is digitally signed, the file can be electronically signed and stamped with a seal; then, in some possible embodiments, the document is electronically signed with a notarization, including:
acquiring a unit official seal, and converting the unit official seal into an official seal picture object;
binding the official seal picture object into the current mouse shape;
determining the actual stamping position coordinate of the file requirement in response to the mouse clicking operation of a user;
and writing the official seal picture object into a file according to the actual seal position coordinate.
In practical applications, when the document is electronically signed and notarized, only one page of the document may be stamped, or multiple pages of the document may be stamped in batch, for example, 6 pages, 8 pages, or 10 pages of the document may be stamped, which is not limited specifically.
When the user selects to seal a certain page in the file, the user selects a certain page and selects a specific coordinate, and then clicks to determine, so that the electronic official seal can be sealed only at the designated coordinate position in the selected page.
When the user selects to stamp multiple pages in the file in batch, the user can fill the page range in the page range dialog box popped up on the interface of the electronic equipment, select the coordinate position of the electronic stamp, and then click to confirm, so that the electronic official stamp can be stamped at the same coordinate position in the specified page range.
After a user selects single-page stamping or batch stamping, the electronic equipment responds to the operation of the user, can firstly call a third-party U shield interface to obtain a unit official seal in the current uKey, then converts the obtained unit official seal into an official seal picture object, binds the official seal picture object into the current mouse shape, and can carry out stamping operation when the user clicks the mouse, so that the user experience is improved.
When a user clicks a mouse, the electronic equipment responds to the operation of the user and can determine the actual stamping position coordinate of the file requirement; in order to obtain the actual stamping position coordinate required by the file, the electronic equipment firstly responds to the operation of clicking a mouse by a user, obtains the window coordinate of the clicking position of the user, then obtains the screen resolution of the user, and determines the actual stamping position coordinate required by the file according to the window coordinate of the clicking position of the user, the screen resolution, the position of a transverse scroll bar and the position of a longitudinal scroll bar.
After the actual stamping position coordinate required by the file is determined, the official seal picture object is written into a certain page of the file or within a specified file page number range according to the required actual stamping position coordinate, so that the electronic signature stamping of the file is completed.
In practical application, after the actual stamping position coordinate required by the file is determined according to the coordinate of a clicked window, the screen resolution, the position of a transverse scroll bar and the position of a longitudinal scroll bar, whether the obtained actual stamping position coordinate is feasible can be further judged; then, in some possible embodiments, before the step of writing the official seal picture object to the file according to the actual stamping position coordinates, the method further comprises:
judging whether the actual stamping position coordinate exceeds the page coordinate value of the file or not;
if so, determining the actual stamping position coordinate again according to the page coordinate value of the file and the size of the official seal picture object;
if not, the step of writing the official seal picture object into the file according to the actual seal position coordinate is executed.
In one case, when the actual stamping position coordinate exceeds the page coordinate value of the file, the actual stamping position is shown to fall outside the page of the file; the actual stamping position coordinate needs to be determined again according to the page coordinate value of the file and the size of the official seal picture object, so that the re-determined actual stamping position coordinate does not exceed the page coordinate value of the file, namely the actual stamping position falls in the page of the file. And after the actual stamping position coordinate is determined again, writing the official seal picture object into a certain page of the file or in a specified file page number range according to the determined actual stamping position coordinate.
In one case, when the actual stamping position coordinate does not exceed the page coordinate value of the file, that is, when the actual stamping position is within the page of the file, the official seal picture object can be written into a certain page of the file or within a specified page range of the file directly according to the actual stamping position coordinate.
It can be understood that after the actual stamping position coordinate required by the file is obtained through calculation, whether the actual stamping position coordinate exceeds the file page coordinate value is judged at first, namely the actual stamping position coordinate is ensured to fall in the file page, the electronic signature stamping official seal is ensured to be effective, and the editing accuracy is improved.
In practical application, in order to edit a file, the file needs to be displayed first; then, in some possible embodiments, before the step of electronically signing the document with a notarization, the method further comprises:
and responding to the operation of opening the file by the user, and displaying the file on a display interface.
In practical application, in order to edit a file, a user opens the file to be edited, and then the electronic device determines how to display the file on a display interface according to the size of the file.
In one case, when the file size is 10 pages or less, thumbnails of all page numbers of the file may be presented and the current page of the file may be displayed.
Under the condition, when the size of a file is larger than 10 pages, thumbnails of the previous 10 pages of the file can be firstly displayed, when a mouse roller rolls downwards, the electronic equipment continues to load the page of the file, the content larger than 10 pages is displayed, a user can also check the structure of the file or jump to a specified page to operate according to the operations of a directory structure, page jump, the previous page, the next page and the like, the file is quickly displayed, and the user experience degree is greatly improved.
In practical application, after the file is edited, the file can be further processed; then, in some possible embodiments, the method further comprises:
and uploading the signed file to a server side.
In the file uploading process, in order to ensure the security of the file, the file is not tampered randomly, and the security of the file in the uploading process can be ensured by encrypting the file; then, in some possible embodiments, uploading the signed file to the server side includes:
symmetrically encrypting the signed file to generate a first ciphertext;
carrying out asymmetric encryption on the first ciphertext to generate a second ciphertext;
performing 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;
and when the signature verification fails, repeating the steps until the signed file is successfully uploaded to the server side.
In practical application, the second ciphertext is subjected to data signature, signature data is generated, and simultaneously, signature abstract data is also generated; and after the second ciphertext and the signature data are uploaded to the server, the server side generates the summary data of the second ciphertext again according to the second ciphertext, and then verifies whether the summary data of the second ciphertext is matched with the summary data of the signature.
And if the digest data of the second ciphertext is matched with 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 midway in the file uploading process, the digest data of the second ciphertext is not matched with the digest data of the signature, the signature verification fails, the server side feeds back verification failure information to the electronic equipment, and based on the verification failure information, the electronic equipment repeats the steps and uploads the file to the server again until the signature verification passes and the long-term file transmission is successful.
It can be understood that in the process of uploading the file to the server, the file is uploaded in an encryption mode, so that the file is prevented from being tampered in the uploading process, and the security of the file in the process is improved.
It should be noted that the method of one or more embodiments of the present disclosure may be performed by a single device, such as a computer or server. The method of the embodiment can also be applied to a distributed scene and completed by the mutual cooperation of a plurality of devices. In such a distributed scenario, one of the devices may perform only one or more steps of the method of one or more embodiments of the present disclosure, and the devices may interact with each other to complete the method.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Fig. 3 is a schematic structural diagram of a file editing apparatus provided in this specification; as shown in fig. 2, the apparatus includes:
the electronic signature and seal covering module 31 is used for carrying out electronic signature and seal covering on the file;
the data to be signed acquisition module 32 is used for acquiring data to be signed of a file and a official seal list field of an electronic signature covered with an official seal;
and the digital signature module 33 is configured to call the CA interface to digitally sign the data to be signed at the official seal list field and generate a signed file.
In a possible implementation, the to-be-signed data obtaining module 32 is specifically configured to:
acquiring 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;
acquiring a official seal list field of an electronic signature covered with an official seal in a file to determine the position for carrying out digital signature;
setting a required digital signature format in a file;
determining a signature reserved byte space in the file, wherein the signature reserved byte space is used for storing returned signed data to be signed;
updating each structure object and the offset address of each structure object;
and acquiring the data to be signed of the file according to the updated offset address of each structural object.
In a possible implementation, the digital signature module 33 is specifically configured to:
calling a CA interface to perform digital signature on data to be signed at a official seal list domain;
and writing the signed data to be signed back to the signature reserved byte space to generate a signed file.
In a possible implementation, the electronic signature stamping official seal module 31 includes:
the official seal obtaining unit is used for obtaining a unit official seal and converting the unit official seal into an official seal picture object;
the official seal picture object binding unit is used for binding the official seal picture object into the shape of the current mouse;
the actual stamping position coordinate determination unit is used for responding to the operation of clicking a mouse by a user and determining the actual stamping position coordinate required by the file;
and the official seal picture object writing unit is used for writing the official seal picture object into a file according to the actual seal position coordinate.
In a possible implementation manner, the actual stamping position coordinate determination unit is specifically configured to:
responding to the operation of clicking the mouse by the user, and acquiring the window coordinate of the clicking position of the user;
acquiring the screen resolution of a user;
and determining the actual stamping position coordinate required by the file according to the window coordinate, the screen resolution, the position of the transverse scroll bar and the position of the longitudinal scroll bar.
In a possible implementation, the electronic signature stamping official seal module 31 further includes:
the judging unit is used for judging whether the actual stamping position coordinate exceeds the page coordinate value of the file or not; if so, the actual stamping position coordinate determining unit determines the actual stamping position coordinate again according to the page coordinate value of the file and the size of the official stamp picture object; if not, the official seal picture object writing unit writes the official seal picture object into the file according to the actual seal position coordinate.
In a possible implementation manner, the device further comprises a file presentation module (not shown in the figure) for presenting the file in the presentation interface in response to the operation of opening the file by the user.
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 side.
In a possible implementation manner, the file uploading module is specifically configured to symmetrically encrypt the signed file to generate a first ciphertext;
carrying out asymmetric encryption on the first ciphertext to generate a second ciphertext;
performing 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;
and when the signature verification fails, repeating the steps until the signed file is successfully uploaded to the server side.
For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, the functionality of the modules may be implemented in the same one or more software and/or hardware implementations in implementing one or more embodiments of the present description.
The apparatus of the foregoing embodiment is used to implement the corresponding method in the foregoing embodiment, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, is limited to these examples; within the spirit of the present disclosure, features from the above embodiments or from different embodiments may also be combined, steps may be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present description as described above, which are not provided in detail for the sake of brevity.
Furthermore, devices may be shown in block diagram form in order to avoid obscuring the understanding of one or more embodiments of the present description, and this also takes into account the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform within which the one or more embodiments of the present description are to be implemented (i.e., specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the disclosure, it should be apparent to one skilled in the art that one or more embodiments of the disclosure can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative instead of restrictive.
While the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art in light of the foregoing description.
It is intended that the one or more embodiments of the present specification embrace all such alternatives, modifications and variations as fall within the broad scope of the appended claims. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of one or more embodiments of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (10)

1. A method of file editing, the method comprising:
carrying out electronic signature and official seal on the file;
acquiring data to be signed of the file and a official seal list field of the electronic signature covered with the official seal;
and calling a CA (certificate Authority) interface to carry out digital signature on the data to be signed at the official seal list domain and generate a signed file.
2. The method for editing a file according to claim 1, wherein the acquiring data to be signed of the file and the official seal list field of the electronic signature seal comprises:
acquiring 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;
acquiring a official seal list field of the electronic signature covered with the official seal in the file to determine the position for carrying out digital signature;
setting a required digital signature format in the file;
determining a signature reserved byte space in the file, wherein the signature reserved byte space is used for storing returned signed data to be signed;
updating the structure objects and the offset addresses of the structure objects;
and acquiring the data to be signed of the file according to the updated offset address of each structural object.
3. The file editing method of claim 2, wherein the invoking the CA interface digitally signing the data to be signed at the official seal list field and generating a signed file comprises:
calling a CA (certificate Authority) interface to carry out digital signature on the data to be signed at the official seal list domain;
and writing the signed data to be signed back to the signature reserved byte space to generate a signed file.
4. The method for editing a file of claim 1, wherein said electronically signing the file with a official seal comprises:
acquiring a unit official seal, and converting the unit official seal into an official seal picture object;
binding the official seal picture object into the shape of the current mouse;
responding to the operation of clicking a mouse by a user, and determining the actual stamping position coordinate of the file requirement;
and writing the official seal picture object into the file according to the actual stamping position coordinate.
5. The file editing method according to claim 4, wherein said determining the actual stamping position coordinates of the file requirement in response to the mouse click operation by the user comprises:
responding to the operation of clicking the mouse by the user, and acquiring the window coordinate of the clicking position of the user;
acquiring the screen resolution of a user;
and determining the actual stamping position coordinate required by the file according to the window coordinate, the screen resolution, the position of the transverse scroll bar and the position of the longitudinal scroll bar.
6. The file editing method according to claim 4, wherein before the step of writing the official seal picture object into the file according to the actual stamping position coordinates, the method further comprises:
judging whether the actual stamping position coordinate exceeds a page coordinate value of the file or not;
if so, determining the actual stamping position coordinate again according to the page coordinate value of the file and the size of the official seal picture object;
if not, the step of writing the official seal picture object into the file according to the actual seal position coordinate is executed.
7. The method of editing a file of claim 1, wherein prior to the step of electronically signing the file with a notarization, the method further comprises
And responding to the operation of opening the file by the user, and displaying the file on a display interface.
8. The file editing method according to claim 1, further comprising:
and uploading the signed file to a server side.
9. The method for editing the file according to claim 8, wherein the uploading the signed file to the server side includes:
symmetrically encrypting the signed file to generate a first ciphertext;
carrying out asymmetric encryption on the first ciphertext to generate a second ciphertext;
performing 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;
and when the signature verification fails, repeating the steps until the signed file is successfully uploaded to the server side.
10. A file editing apparatus, comprising:
the electronic signature and seal covering module is used for carrying out electronic signature and seal covering on the file;
the data to be signed acquisition module is used for acquiring the data to be signed of the file and the official seal list field of the electronic signature covered official seal;
and the digital signature module is used for calling a CA (certificate Authority) interface to carry out digital signature on the data to be signed at the official seal list domain and generating a signed file.
CN202010443420.2A 2020-05-22 2020-05-22 File editing method and device Pending CN111797434A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010443420.2A CN111797434A (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 CN111797434A (en) 2020-05-22 2020-05-22 File editing method and device

Publications (1)

Publication Number Publication Date
CN111797434A true CN111797434A (en) 2020-10-20

Family

ID=72805953

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN111797434A (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 (8)

* 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
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
CN110532811A (en) * 2019-08-30 2019-12-03 杭州天谷信息科技有限公司 A kind of PDF signature method and PDF sealing system

Patent Citations (8)

* 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
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
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

Similar Documents

Publication Publication Date Title
CN109542399B (en) Software development method and device, terminal equipment and computer readable storage medium
CA2841815C (en) Method for associating third party content with online document signing
CN107515759B (en) Screen capture method and device, electronic equipment and readable storage medium
CN108269062B (en) Electronic contract making method, device, equipment and medium based on H5
CN111681291A (en) Image processing method, device, equipment and computer readable storage medium
CN110659569A (en) Electronic signature method, device, storage medium and electronic equipment
CN110022558A (en) The encryption and decryption method and electronic device and storage medium of a kind of upgrade package
CN110751149A (en) Target object labeling method and device, computer equipment and storage medium
CN111399833A (en) Service data processing method and device, computer equipment and storage medium
CN113486406A (en) Electronic signature protection and restoration method and system, electronic equipment and storage medium
CN111967875A (en) Block chain-based file uplink evidence storing method and device
CN111797434A (en) File editing method and device
CN112947986A (en) Multi-version code sign-in control method and device, client and storage medium
CN109976683B (en) Data printing method, device, equipment and storage medium
CN110545542B (en) Main control key downloading method and device based on asymmetric encryption algorithm and computer equipment
CN115145545A (en) Method and device for generating small program code, computer equipment and storage medium
CN110673886B (en) Method and device for generating thermodynamic diagrams
CN111008934B (en) Scene construction method, device, equipment and storage medium
CN109408191A (en) Method for updating pages, device, equipment and storage medium
US11706463B2 (en) Video synthesis method, apparatus, computer device and readable storage medium
CN111597151A (en) File generation method and device, computer equipment and storage medium
CN109643209A (en) Large data sets are dynamically presented in client application
CN105989075A (en) Method, device and system for displaying image by browser
CN110865943A (en) Interface testing method and device, computer equipment and storage medium
CN115757608A (en) Thermodynamic diagram generation method and device, electronic equipment and storage medium

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