A method, device, equipment and medium for signing and verifying a seal

By performing summary calculation and list generation of documents to be signed on the client, the problem of limited load on the signature server is solved, and fast signature and efficient signature are achieved in a high concurrency environment.

CN114756876BActive Publication Date: 2024-11-29AISINO CORPORATION
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011582083.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-28
Publication Date
2024-11-29
Estimated Expiration
2040-12-28

AI Technical Summary

Technical Problem

The existing technology has limited load on the signature server, and it is impossible to conduct a large number of signatures under high concurrency conditions, and cannot meet the signature requirements under high concurrency environment.

Method used

The client performs summary calculation and list generation of documents to be signed on, saves the summary value to the signature description document, and sends its summary value to the signature server to avoid the signature server from calculating the summary value of each document to be protected. Reduce the load of the signature server.

Benefits of technology

It realizes fast signing under high concurrency conditions, reduces the load pressure of the signing server, and improves the processing efficiency of signing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114756876B_ABST
    Figure CN114756876B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a signing and verification method, device, equipment and medium. In the embodiment of the present invention, the summary calculation of each document to be protected is implemented on the client, and a summary list is generated at the same time. The summary list is then saved in a signature description document, and the summary value of the signature description document is calculated. The summary value of the signature description document is sent to a signature server, which avoids the signature server from calculating the summary value of each document to be protected, reduces the load pressure of the signature server, and realizes fast signing under high concurrency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a signature and seal verification method, device, equipment and medium. Background Art

[0002] Like digital certificates, electronic signatures are a means of identity verification. They exist in electronic form, are attached to electronic documents and are logically associated with them. They can be used to identify the identity of the signer of the electronic document, indicate that the signer agrees with the contents stated in the electronic document, and ensure the integrity of the document.

[0003] In the prior art, when signing, the client sends the file to be signed to the signing server, which calculates the digest value of the document to be protected in the file to be signed, and then generates a signature value based on the digest value and sends the signature value to the client, which saves the signature value to the signature saving path of the file to be signed. However, the signing method of the prior art cannot perform a large number of signatures due to the limited load of the signing server, that is, it cannot meet the signing requirements under high concurrency. Summary of the invention

[0004] The embodiments of the present invention provide a signing and verification method, device, equipment and medium to solve the problem in the prior art that the load of the signing server is limited, a large number of signatures cannot be performed, and the signing under high concurrency cannot be satisfied.

[0005] An embodiment of the present invention provides a signature method, the method comprising:

[0006] Calculate the summary of each document to be protected in the file to be signed, determine the summary value of each document to be protected, and save each summary value in the signature description document;

[0007] Determine the summary value of the signature description document and send it to the signature server;

[0008] Receive the signature value document sent by the signature server, and save the signature value document according to the saving path of the signature in the file to be signed.

[0009] Furthermore, the document to be protected includes:

[0010] File entry documents, root node documents, and other documents to be protected.

[0011] Furthermore, the step of saving the signature value document according to the saving path of the signature in the file to be signed includes:

[0012] Determine the signature list document of the file to be signed according to the file entry document;

[0013] According to the signature list document, the saving path of the signature in the file to be signed is determined, and the signature value document is saved.

[0014] Further, the determining of the signature list document of the file to be signed according to the file entry document includes:

[0015] Determine whether there is a saving path of a signature list document in the file entry document, wherein the signature list document records the signature serial numbers of all the signatures in the file to be signed;

[0016] If it exists, the signature serial number is incrementally updated;

[0017] If it does not exist, a new signature list document is created in the file entry document, and the signature serial number of the record in the signature list document is set to a preset value.

[0018] The embodiment of the present invention further provides a seal verification method, the method comprising:

[0019] Determine the target summary value corresponding to each document to be protected in the signed file;

[0020] For each target summary value, determine whether the target summary value is consistent with the corresponding summary value stored in the signature description document in the signed file;

[0021] If each target summary value is consistent with the summary value stored in the signature description document, the summary value and signature value document of the signature description document of the signed file are sent to the signature server;

