Electronic license verification method and device, electronic equipment, storage medium and program product
By performing two verifications on the electronic certificate's image and OFD format file, including document validity and text information similarity comparison, the problem of inaccurate electronic certificate verification results is solved, and the accuracy and reliability of verification are improved.
Patent Information
- Application Number
- CN202511008077.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-11-18
AI Technical Summary
In existing technologies, the verification results of electronic certificates are inaccurate, forged certificates are easily authenticated as genuine, and data sharing platforms are easily tampered with, leading to inaccurate verification results.
The authenticity of the certificate is verified twice by obtaining the image and OFD format file of the electronic certificate: first, the validity of the OFD format file is verified, then the image is processed to obtain text information, and the similarity is compared with the text information in the OFD format file to finally determine the authenticity of the certificate.
This improves the accuracy of electronic certificate verification, reduces the possibility of counterfeit certificates being mistaken for genuine ones, and enhances the reliability of verification.
Smart Images

Figure CN120976935A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data information security processing technology, and in particular to an electronic certificate verification method, device, electronic device, storage medium and program product. Background Technology
[0002] With the gradual advancement of the internet, electronic certificates have been fully developed as an effective replacement for traditional paper certificates.
[0003] In related technologies, the common method for verifying the authenticity of electronic certificates is a combination of image recognition technology and online platform verification. The main steps involve acquiring, processing, and extracting text from the image generated by the electronic certificate; then, by calling a data sharing platform, querying whether an electronic certificate matching the identified text information is stored, thus determining the authenticity of the electronic certificate. However, current electronic certificate verification methods have the following vulnerabilities: Criminals can use existing technology to reverse-process forged electronic certificates and simultaneously tamper with encrypted data in the data sharing platform through intrusion or brute-force attacks, allowing forged electronic certificates to be authenticated and thus illegally profiting, causing losses to legitimate businesses or individuals. Using the above technology to verify electronic certificates can easily lead to the misidentification of forged electronic certificates as genuine, resulting in inaccurate verification results. Summary of the Invention
[0004] This application provides an electronic certificate verification method, apparatus, electronic device, storage medium, and program product, which can at least solve the problem of inaccurate electronic certificate verification results.
[0005] To solve the above-mentioned technical problems, this application is implemented as follows: In a first aspect, embodiments of this application provide an electronic certificate verification method, the method comprising: acquiring information of an electronic certificate to be verified, wherein the information of the electronic certificate to be verified includes an electronic certificate image corresponding to the electronic certificate to be verified and an OFD format file of the electronic certificate to be verified; verifying the validity of the OFD format file to obtain a first verification result; if the first verification result is a successful verification, performing image processing on the electronic certificate image to obtain first text information corresponding to the electronic certificate image; comparing the similarity between the first text information and the second text information corresponding to the OFD format file to obtain a second verification result; and determining whether the electronic certificate to be verified is a genuine electronic certificate based on the second verification result.
[0006] Secondly, embodiments of this application provide an electronic certificate verification device, which includes: a first acquisition module, configured to acquire information of an electronic certificate to be verified, wherein the information of the electronic certificate to be verified includes an electronic certificate image corresponding to the electronic certificate to be verified and an OFD format file of the electronic certificate to be verified; a second acquisition module, configured to obtain a first verification result by verifying the validity of the OFD format file; a third acquisition module, configured to perform image processing on the electronic certificate image to acquire first text information corresponding to the electronic certificate image if the first verification result is successful; a fourth acquisition module, configured to obtain a second verification result by comparing the similarity between the first text information and the second text information corresponding to the OFD format file; and a determination module, configured to determine whether the electronic certificate to be verified is a genuine electronic certificate based on the second verification result.
[0007] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory, wherein the memory stores a program or instructions that can run on the processor, and when the program or instructions are executed by the processor, they implement the steps of the method described in the first aspect above.
[0008] Fourthly, embodiments of this application provide a computer-readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect above.
[0009] Fifthly, embodiments of this application provide a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the steps of the method described in the first aspect above.
[0010] The technical solution provided in this application may include the following beneficial effects: In this embodiment, information about the electronic certificate to be verified can be obtained. This information includes the electronic certificate image and its OFD (Off-Demand File) format file. The validity of the OFD format file is then verified to obtain a first verification result. If the first verification result is successful, image processing is performed on the electronic certificate image to obtain first text information corresponding to the image. A second verification result is obtained by comparing the similarity between the first text information and the second text information corresponding to the OFD format file. Finally, based on the second verification result, it is determined whether the electronic certificate to be verified is genuine. This effectively reduces errors in electronic certificate verification results and improves the accuracy of electronic certificate verification.
[0011] In the embodiments of this application, it should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit this application. Attached Figure Description
[0012] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0013] Figure 1 A flowchart illustrating an electronic certificate verification method provided in an embodiment of this application is shown. Figure 2 A flowchart illustrating another electronic certificate verification method provided in an embodiment of this application is shown; Figure 3 This illustration shows a structural schematic diagram of an electronic certificate verification device provided in an embodiment of this application; Figure 4 This illustration shows a structural schematic diagram of an electronic device provided in an embodiment of this application; Figure 5 A schematic diagram of the structure of another electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0014] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0015] In some related technologies, electronic certificate verification is performed using the following methods: acquiring an electronic certificate image from a terminal; performing image processing on the electronic certificate image to obtain the feature structure of the text in the electronic certificate image; identifying text information from the electronic certificate image based on the feature structure; calling a data sharing platform to query whether the data sharing platform stores an electronic certificate that matches the text information; if the data sharing platform stores an electronic certificate that matches the text information, then the electronic certificate to be verified is determined to be genuine; if the data sharing platform does not store an electronic certificate that matches the text information, then the electronic certificate to be verified is determined to be counterfeit.
[0016] In other related technologies, by extracting signature images, digital certificates of management institutions, and electronic certificate images from users' electronic certificate information, feature vectors are constructed and text-related feature maps of user certificate information are established. Finally, a classifier is used to obtain classification results to determine the legality and validity of electronic certificates, thereby improving the security and trustworthiness of electronic certificate data sharing.
[0017] In summary, most of the methods for verifying the authenticity of electronic certificates in related technologies rely on data verification in data sharing platforms. The main technical means are to improve the accuracy of electronic certificate verification by improving the processing of electronic certificate images and reducing the granularity of data in the data sharing platform. However, these methods cannot fundamentally solve the problem of inaccurate verification results caused by forged certificates or platform data tampering.
[0018] In view of the problems in the related technologies, this application proposes an electronic certificate verification scheme to solve at least one of the above-mentioned technical problems. The technical solution provided by the embodiments of this application will be described below with reference to the accompanying drawings.
[0019] Figure 1 This illustration shows a flowchart of an electronic certificate verification method provided in an exemplary embodiment of this application. This method can be executed by an electronic device, such as a mobile phone or computer. Figure 1 As shown, the method mainly includes the following steps: S101: Obtain information about the electronic certificate to be verified.
[0020] The information of the electronic certificate to be verified includes the electronic certificate image corresponding to the electronic certificate to be verified and the OFD format file of the electronic certificate to be verified.
[0021] In this embodiment of the application, the electronic certificate image corresponding to the electronic certificate to be verified and the OFD (Open Fixed-layout Document, an electronic file format) layout file of the electronic certificate to be verified can be obtained.
[0022] In practical applications, electronic certificates refer to various legally valid documents such as certificates, proofs, approvals, appraisal reports, and service results issued by various entities in accordance with the law, such as ID cards, marriage certificates, bank repayment statements, and business licenses. The electronic certificate to be verified in this application embodiment can be one of the above-mentioned electronic certificates, and the specific type is not limited.
[0023] Obtaining information about the electronic certificate to be verified can involve acquiring the electronic certificate image and its OFD format file, which are uploaded by the user via a terminal or other electronic device. The OFD format file can be downloaded by the user from the corresponding official platform. The electronic certificate image can be obtained by scanning or photographing the original electronic certificate, or by other methods; this application does not impose specific limitations on these methods.
[0024] In practical applications, electronic certificate images can be in JPG or PNG format, and this application embodiment does not make specific limitations. In practical applications, OFD documents are container format files, and OFD layout files can be understood as compressed packages. OFD layout files have the following characteristics: (1) Consistent display: permanently readable, can save files for a long time, and display accurately, so that the layout content of the file can remain consistent in different scenarios and devices. (2) Not easy to tamper with: supports domestic encryption algorithms, has a complete security protection system, can prevent information from being stolen, and is more secure when combined with digital signature technology. (3) Extensibility: uses Extensible Markup Language XML to describe data and structure inside the document, which is concise, secure and open. (4) Small size: the number of bytes is much smaller than other types of documents, the document is opened and written faster, the amount of computation during runtime is smaller, and less resources are required. (5) High security: national independent standards to ensure document security. In practical applications, change the OFD file extension to .zip, and you can see the contents of the file after decompression. Due to the aforementioned characteristics of OFD format files, the OFD format file of the electronic certificate to be verified can be obtained, thereby enabling the verification of the electronic certificate. Moreover, obtaining the OFD format file of the electronic certificate to be verified during the verification process increases the difficulty of forgery and helps reduce the possibility of electronic certificate forgery.
[0025] S102: By verifying the validity of the OFD format file, a first verification result is obtained.
[0026] In this embodiment, the validity of the OFD format file of the electronic certificate to be verified can be verified to obtain a first verification result. This allows determination of whether the OFD format file of the electronic certificate to be verified is usable or reliable.
[0027] In practical applications, the first verification result based on the validity of the OFD (Official Document File) version of the electronic certificate to be verified can be verification failure, indicating that the OFD version of the electronic certificate to be verified is invalid, and thus the electronic certificate to be verified can be determined to be a fake electronic certificate. Conversely, a first verification result of verification success indicates that the OFD version of the electronic certificate to be verified is valid, and the next step of verification can proceed.
[0028] S103: If the first verification result is successful, perform image processing on the electronic certificate image to obtain the first text information corresponding to the electronic certificate image.
[0029] In this embodiment of the application, if the first verification result is successful, image processing can be performed on the electronic certificate image to obtain the first text information corresponding to the electronic certificate image.
[0030] In practical applications, the electronic certificate image to be verified can be processed, and the text feature structure in the electronic certificate image can be obtained based on the processed image information. The text feature structure includes at least one of the character stroke endpoints, character stroke intersections, and character stroke positions, and the text information in the electronic certificate image to be verified can be determined according to the feature structure.
[0031] In practical applications, image processing of electronic certificate images to obtain the first text information corresponding to the electronic certificate image may include the following steps: (1) performing grayscale processing on the electronic certificate image; dividing the electronic certificate image to be processed into multiple grid regions and detecting the grayscale of each grid region; if the grayscale is greater than the preset grayscale reference, adjusting the brightness of the corresponding grid region to the preset grayscale reference.
[0032] (2) Binarize the image after grayscale processing. Based on the grayscale value, use image binarization to distinguish the processed area after grayscale processing to obtain at least one pure black area and at least one pure white area. If the grayscale value is higher than the preset grayscale value, the grayscale value of the corresponding pixel is set to 255, and the pixel with a grayscale value of 255 is white; if the grayscale value is not higher than the preset grayscale value, the grayscale value of the corresponding pixel is set to 0, and the pixel with a grayscale value of 0 is black.
[0033] (3) Denoise reduction is performed on the binarized image.
[0034] (4) Extract text from the denoised image. Cut each line of text along the upper and lower boundaries of the horizontal direction, and then cut it along the vertical direction to achieve text segmentation of the image; obtain the position information of the text segmentation to obtain the feature structure; use the structural feature extraction method to compare the text feature structure with the text feature structure in the word database to obtain the corresponding text information data (first text information).
[0035] S104: A second verification result is obtained by comparing the similarity between the first text information and the second text information corresponding to the OFD format file.
[0036] In this embodiment, a similarity comparison can be performed between the first text information and the second text information corresponding to the OFD format file to obtain a second verification result. This allows for determination of whether the first text information corresponding to the electronic certificate image to be verified is similar to the second text information corresponding to the OFD format file, thereby confirming the validity of the electronic certificate image.
[0037] Under normal circumstances, the electronic certificate image and the OFD (Official Document Format) file are identical. In this case, the first text information in the electronic certificate image also matches the corresponding second text information in the OFD file. However, when the electronic certificate to be verified is counterfeit, although the OFD file may be valid, the first text information in the electronic certificate image and the corresponding second text information in the OFD file may not match. Comparing the similarity between the first and second text information helps determine whether the electronic certificate image is valid and whether the electronic certificate to be verified is genuine.
[0038] S105: Based on the second verification result, determine whether the electronic certificate to be verified is a genuine electronic certificate.
[0039] In this embodiment, the authenticity of the electronic certificate to be verified can be determined based on the second verification result. Thus, by performing double verification on the electronic certificate through both the first and second verification results, the problem of erroneous verification results can be effectively reduced, improving the accuracy of electronic certificate verification.
[0040] In one optional implementation, obtaining a first verification result by verifying the validity of the OFD layout file may include the following steps: Step 1021: Parse the OFD layout file to obtain the file information corresponding to the OFD layout file, wherein the file information includes indexing information, signature information and layer information.
[0041] In this embodiment, the OFD format file can be parsed to obtain file information such as indexing information, signature information, and layer information corresponding to the OFD format file. In practical applications, the original OFD file can be read, and each page of the OFD certificate can be looped through to parse and store the relevant files containing the following content: indexing information, signature information, and layer information. The indexing information can be read first. <ofd:customdatas>The node tree identifies and stores the Name attribute name and value for each child node. Then, it reads the Signature file... <ofd:signedinfo>Node tree, for each child node <ofd:checkvalue>The attribute values are identified and stored, and information from the SignValue.dat file is read to identify the CA certificate, signature information, encryption algorithm, etc., corresponding to the OFD. Final identification... <ofd:layer>The node sequence and the number are stored as OFD layer information.
[0042] In step 1022, the node name and the number in the layer information are compared with the node name and the number in the index information to obtain a comparison result.
[0043] In the embodiment of the present application, the node name and the number in the layer information are compared with the node name and the number in the index information to obtain a comparison result, so that the OFD layout file can be simply verified to determine whether the OFD layout file is valid.
[0044] In step 10231, in the case that the comparison result is inconsistent, it is determined that the electronic certificate to be verified is a false electronic certificate.
[0045] In actual application, in a normal OFD layout file, the node name and the number in the layer information are consistent with the node name and the number in the index information. Therefore, in the embodiment of the present application, in the case that the comparison result obtained by comparing the node name and the number in the layer information with the node name and the number in the index information is inconsistent, it can be determined that the OFD layout file is fake, and the electronic certificate to be verified is a false electronic certificate.
[0046] In step 10232, in the case that the comparison result is consistent, the signature information is verified to obtain a first verification result.
[0047] In actual application, in the case that the comparison result obtained by comparing the node name and the number in the layer information with the node name and the number in the index information is consistent, the signature information can be verified to determine whether the OFD layout file is valid.
[0048] In an optional implementation, the verification of the signature information to obtain a first verification result can include the following steps. In step 1, it is verified whether the issuing authority of the CA certificate in the signature information is in a trusted root certificate issuing authority list, wherein the trusted root certificate issuing authority list is used to store trusted root certificate issuing authorities.
[0049] In step 2, in the case that the issuing authority of the CA certificate is in the trusted root certificate issuing authority list, it is verified whether the current time is in an electronic seal valid time period in the signature information.
[0050] In practical applications, if the CA certificate issuing authority is not on the list of trusted root certificate authorities, it can be determined that the OFD document is invalid, and thus the electronic certificate to be verified is fake. If the CA certificate issuing authority is on the list of trusted root certificate authorities, it can be verified whether the current time is within the valid time period of the electronic seal in the signature information.
[0051] Step 3: If the current time is within the valid time period of the electronic seal in the signature information, obtain the first signature verification information of the OFD format file based on the public key information and public key parameters of the CA certificate.
[0052] In practical applications, if the current time is not within the valid time period of the electronic seal in the signature information, it means that the OFD format file is invalid, and thus it can be determined that the electronic certificate to be verified is fake. If the current time is within the valid time period of the electronic seal in the signature information, the signature information of the OFD can be calculated based on the public key information and public key parameters of the CA certificate to obtain the first signature verification information of the OFD format file.
[0053] Step 4: Compare the first signature verification information with the second signature verification information in the OFD format file to obtain the first verification result.
[0054] In practical applications, the first signature verification information can be compared with the second signature verification information included in the OFD format file to obtain the first verification result. If the first signature verification information matches the second signature verification information, the first verification result is successful, and the OFD format file is valid. If the first signature verification information does not match the second signature verification information, the first verification result is unsuccessful, and the OFD format file is invalid.
[0055] In an optional implementation, obtaining a second verification result by comparing the similarity between the first text information and the second text information corresponding to the OFD layout file may include the following steps: Step 1041: Based on the names of each text attribute of the electronic certificate to be verified, obtain the second text information corresponding to the OFD format file from the indexing information; in practical applications, the corresponding values, i.e., the second text information, can be obtained from the OFD indexing information based on the names of each text attribute of the electronic certificate.
[0056] Step 1042: Compare the similarity between the first text information and the second text information to obtain a second verification result. In practical applications, a similarity comparison can be performed between the first text information and the second text information to obtain a second verification result. If the first text information and the second text information are identical, it indicates that the second verification result is successful. In one optional implementation, determining whether the electronic certificate to be verified is a genuine electronic certificate based on the second verification result may include the following steps: Step 1051: If the second verification result is successful, perform a similarity comparison between the electronic certificate image and the image corresponding to the OFD format file to obtain a third verification result.
[0057] In practical applications, if the second verification result is successful, a similarity comparison can be performed between the electronic certificate image and the corresponding OFD format file. This can further determine whether the electronic certificate image and the corresponding OFD format file are similar, thereby further judging the validity of the electronic certificate image. If the similarity between the electronic certificate image and the corresponding OFD format file is low, the OFD format file is valid, and it can be determined that the electronic certificate image is highly likely to have been tampered with, requiring further verification.
[0058] Step 1052: Obtain a fourth verification result by querying whether the data sharing platform stores an electronic certificate that matches the first text information, wherein the data sharing platform stores at least one electronic certificate that has passed authenticity authentication.
[0059] In practical applications, one can query whether the data sharing platform contains electronic certificates with corresponding text information data, and perform data comparison to obtain the fourth verification result. If the similarity of the comparison result is higher than the preset threshold, the fourth verification result is that the verification is passed; otherwise, the fourth verification result is that the verification is not passed.
[0060] Step 1053: Verify the electronic certificate to be verified through the administrative agency service platform to obtain a fifth verification result, wherein the administrative agency service platform stores information on at least one electronic certificate that has passed authenticity authentication.
[0061] Step 1054: Based on the third verification result, the fourth verification result, and the fifth verification result, determine whether the electronic certificate to be verified is a genuine electronic certificate. In practical applications, the authenticity of the electronic certificate to be verified can be determined through the third, fourth, and fifth verification results. Using three different methods to determine the authenticity of the electronic certificate can effectively prevent errors in the verification results caused by tampering with a single data source.
[0062] In practical applications, when comparing the similarity between electronic certificate images and the corresponding OFD format files, both can be formatted first. For example, according to various official standards related to electronic certificates, the size (length a1, width a2) of the electronic certificate image to be verified (referred to as A) can be adjusted to the size (length b1, width b2) of the official image (referred to as B). For instance, the national standard size for electronic marriage certificates is 210mm x 297mm, so when verifying electronic marriage certificates, the images are uniformly adjusted to this size. When either a1 or a2 is smaller than b1 or b2, image enlargement is performed, inserting (b1 / a1)-1 pixels between each pixel of A, where RGB represents the average value of each adjacent pixel of a1. When a1 and a2 are larger than b1 and b2 respectively, image compression is performed, retaining the pixel value of each b1 / a1+1th point of A. Then, according to the official standards related to various electronic certificates, the XML information of each layer in the OFD file is processed one by one. The X and Y boundaries of each layer are adjusted to the corresponding national standard dimensions as described above, and the various point values involved in each layer are adjusted proportionally. Finally, the adjusted layer XML files are merged and drawn into an image file. The above formatting operation can make the image more standardized and remove noise and interference from the image. For example, a fake electronic certificate A may be forged using electronic certificate B. Because it uses information from B, the OFD format file may be valid, but the image of the electronic certificate is still from A. By formatting the electronic certificate image, the image of A can be restored to the image of B, thereby enabling verification.
[0063] In one optional implementation, the step of verifying the electronic certificate to be verified through the administrative agency service platform to obtain the fifth verification result may include the following steps: Step 1: Based on the search information, perform a search on the administrative agency service platform to obtain at least one candidate electronic certificate, wherein the search information includes at least one of the following: at least one piece of the first text information, and at least one piece of the document information.
[0064] In practical applications, textual or image features of the electronic certificate to be verified can be selected as search information, such as version number, digital signature, seal image, text signature, etc. This application embodiment does not impose specific limitations. By using at least one search piece of information on the administrative agency service platform, at least one candidate electronic certificate can be obtained.
[0065] Step 2: Compare the business information of at least one candidate electronic certificate with the first text information of the electronic certificate to be verified. If the comparison results are consistent, encrypt the basic information of the candidate electronic certificate and other information of the candidate electronic certificate other than the basic information according to the business information of the candidate electronic certificate to obtain a first encryption result.
[0066] In practical applications, the business information of a candidate electronic certificate can be compared with the first text information of the electronic certificate to be verified. If the comparison result is inconsistent, the business information of the next candidate electronic certificate can be compared with the first text information of the electronic certificate to be verified. If the comparison results of the business information of all candidate electronic certificates are inconsistent with the first text information of the electronic certificate to be verified, the electronic certificate to be verified can be determined to be a fake electronic certificate. If the comparison results are consistent, the basic information of the candidate electronic certificate and other information of the candidate electronic certificate can be encrypted based on the business information of the candidate electronic certificate to obtain a first encrypted result. This facilitates a more comprehensive comparison between the candidate electronic certificate and the electronic certificate to be verified.
[0067] Step 3: Compare the similarity between the first encryption result and the second encryption result included in the OFD version file to obtain the fifth verification result.
[0068] In practical applications, the first encryption result can be compared with the second encryption result included in the OFD format file to obtain the fifth verification result. This allows for full utilization of the administrative agency's service platform to verify the electronic certificate, resulting in a more accurate verification result.
[0069] In practical applications, when comparing the retrieved candidate electronic certificates with the electronic certificates to be verified in steps 2 and 3 above, the electronic certificates can be categorized into natural persons and legal persons based on the different certificate holders. The information comparison content for natural person electronic certificates includes basic information such as name, identity information, personal signature, and fingerprint image. The information comparison content for legal person electronic certificates includes basic legal person information, government seal image, legal person signature image, and digital signature.
[0070] The comparison method for electronic certificates for natural persons is as follows: For the business information of the electronic certificate (such as the names of the male and female parties in a marriage certificate), the information items are compared in plaintext; for the basic information and other information of the electronic certificate, based on the name and ID number, and using the user's fingerprint feature value as the salt value, a 12-bit key is calculated as the user's public key. The SM4 algorithm is then used to encrypt the basic information and other information based on the public key to obtain the first encryption result. The first encryption result is then compared with the second encryption result passed in the OFD version file.
[0071] The comparison method for electronic certificates of legal entities is as follows: For the business information of the electronic certificate (such as the visible fields of legal representative, name, type, etc. in the business license), the information items are compared in plaintext; for the basic information and other information of the electronic certificate, based on the name of the certificate holder and the organization code (generally the unified social credit code), and using the digital signature feature value of the legal entity as the salt value, a 12-bit key is obtained by hash calculation as the public key of the legal entity. The SM4 algorithm is used to encrypt the basic information and other information based on the public key to obtain the first encryption result. The first encryption result is compared with the second encryption result passed in the OFD version file. In one optional implementation, determining whether the electronic certificate to be verified is a genuine electronic certificate based on the third verification result, the fourth verification result, and the fifth verification result may include the following two cases: In the first scenario, if the third verification result, the fourth verification result, and the fifth verification result are all passed, the electronic certificate to be verified is determined to be a genuine electronic certificate. Specifically, if the similarity between the electronic certificate image and the image corresponding to the OFD format file is greater than or equal to a first threshold, the third verification result is passed. If the similarity between the first encryption result and the second encryption result is greater than or equal to a second threshold, the fifth verification result is passed. In practical applications, if the third, fourth, and fifth verification results are all passed, the electronic certificate to be verified can be determined to be genuine. This avoids the problem of incorrect verification results caused by tampering with a single data source. In practical applications, the first threshold can be 95%, and the second threshold can also be 95%, without specific limitations in this embodiment. In practical applications, the following formula can be used for determination: Determination result X = (M==1)&&(N==1)&&(O>=95%)&&(P==1)&&(Q>=95%). Where M is the first verification result, N is the second verification result, O is the third verification result, P is the fourth verification result, and Q is the fifth verification result. When the result X calculated by the above formula is true, the electronic certificate to be verified is determined to be genuine.
[0072] In the second scenario, if the preset conditions are not met, the electronic certificate to be verified is determined to be a fake electronic certificate.
[0073] In practical applications, the preset conditions can be that the third, fourth, and fifth verification results are all passed. If at least one of these results fails, the electronic certificate to be verified can be directly determined to be fake. The preset conditions can also be determined based on the actual situation. For example, if at least one of these results fails, the process can be switched to manual processing. Supervisory personnel can determine the authenticity of the electronic certificate based on the specific similarity results. For instance, an individual's electronic certificate might have a 98% similarity in text comparison, but the image similarity is only 90% due to different image acquisition times, resulting in an overall similarity of less than 95%. However, it can still be manually determined to be genuine. This manual determination will be logged and stored on the backend server for later information verification.
[0074] It should be noted that if a verification result is "verification failed", the electronic certificate to be verified can be directly determined to be a fake electronic certificate, and subsequent verification steps can be skipped, thus saving time.
[0075] In practical applications, a comprehensive search can be performed based on at least one item of the indexing information and at least one item of the layer information in the user's electronic certificate OFD, as well as the certificate holder's name (natural person's name or legal person's name, etc.), certificate holder's code (natural person's ID number or unified social credit code, etc.), and electronic certificate type code. If data matching the electronic certificate information to be verified is found in the local database, a complete content comparison is further performed, including all OFD indexing information, all layer information, and signature information. If the comparison result is correct, the electronic certificate to be verified is determined to be genuine; otherwise, the electronic certificate is determined to be fake.
[0076] Figure 2 The illustration shows a flowchart of another electronic certificate verification method provided in an exemplary embodiment of this application, as follows: Figure 2 As shown, the method mainly includes the following steps: Step 201: The terminal collects information from the image / text of the electronic certificate to be verified.
[0077] Step 202: The image / text processing module processes the acquired information accordingly and extracts the corresponding image / text features.
[0078] Step 203: Parse and process the OFD file information of the electronic certificate to obtain the indexing information, signature information and layer information of the OFD file.
[0079] Step 204: Verify the validity of the OFD board file.
[0080] Step 205: Compare the text information of the electronic certificate with the OFD format file.
[0081] Step 2061: The first verification module compares the electronic certificate image with the OFD file image to obtain the verification result.
[0082] Step 2062: The second verification module obtains data from the data sharing service platform and compares the electronic certificate to be verified with the data from the sharing service platform to obtain the verification result.
[0083] Step 2063: After being authorized by a dedicated person, the third verification module obtains data from the corresponding administrative agency's service platform and compares the electronic certificate to be verified with the corresponding correlation data on the platform to obtain the verification result.
[0084] Step 207: The verification result determination module determines the verification result. Are all three verification module determination results true? If the result of step 207 is yes, proceed to step 2081; if the result of step 207 is no, proceed to step 2082.
[0085] Step 2081: Determine that the electronic certificate to be verified is genuine.
[0086] Step 2082: Determine that the electronic certificate to be verified is not genuine.
[0087] The electronic certificate verification method provided in this application can be executed by an electronic certificate verification device. This application uses an electronic certificate verification device executing the electronic certificate verification method as an example to illustrate the electronic certificate verification device provided in this application.
[0088] Figure 3 This illustration shows a schematic diagram of an electronic certificate verification device provided in an exemplary embodiment of this application. This electronic certificate verification device can achieve the following: Figure 1 The electronic certificate verification device, as shown in all or part of the embodiments, includes: a first acquisition module 301, a second acquisition module 302, a third acquisition module 303, a fourth acquisition module 304, and a determination module 305. In this embodiment, the first acquisition module 301 is used to acquire information about the electronic certificate to be verified, wherein the information about the electronic certificate to be verified includes an electronic certificate image corresponding to the electronic certificate to be verified and an OFD format file of the electronic certificate to be verified; the second acquisition module 302 is used to obtain a first verification result by verifying the validity of the OFD format file; the third acquisition module 303 is used to perform image processing on the electronic certificate image to acquire first text information corresponding to the electronic certificate image if the first verification result is successful; the fourth acquisition module 304 is used to obtain a second verification result by comparing the similarity between the first text information and the second text information corresponding to the OFD format file; and the determination module 305 is used to determine whether the electronic certificate to be verified is a genuine electronic certificate based on the second verification result.
[0089] In an optional implementation, the second acquisition module 302 is used to obtain a first verification result by verifying the validity of the OFD format file, including: The OFD layout file is parsed to obtain the file information corresponding to the OFD layout file, wherein the file information includes indexing information, signature information and layer information; The node names and quantities in the layer information are compared with the node names and quantities in the indexing information to obtain the comparison results; If the comparison results are inconsistent, the electronic certificate to be verified is determined to be a fake electronic certificate. If the comparison results are consistent, the signature information is verified to obtain a first verification result.
[0090] In an optional implementation, the second acquisition module 302 is used to verify the signature information and obtain a first verification result, including: Verify whether the issuing authority of the CA certificate in the signature information is in the trusted root certificate authority list, wherein the trusted root certificate authority list is used to store trusted root certificate authorities; If the CA certificate issuing authority is on the list of trusted root certificate authorities, verify whether the current time is within the valid time period of the electronic seal in the signature information; If the current time is within the valid time period of the electronic seal in the signature information, the first signature verification information of the OFD format file is obtained based on the public key information and public key parameters of the CA certificate; The first signature verification information is compared with the second signature verification information in the OFD format file to obtain the first verification result.
[0091] In an optional implementation, the fourth acquisition module 304 is used to obtain a second verification result by comparing the similarity between the first text information and the second text information corresponding to the OFD layout file, including: Based on the text attribute names of the electronic certificate to be verified, the second text information corresponding to the OFD format file is obtained from the indexing information; The similarity between the first text information and the second text information is compared to obtain a second verification result.
[0092] In one optional implementation, the determining module 305 determines whether the electronic certificate to be verified is a genuine electronic certificate based on the second verification result, including: If the second verification result is successful, a similarity comparison is performed between the electronic certificate image and the image corresponding to the OFD format file to obtain a third verification result. A fourth verification result is obtained by querying whether an electronic certificate matching the first text information is stored in the data sharing platform, wherein the data sharing platform stores at least one electronic certificate that has passed authenticity authentication. The electronic certificate to be verified is verified through the administrative agency service platform to obtain a fifth verification result, wherein the administrative agency service platform stores information on at least one electronic certificate that has passed the authenticity authentication. Based on the third verification result, the fourth verification result, and the fifth verification result, it is determined whether the electronic certificate to be verified is a genuine electronic certificate.
[0093] In an optional implementation, the determining module 305 is used to verify the electronic certificate to be verified through the administrative agency service platform to obtain a fifth verification result, including: Based on the search information, a search is conducted on the administrative agency service platform to obtain at least one candidate electronic certificate, wherein the search information includes at least one of the following: at least one piece of the first text information, and at least one piece of the document information; The business information of at least one of the candidate electronic certificates is compared with the first text information of the electronic certificate to be verified. If the comparison result is consistent, the basic information of the candidate electronic certificate and other information of the candidate electronic certificate other than the basic information are encrypted according to the business information of the candidate electronic certificate to obtain a first encryption result. The first encryption result is compared with the second encryption result included in the OFD version file to obtain the fifth verification result.
[0094] In an optional implementation, the determining module 305 is used to determine whether the electronic certificate to be verified is a genuine electronic certificate based on the third verification result, the fourth verification result, and the fifth verification result, including: If the third verification result is successful, the fourth verification result is successful, and the fifth verification result is successful, the electronic certificate to be verified is determined to be a genuine electronic certificate. Specifically, if the similarity between the electronic certificate image and the image corresponding to the OFD format file is greater than or equal to a first threshold, the third verification result is successful. If the similarity between the first encryption result and the second encryption result is greater than or equal to a second threshold, the fifth verification result is successful. If the preset conditions are not met, the electronic certificate to be verified is determined to be a fake electronic certificate.
[0095] The electronic certificate verification device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0096] The electronic certificate verification device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0097] The electronic certificate verification device provided in this application embodiment can achieve... Figure 1 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0098] Optionally, such as Figure 4 As shown, this application embodiment also provides an electronic device 400, including a processor 401 and a memory 402. The memory 402 stores a program or instructions that can run on the processor 401. When the program or instructions are executed by the processor 401, they implement the above-mentioned... Figure 1 The steps of the electronic certificate verification method shown are all the same and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0099] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0100] Figure 5 This illustration shows a structural block diagram of another electronic device 500 according to an exemplary embodiment of this application. The electronic device 500 can be implemented as a smartphone, tablet computer, laptop computer, desktop computer, smartwatch, and television, etc. The electronic device 500 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.
[0101] Typically, electronic device 500 includes a processor 501 and a memory 502.
[0102] Processor 501 may include one or more processing cores, such as an 8-core processor, a 10-core processor, etc. Processor 501 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 501 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 501 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 501 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0103] Memory 502 may include one or more computer-readable storage media, which may be non-transitory. Memory 502 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in memory 502 is used to store at least one instruction, which is executed by processor 501 to implement all or part of the steps in the electronic certificate verification method shown in the method embodiments of this application.
[0104] In some embodiments, the electronic device 500 may also optionally include a peripheral device interface 503 and at least one peripheral device. The processor 501, memory 502, and peripheral device interface 503 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 503 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 504, a display screen 505, a camera assembly 506, an audio circuit 507, and a power supply 508.
[0105] In some embodiments, the electronic device 500 further includes one or more sensors 509. The one or more sensors 509 include, but are not limited to, an accelerometer 510, a gyroscope 511, a pressure sensor 512, an optical sensor 513, and a proximity sensor 514.
[0106] Those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the electronic device 500, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0107] This application also provides a computer-readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described electronic certificate verification method and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0108] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0109] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-mentioned electronic certificate verification method and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0110] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0111] This application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, which, when executed by a computer, implement the steps of the above-described electronic certificate verification method and achieve the same technical effect. To avoid repetition, these will not be described again here.
[0112] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.
[0113] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.< / ofd:layer> < / ofd:checkvalue> < / ofd:signedinfo> < / ofd:customdatas>
Claims
1. A method for verifying electronic certificates, characterized in that, include: Obtain information about the electronic certificate to be verified, wherein the information about the electronic certificate to be verified includes the electronic certificate image corresponding to the electronic certificate to be verified and the OFD format file of the electronic certificate to be verified. The validity of the OFD format file is verified to obtain a first verification result; If the first verification result is successful, image processing is performed on the electronic certificate image to obtain the first text information corresponding to the electronic certificate image. A second verification result is obtained by comparing the similarity between the first text information and the second text information corresponding to the OFD layout file; Based on the second verification result, it is determined whether the electronic certificate to be verified is a genuine electronic certificate.
2. The method according to claim 1, characterized in that, The step of verifying the validity of the OFD format file to obtain a first verification result includes: The OFD layout file is parsed to obtain the file information corresponding to the OFD layout file, wherein the file information includes indexing information, signature information and layer information; The node names and quantities in the layer information are compared with the node names and quantities in the indexing information to obtain the comparison results; If the comparison results are inconsistent, the electronic certificate to be verified is determined to be a fake electronic certificate. If the comparison results are consistent, the signature information is verified to obtain a first verification result.
3. The method according to claim 2, characterized in that, The step of verifying the signature information to obtain a first verification result includes: Verify whether the issuing authority of the CA certificate in the signature information is in the trusted root certificate authority list, wherein the trusted root certificate authority list is used to store trusted root certificate authorities; If the CA certificate issuing authority is on the list of trusted root certificate authorities, verify whether the current time is within the valid time period of the electronic seal in the signature information; If the current time is within the valid time period of the electronic seal in the signature information, the first signature verification information of the OFD format file is obtained based on the public key information and public key parameters of the CA certificate; The first signature verification information is compared with the second signature verification information in the OFD format file to obtain the first verification result.
4. The method according to claim 2, characterized in that, The step of obtaining a second verification result by comparing the similarity between the first text information and the second text information corresponding to the OFD layout file includes: Based on the text attribute names of the electronic certificate to be verified, the second text information corresponding to the OFD format file is obtained from the indexing information; The similarity between the first text information and the second text information is compared to obtain a second verification result.
5. The method according to claim 2, characterized in that, The step of determining whether the electronic certificate to be verified is a genuine electronic certificate based on the second verification result includes: If the second verification result is successful, a similarity comparison is performed between the electronic certificate image and the image corresponding to the OFD format file to obtain a third verification result. A fourth verification result is obtained by querying whether an electronic certificate matching the first text information is stored in the data sharing platform, wherein the data sharing platform stores at least one electronic certificate that has passed authenticity authentication. The electronic certificate to be verified is verified through the administrative agency service platform to obtain a fifth verification result, wherein the administrative agency service platform stores information on at least one electronic certificate that has passed the authenticity authentication. Based on the third verification result, the fourth verification result, and the fifth verification result, it is determined whether the electronic certificate to be verified is a genuine electronic certificate.
6. The method according to claim 5, characterized in that, The process of verifying the electronic certificate to be verified through the administrative agency service platform to obtain a fifth verification result includes: Based on the search information, a search is conducted on the administrative agency service platform to obtain at least one candidate electronic certificate, wherein the search information includes at least one of the following: at least one piece of the first text information, and at least one piece of the document information; The business information of at least one of the candidate electronic certificates is compared with the first text information of the electronic certificate to be verified. If the comparison result is consistent, the basic information of the candidate electronic certificate and other information of the candidate electronic certificate other than the basic information are encrypted according to the business information of the candidate electronic certificate to obtain a first encryption result. The first encryption result is compared with the second encryption result included in the OFD version file to obtain the fifth verification result.
7. The method according to claim 6, characterized in that, The step of determining whether the electronic certificate to be verified is a genuine electronic certificate based on the third verification result, the fourth verification result, and the fifth verification result includes: If the third verification result is successful, the fourth verification result is successful, and the fifth verification result is successful, the electronic certificate to be verified is determined to be a genuine electronic certificate. Specifically, if the similarity between the electronic certificate image and the image corresponding to the OFD format file is greater than or equal to a first threshold, the third verification result is successful. If the similarity between the first encryption result and the second encryption result is greater than or equal to a second threshold, the fifth verification result is successful. If the preset conditions are not met, the electronic certificate to be verified is determined to be a fake electronic certificate.
8. An electronic certificate verification device, characterized in that, include: The first acquisition module is used to acquire information about the electronic certificate to be verified, wherein the information about the electronic certificate to be verified includes the electronic certificate image corresponding to the electronic certificate to be verified and the OFD format file of the electronic certificate to be verified. The second acquisition module is used to obtain a first verification result by verifying the validity of the OFD format file; The third acquisition module is used to perform image processing on the electronic certificate image when the first verification result is that the verification is passed, and to acquire the first text information corresponding to the electronic certificate image. The fourth acquisition module is used to obtain a second verification result by comparing the similarity between the first text information and the second text information corresponding to the OFD layout file; The determination module is used to determine whether the electronic certificate to be verified is a genuine electronic certificate based on the second verification result.
9. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing programs or instructions that can run on the processor, the programs or instructions being executed by the processor to implement the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 7.
11. A computer program product, characterized in that, The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions that, when executed by a computer, cause the computer to perform the steps of the method as described in any one of claims 1 to 7.
Citation Information
Cited By
Electronic certificate file detection method
CN121787395A