[0022] Receive the sub-verification result sent by the signature server, and output the verification result of the signed file according to the sub-verification result.

[0023] Furthermore, the method further comprises:

[0024] If there is at least one target summary value that is inconsistent with the summary value corresponding to the signature description document, the result of the signed file verification failure is output.

[0025] The embodiment of the present invention further provides a signature device, the device comprising:

[0026] A digest calculation module, used to perform digest calculation on each document to be protected in the file to be signed, determine the digest value of each document to be protected, and save each digest value in the signature description document;

[0027] A sending module, used to determine the summary value of the signature description document and send it to the signature server;

[0028] The processing module is used to receive the signature value document sent by the signature server, and save the signature value document according to the saving path of the signature in the file to be signed.

[0029] Furthermore, the document to be protected includes:

[0030] File entry documents, root node documents, and other documents to be protected.

[0031] Furthermore, the processing module is specifically used to determine the signature list document of the file to be signed based on the file entry document; determine the saving path of the signature in the file to be signed based on the signature list document, and save the signature value document.

[0032] Furthermore, the processing module is specifically used to determine whether there is a saving path of a signature list document in the file entry document, wherein the signature list document records the signature serial numbers of all signatures in the file to be signed; if it exists, the signature serial numbers are incrementally updated; if it does not exist, a new signature list document is created in the file entry document, and the signature serial numbers recorded in the signature list document are set to preset values.

[0033] The embodiment of the present invention further provides a seal verification device, the device comprising:

[0034] A digest calculation module, used to determine the target digest value corresponding to each document to be protected in the signed file;

[0035] A judgment module, used for judging, for each target summary value, whether the target summary value is consistent with the corresponding summary value stored in the signature description document in the signed file;

[0036] A sending module, configured to send the summary value and signature value document of the signature description document of the signed file to the signature server if each target summary value corresponds to the summary value stored in the signature description document;

[0037] The seal verification module is used to receive the sub-verification result sent by the signature server, and output the verification result of the signed file according to the sub-verification result.

[0038] Furthermore, the seal verification module is used to output a result that the signed file verification has failed if at least one target summary value is inconsistent with the summary value corresponding to the signature description document.

[0039] An embodiment of the present invention further provides an electronic device, which includes at least a processor and a memory, and the processor is used to implement the steps of any of the above-mentioned signing or verification methods when executing a computer program stored in the memory.

[0040] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, which implements the steps of any of the above-mentioned signing or verification methods when executed by a processor.

[0041] Since the embodiment of the present invention determines the storage path of the signature in the file to be signed for the file to be signed, performs digest calculations on the documents to be protected in the file to be signed, determines the digest value of each document to be protected, generates a digest list, saves the digest list in the signature description document, sends the digest value of the signature description document to the signature server, receives the signature value sent by the signature server, and saves the signature value to the storage path. In the embodiment of the present invention, the digest calculation of each document to be protected is implemented on the client, and a summary list is generated at the same time. The summary list is then saved in the signature description document, the summary value of the signature description document is calculated, and the summary value of the signature description document is sent to the signature server, which avoids the signature server from calculating the summary value of each document to be protected, reduces the load pressure of the signature server, and realizes fast signing under high concurrency. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0043] Figure 1 A schematic diagram of a signing process provided by an embodiment of the present invention;

[0044] Figure 2 A schematic diagram of the deployment of a client in an actual application provided by an embodiment of the present invention;

[0045] Figure 3 A flow chart of a signature provided by an embodiment of the present invention;

[0046] Figure 4 A schematic diagram of a seal verification process provided by an embodiment of the present invention;

[0047] Figure 5 A flow chart of seal verification provided by an embodiment of the present invention;

[0048] Figure 6 A schematic diagram of the structure of a signature device provided by an embodiment of the present invention;

[0049] Figure 7 A schematic diagram of the structure of a seal verification device provided by an embodiment of the present invention;

[0050] Figure 8A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;

[0051] Fig. 9 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] In order to reduce the load pressure of the signature server and realize fast signature under high concurrency, the embodiment of the present invention provides a signature and seal verification method, device, equipment and medium.

[0054] Embodiment 1:

[0055] Figure 1 A schematic diagram of a signing process provided by an embodiment of the present invention includes the following steps:

[0056] S101: Perform digest calculation on each document to be protected in the file to be signed, determine the digest value of each document to be protected, and save each digest value in the signature description document.

[0057] A signature method according to an embodiment of the present invention is applied to a JAVA signature client, which may be located in an electronic device, a PC, or the like.

[0058] In an embodiment of the present invention, the document to be signed is an open fixed-layout Document (OFD) file. Each document to be protected in the OFD file has a lot of content. In order to simply and clearly identify each document to be protected, a summary calculation can be performed on each document to be protected to determine the summary value of each document to be protected. Since the content of each document to be protected is different, the summary value of each document to be protected is also different. Among them, the process of performing summary calculation on the document to be protected and obtaining the summary value is a prior art and will not be described in detail here.

[0059] After determining the digest value of each document to be protected, the digest value of each document to be protected can be sent to the signature server. In order to avoid missing or wrong sending, and also to reduce the load pressure of the signature server, in the embodiment of the present invention, each digest value can be first saved in the signature description document (signature.xml). Specifically, each digest value is combined into a digest list, and then the digest list is saved in the signature.xml.

[0060] S102: Determine the summary value of the signature description document and send it to the signature server.

[0061] In the embodiment of the present invention, after the digest value is saved in signature.xml, the digest value of the signature.xml is calculated to determine the digest value of the signature.xml, and the digest value of the signature.xml is sent to the signature server.

[0062] S103: receiving the signature value document sent by the signature server, and saving the signature value document according to the saving path of the signature in the file to be signed.

[0063] In an embodiment of the present invention, after receiving the signed value document (SignedValue.dat) sent by the signature server, the file to be signed records the saving path of the signature, and the SignedValue.dat is saved according to the saving path of the signature, that is, the SignedValue.dat is saved in the saving path of the signature.

[0064] In an embodiment of the present invention, the summary calculation of each document to be protected is implemented on the client, and a summary list is generated at the same time. The summary list is then saved in a signature description document, and then the summary value of the signature description document is calculated, and the summary value of the signature description document is sent to the signature server, thereby avoiding the signature server from calculating the summary value of each document to be protected, reducing the load pressure of the signature server, and achieving fast signing under high concurrency.

[0065] Embodiment 2:

[0066] In order to reduce the load pressure of the signature server and realize fast signature under high concurrency, based on the above embodiment, in the embodiment of the present invention, the document to be protected includes:

[0067] File entry documents, root node documents, and other documents to be protected.

[0068] The OFD file exists in the JAVA signature client in the form of an operable compressed byte stream, that is, in binary form. In an embodiment of the present invention, the document compression list corresponding to the OFD file can be obtained according to the properties of the compressed byte stream itself, thereby determining the document to be protected in the OFD file.

[0069] In this embodiment of the present invention, the document to be protected includes a file entry document (ofd.xml), a root node document (Document.xml) and other documents to be protected.

[0070] With respect to ofd.xml, the saving path of the signature list document is recorded in the ofd.xml, and the signature list document can be determined according to the ofd.xml. At the same time, the digest value of the ofd.xml is also determined and saved in the signature.xml.

[0071] For Document.xml, the location of the OFD file signature is stored in Document.xml. In an embodiment of the present invention, the content page details of the OFD file are obtained according to Document.xml, and then the location of the stamp is determined according to the content page details, that is, the location information of the signature is determined, and the location information is saved in signature.xml. At the same time, the summary value of Document.xml is also determined, and the summary value is saved in signature.xml.

[0072] For other documents to be protected, the digest value of each other document to be protected is determined, and the digest value of each other document to be protected is saved in signature.xml.

[0073] Embodiment 3:

[0074] In order to reduce the load pressure of the signature server and realize fast signature under high concurrency, based on the above embodiments, in an embodiment of the present invention, the step of saving the signature value document according to the signature saving path in the file to be signed includes:

[0075] Determine the signature list document of the file to be signed according to the file entry document;

[0076] According to the signature list document, the saving path of the signature in the file to be signed is determined, and the signature value document is saved.

[0077] In the OFD file, the location of the signature list document (signatures.xml) of the OFD file can be determined according to ofd.xml in the OFD file, thereby determining the signatures.xml, and the saving path of the signature in the OFD file can be determined according to the signatures.xml.

[0078] In an embodiment of the present invention, the location of the signatures.xml of the OFD file can be determined based on the ofd.xml, and then the saving path of the signature in the OFD file can be determined based on the signatures.xml, and the SignedValue.dat sent by the signature server is received, and the SignedValue.dat is saved to the saving path of the signature.

[0079] Embodiment 4:

[0080] In order to reduce the load pressure of the signature server and realize fast signature under high concurrency, based on the above embodiments, in an embodiment of the present invention, the signature list document of the file to be signed is determined according to the file entry document, including:

[0081] Determine whether there is a saving path of a signature list document in the file entry document, wherein the signature list document records the signature serial numbers of all the signatures in the file to be signed;

[0082] If it exists, the signature serial number is incrementally updated;

[0083] If it does not exist, a new signature list document is created in the file entry document, and the signature serial number of the record in the signature list document is set to a preset value.

[0084] In the embodiment of the present invention, since the OFD file may not have been signed, the ofd.xml in the OFD file may not have a saving path for signatures.xml, that is, the signatures.xml does not exist, wherein the signatures.xml records the signature serial numbers of all the signatures in the OFD file. Therefore, in the embodiment of the present invention, determining the signatures.xml of the OFD file according to odf.xml includes determining whether the saving path for signatures.xml exists in the ofd.xml, that is, determining whether the signature element tag has been inserted in the ofd.xml.

[0085] In the embodiment of the present invention, if the saving path of the signatures.xml exists in the ofd.xml, the signature serial number recorded in the signatures.xml is incrementally updated. Generally, the signature serial number is increased by one.

[0086] If the saving path of the signatures.xml does not exist in the ofd.xml, a new signatures.xml is created in the ofd.xml, and the signature serial number recorded in the newly created signatures.xml is set to a preset value. In the embodiment of the present invention, the signature serial number recorded in the newly created signatures.xml is generally set to 1.

[0087] In an embodiment of the present invention, signatures.xml is determined according to ofd.xml, and then the saving path of the signature in the OFD file is determined according to the signatures.xml, and a new signature.xml is created under the saving path, and the summary list containing each summary value is saved in the signature.xml.

[0088] Figure 2 A schematic diagram of the deployment of the client provided by the embodiment of the present invention in actual application, such as Figure 2 As shown, the application server only needs to call the JAVA signature client provided by the embodiment of the present invention to complete the signature operation of the OFD file, without the need for all operations to be completed by the signature server, thereby reducing the load pressure on the signature server.

[0089] Figure 3 The flowchart of the signature provided by the embodiment of the present invention is as follows: Figure 3 As shown, the process includes reading the OFD file, converting the OFD file into an operable compressed byte stream, and creating an empty output stream object to save each data obtained by the signature. Obtain the document compression list of the OFD file, and perform different operations on different documents.

[0090] For non-protected documents, such as form attachments, they are directly output to the output stream. For ofd.xml in the document to be protected, the save path of signatures.xml is determined based on the ofd.xml, thereby determining signatures.xml, and at the same time incrementally updating the signature serial number saved in the signatures.xml. Then, based on the signatures.xml, determine the save path of the signature in the OFD file, and create a new signature.xml under the save path.

[0091] For all documents to be protected, calculate the summary value of the document to be protected and obtain a summary list. Among them, for Document.xml, determine the location information of the OFD file signature based on the Document.xml, and save the summary list and the location information to signature.xml, and output the summary list and the location information to the output stream. Calculate the summary value of signature.xml, send the summary value of signature.xml to the signature server, receive SignedValue.dat sent by the signature server, and save the SignedValue.dat to the save path of the signature. At the same time, output the signature.xml and SignedValue.dat to the output stream.

[0092] Embodiment 5:

[0093] Figure 4 A schematic diagram of a seal verification process provided by an embodiment of the present invention, the process includes the following steps:

[0094] S401: Determine the target digest value corresponding to each document to be protected in the signed file.

[0095] A seal verification method according to an embodiment of the present invention is applied to a JAVA signature client, which may be located in an electronic device, a PC, or the like.

[0096] In the embodiment of the present invention, the signed file is also an OFD file. When verifying the seal, it includes local seal verification and online seal verification, wherein the local seal verification is to verify whether the content of the document to be protected of the signed file has been tampered with. In order to avoid directly verifying the specific content of each document to be protected and occupying the resources of the JAVA signature client, in the embodiment of the present invention, the summary value of each document to be protected can be directly verified to realize the verification of the document to be protected.

[0097] Specifically, in the embodiment of the present invention, a digest calculation can be performed on each document to be protected in the signed file to determine the target digest value of each document to be protected. The process of performing digest calculation on the document to be protected to obtain the digest value is a prior art and will not be described in detail here.

[0098] S402: For each target digest value, determine whether the target digest value is consistent with the corresponding digest value stored in the signature description document in the signed file.

[0099] Since the digest values ​​of all documents to be protected have been calculated when signing the signed file, and the digest value of each document to be protected has been saved in signature.xml. The digest value of each document to be protected is different, and when the content of the document to be protected is tampered with, the digest value of the document to be protected will also change.

[0100] Therefore, after calculating the digest value of each document to be protected, it is possible to determine for each target digest value whether the target digest value is consistent with the corresponding digest value saved in signature.xml in the signed file, thereby determining whether the document to be protected has been tampered with.

[0101] S403: If each target summary value is consistent with the summary value stored in the signature description document, the summary value and signature value document of the signature description document of the signed file are sent to the signature server.

[0102] In the embodiment of the present invention, if each target digest value is consistent with the digest value correspondingly stored in signature.xml, it means that the signed document has not been tampered with, that is, the signed document has completed local verification.

[0103] At this point, it is necessary to verify the signed file online to verify whether the signature in the signed file is legal. Specifically, the summary value of signature.xml and the original text of SignedValue.dat of the signed file are sent to the signature server, and the signature server completes the verification of the legality of the signature of the signed file. The verification of the legality of the signature of the signed file by the signature server is a prior art and will not be repeated here.

[0104] S404: Receive the sub-verification result sent by the signature server, and output the verification result of the signed file according to the sub-verification result.

[0105] In an embodiment of the present invention, a sub-verification result sent by a signature server is received, wherein the sub-verification result indicates that the signature in the signed file is legal or that the signature in the signed file is illegal, and a verification result of the signed file is output according to the sub-verification result.

[0106] Specifically, if the received sub-verification result is that the signature of the signed file is legal, then the output of the signed file verification is successful; if the received sub-verification result is that the signature of the signed file is illegal, then the output of the signed file verification fails.

[0107] Embodiment 6:

[0108] In order to reduce the load pressure of the signature server and implement the seal verification of the signed document, based on the above embodiments, in the embodiment of the present invention, the method further includes:

[0109] If there is at least one target summary value that is inconsistent with the summary value corresponding to the signature description document, the result of the signed file verification failure is output.

[0110] In an embodiment of the present invention, if during local verification, there is at least one target digest value that is inconsistent with the corresponding digest value saved in the signature.xml, it is considered that the signed file has not completed local verification, and there is no need to perform online verification, and the result of the signed file verification failure is directly output.

[0111] Figure 5 A flow chart of seal verification provided by an embodiment of the present invention, such as Figure 5 As shown, the process includes reading the OFD file and converting the OFD file into an operable compressed byte stream. Take the document compression list of the OFD file and perform different operations on different documents. For the document to be protected, determine the target summary value of each document to be protected, and judge whether the target summary value is consistent with the corresponding summary value saved in the OFD file signature.xml. If they are consistent, send the summary value and SignedValue.dat of the OFD file signature.xml to the signature server, and the signature server completes the verification of the legality of the signature of the signed file, and then outputs the verification result of the OFD file based on the sub-verification result sent by the signature server. If the target summary value is inconsistent with the corresponding summary value saved in the OFD file signature.xml, the verification result of the OFD file verification failure is directly output.

[0112] Embodiment 7:

[0113] Figure 6 A schematic diagram of a signature device provided in an embodiment of the present invention, the device comprising:

[0114] A digest calculation module 601 is used to perform digest calculation on each document to be protected in the file to be signed, determine the digest value of each document to be protected, and save each digest value in the signature description document;

[0115] A sending module 602 is used to determine the summary value of the signature description document and send it to the signature server;

[0116] The processing module 603 is used to receive the signature value document sent by the signature server, and save the signature value document according to the saving path of the signature in the file to be signed.

[0117] In a possible implementation, the processing module 603 is specifically used to determine the signature list document of the file to be signed based on the file entry document; determine the save path of the signature in the file to be signed based on the signature list document, and save the signature value document.

[0118] In one possible implementation, the processing module 603 is specifically used to determine whether there is a saving path of a signature list document in the file entry document, wherein the signature list document records the signature serial numbers of all signatures in the file to be signed; if it exists, the signature serial numbers are incrementally updated; if it does not exist, a new signature list document is created in the file entry document, and the signature serial numbers recorded in the signature list document are set to preset values.

[0119] Figure 7 A schematic diagram of a signature device provided in an embodiment of the present invention, the device comprising:

[0120] A digest calculation module 701 is used to determine a target digest value corresponding to each document to be protected in the signed file;

[0121] A judgment module 702 is used to judge, for each target digest value, whether the target digest value is consistent with the digest value correspondingly stored in the signature description document in the signed file;

[0122] The sending module 703 is used to send the summary value and signature value document of the signature description document of the signed file to the signature server if each target summary value is consistent with the summary value stored in the signature description document;

[0123] The seal verification module 704 is used to receive the sub-verification result sent by the signature server, and output the verification result of the signed file according to the sub-verification result.

[0124] In a possible implementation manner, the seal verification module 704 is configured to output a result indicating that the signed file verification has failed if at least one target summary value is inconsistent with a summary value corresponding to the signature description document.

[0125] Embodiment 8:

[0126] Figure 8 FIG. 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Based on the above embodiments, an embodiment of the present invention further provides an electronic device, such as Figure 8 As shown, it includes: a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804;

[0127] The memory 803 stores a computer program. When the program is executed by the processor 801, the processor 801 performs the following steps:

[0128] Calculate the summary of each document to be protected in the file to be signed, determine the summary value of each document to be protected, and save each summary value in the signature description document;

[0129] Determine the summary value of the signature description document and send it to the signature server;

[0130] Receive the signature value document sent by the signature server, and save the signature value document according to the saving path of the signature in the file to be signed.

[0131] In a possible implementation manner, the document to be protected includes:

[0132] File entry documents, root node documents, and other documents to be protected.

[0133] In a possible implementation manner, the step of saving the signature value document according to the saving path of the signature in the file to be signed includes:

[0134] Determine the signature list document of the file to be signed according to the file entry document;

[0135] According to the signature list document, the saving path of the signature in the file to be signed is determined, and the signature value document is saved.

[0136] In a possible implementation manner, determining the signature list document of the file to be signed according to the file entry document includes:

[0137] Determine whether there is a saving path of a signature list document in the file entry document, wherein the signature list document records the signature serial numbers of all the signatures in the file to be signed;

[0138] If it exists, the signature serial number is incrementally updated;

[0139] If it does not exist, a new signature list document is created in the file entry document, and the signature serial number of the record in the signature list document is set to a preset value.

[0140] Since the principle of solving the problem by the above electronic device is similar to that of the signature method, the implementation of the above electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0141] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0142] The communication interface 802 is used for communication between the above electronic device and other devices.

[0143] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0144] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0145] Fig. 9 FIG. 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Based on the above embodiments, an embodiment of the present invention further provides an electronic device, such as Fig. 9 As shown, it includes: a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904;

[0146] The memory 903 stores a computer program. When the program is executed by the processor 901, the processor 901 performs the following steps:

[0147] Determine the target summary value corresponding to each document to be protected in the signed file;

[0148] For each target summary value, determine whether the target summary value is consistent with the corresponding summary value stored in the signature description document in the signed file;

[0149] If each target summary value is consistent with the summary value stored in the signature description document, the summary value and signature value document of the signature description document of the signed file are sent to the signature server;

[0150] Receive the sub-verification result sent by the signature server, and output the verification result of the signed file according to the sub-verification result.

[0151] In a possible implementation, the method further includes:

[0152] If there is at least one target summary value that is inconsistent with the summary value corresponding to the signature description document, the result of the signed file verification failure is output.

[0153] Since the principle of solving the problem by the above electronic device is similar to that of the seal verification method, the implementation of the above electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0154] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0155] The communication interface 902 is used for communication between the electronic device and other devices.

[0156] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0157] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0158] Embodiment 9:

[0159] On the basis of the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by a processor, and when the program runs on the processor, the processor implements the following steps when executing:

[0160] Calculate the summary of each document to be protected in the file to be signed, determine the summary value of each document to be protected, and save each summary value in the signature description document;

[0161] Determine the summary value of the signature description document and send it to the signature server;

[0162] Receive the signature value document sent by the signature server, and save the signature value document according to the saving path of the signature in the file to be signed.

[0163] In a possible implementation manner, the document to be protected includes:

[0164] File entry documents, root node documents, and other documents to be protected.

[0165] In a possible implementation manner, the step of saving the signature value document according to the saving path of the signature in the file to be signed includes:

[0166] Determine the signature list document of the file to be signed according to the file entry document;

[0167] According to the signature list document, the saving path of the signature in the file to be signed is determined, and the signature value document is saved.

[0168] In a possible implementation manner, determining the signature list document of the file to be signed according to the file entry document includes:

[0169] Determine whether there is a saving path of a signature list document in the file entry document, wherein the signature list document records the signature serial numbers of all the signatures in the file to be signed;

[0170] If it exists, the signature serial number is incrementally updated;

[0171] If it does not exist, a new signature list document is created in the file entry document, and the signature serial number of the record in the signature list document is set to a preset value.

[0172] Since the principle of solving the problem by the computer-readable medium provided above is similar to that of the signature method, after the processor executes the computer program in the computer-readable medium above, the steps implemented can refer to the other embodiments above, and the repeated parts will not be repeated.

[0173] On the basis of the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by a processor, and when the program runs on the processor, the processor implements the following steps when executing:

[0174] Determine the target summary value corresponding to each document to be protected in the signed file;

[0175] For each target summary value, determine whether the target summary value is consistent with the corresponding summary value stored in the signature description document in the signed file;

[0176] If each target summary value is consistent with the summary value stored in the signature description document, the summary value and signature value document of the signature description document of the signed file are sent to the signature server;

[0177] Receive the sub-verification result sent by the signature server, and output the verification result of the signed file according to the sub-verification result.

[0178] In a possible implementation, the method further includes:

[0179] If there is at least one target summary value that is inconsistent with the summary value corresponding to the signature description document, the result of the signed file verification failure is output.

[0180] Since the principle of solving the problem by the computer-readable medium provided above is similar to that of the seal verification method, after the processor executes the computer program in the computer-readable medium, the steps implemented can refer to the other embodiments above, and the repeated parts will not be repeated.

[0181] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0182] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0183] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0184] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0185] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A signing method, It is characterized in that The method comprises: Calculate the summary of each document to be protected in the file to be signed, determine the summary value of each document to be protected, and save each summary value in the signature description document; Determine the summary value of the signature description document and send it to the signature server; Receive the signature value document sent by the signature server, and save the signature value document according to the saving path of the signature in the file to be signed; The documents to be protected include: File entry documents, root node documents, and other documents to be protected; The step of saving the signature value document according to the saving path of the signature in the file to be signed includes: Determine the signature list document of the file to be signed according to the file entry document; According to the signature list document, determine the saving path of the signature in the file to be signed, and save the signature value document; Wherein, determining the signature list document of the file to be signed according to the file entry document comprises: Determine whether there is a saving path of a signature list document in the file entry document, wherein the signature list document records the signature serial numbers of all the signatures in the file to be signed; If it exists, the signature serial number is incrementally updated; If it does not exist, a new signature list document is created in the file entry document, and the signature serial number of the record in the signature list document is set to a preset value.

2. A method for checking a seal. It is characterized in that The method comprises: Determine the target summary value corresponding to each document to be protected in the signed file; For each target summary value, determine whether the target summary value is consistent with the corresponding summary value stored in the signature description document in the signed file; If each target summary value is consistent with the summary value stored in the signature description document, the summary value and signature value document of the signature description document of the signed file are sent to the signature server; Receiving the sub-verification result sent by the signature server, and outputting the verification result of the signed file according to the sub-verification result; Wherein, the method further comprises: If there is at least one target summary value that is inconsistent with the summary value corresponding to the signature description document, the result of the signed file verification failure is output.

3. A signature device, It is characterized in that The device comprises: A digest calculation module, used to perform digest calculation on each document to be protected in the file to be signed, determine the digest value of each document to be protected, and save each digest value in the signature description document; A sending module, used to determine the summary value of the signature description document and send it to the signature server; A processing module, used for receiving a signature value document sent by a signature server, and saving the signature value document according to a saving path of the signature in the file to be signed; The documents to be protected include: File entry documents, root node documents, and other documents to be protected; The processing module is specifically used to determine the signature list document of the file to be signed according to the file entry document; determine the saving path of the signature in the file to be signed according to the signature list document, and save the signature value document; Among them, the processing module is specifically used to determine whether there is a saving path of the signature list document in the file entry document, wherein the signature list document records the signature serial numbers of all signatures in the file to be signed; if it exists, the signature serial numbers are incrementally updated; if it does not exist, a new signature list document is created in the file entry document, and the signature serial numbers recorded in the signature list document are set to preset values.

4. A seal verification device, It is characterized in that The device comprises: A digest calculation module, used to determine the target digest value corresponding to each document to be protected in the signed file; A judgment module, used for judging, for each target summary value, whether the target summary value is consistent with the corresponding summary value stored in the signature description document in the signed file; A sending module, configured to send the summary value and signature value document of the signature description document of the signed file to the signature server if each target summary value corresponds to the summary value stored in the signature description document; A seal verification module, used for receiving the sub-verification result sent by the seal server, and outputting the verification result of the signed document according to the sub-verification result; The seal verification module is used to output a result indicating that the signed file verification has failed if at least one target summary value is inconsistent with a summary value corresponding to the signature description document.

5. An electronic device, It is characterized in that The electronic device comprises at least a processor and a memory, and the processor is used to implement the steps of the signature or seal verification method according to any one of claims 1 or 2 when executing the computer program stored in the memory.

6. A computer-readable storage medium, It is characterized in that It stores a computer program, which, when executed by a processor, implements the steps of the signing or verification method according to any one of claims 1 or 2.

Citation Information

Patent Citations

  • File signature method and device and file signature verification method and device

    CN111125781A

  • Security protection method and device for file system and storage medium

    CN111177784A