PDF signature and verification method simultaneously supporting RSA and SM2 signature algorithms

By generating a one-time pad RSA certificate in the PDF electronic signature and combining it with the SM2 certificate, the problem of insufficient security of the RSA algorithm and incompatibility of the SM2 algorithm is solved, and the compatibility and high security of the RSA and SM2 signature algorithms are achieved, satisfying security requirements for important information systems.

CN118690349AActive Publication Date: 2024-09-24SICHUAN DIGITAL CERTIFICATE AUTHENTICATION MANAGEMENT CENT CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411170777.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-09-24
Estimated Expiration
2044-08-26

AI Technical Summary

Technical Problem

The existing PDF electronic signature technology mainly relies on the RSA algorithm, and its security is gradually threatened. The SM2 algorithm is limited by general PDF viewers such as Adobe and does not support it. PDF documents signed by SM2 cannot be verified on general platforms, resulting in security and Compatibility issues.

Method used

Adopt a method to generate a one-time pad RSA certificate through the user's SM2 certificate, write the SM2 certificate and signature value into the extension of the RSA certificate, establish a binding relationship between PDF and SM2 signature, and use the RSA certificate to authenticate the PDF document Sign and verify, and store RSA and SM2 signature values ​​in the PDF signature field to meet the verification requirements of general PDF viewers such as Adobe.

Benefits of technology

It achieves the compatibility of RSA and SM2 signature algorithms, ensures the security and compatibility of PDF electronic signatures, and meets the needs for high security in the e-government and financial fields without changing the traditional PDF signature mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690349A
    Figure CN118690349A
Patent Text Reader

Abstract

The invention discloses a PDF signature and verification method simultaneously supporting RSA and SM2 signature algorithms, and relates to the technical field of information security, and the method comprises the following steps: when a user carries out visual electronic signature on a PDF document, carrying out SM2 signature on the original text of the PDF document based on a user SM2 algorithm digital certificate, and stamping a timestamp signature on an SM2 signature value; the method comprises the following steps: temporarily generating a one-time pad RSA algorithm digital certificate with the same theme based on a national secret certificate of an SM2 algorithm, writing the SM2 certificate, an SM2 signature value and a timestamp signature value into an extension item of the RSA certificate, and establishing a binding relationship between the PDF and the SM2 signature through an RSA certificate data structure; using the RSA certificate to carry out an RSA algorithm on the original PDF document to carry out electronic signature; verifying the RSA electronic signature of the PDF document; verifying the SM2 digital signature of the PDF document; according to the invention, one seal is compatible with the Adobe reader and the SM2 signature client to verify the signature and the signature, the PDF document structure is not changed, and the mode is completely consistent with the conventional PDF signature mode.
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 PDF signature and verification method that supports both RSA and SM2 signature algorithms. Background Art

[0002] PDF electronic signature technology is based on digital certificates and takes digital signatures as its core technology. It binds the digital signature with the seal image and the signed document object, provides integrity verification and authenticity verification for the signed object, and has the characteristics of identifiable signing identity and non-repudiation of signed content.

[0003] At present, the signature algorithms of PDF electronic signature technology mainly include RSA algorithm and SM2 algorithm, among which: RSA algorithm: It has an early origin and is a widely used product of Adobe. It currently only supports document signing and verification based on the RSA algorithm. However, as the RSA algorithm faces increasing risks of being cracked, its use in important information systems such as e-government and finance will gradually be restricted.

[0004] SM2 algorithm: It is an elliptic curve algorithm with high security and unrestricted use. However, since general PDF readers such as Adobe do not support document signing and verification based on the SM2 algorithm, PDF documents signed with SM2 cannot be verified using Adobe software and can only be verified using dedicated reader software.

[0005] PDF electronic signatures based on the SM2 algorithm will be the future technology development trend in my country. If general PDF readers such as Adobe can verify electronic signatures and the more secure SM2 algorithm can be used, the security of PDF electronic signatures will be effectively improved. Summary of the invention

[0006] In order to solve the problems existing in the prior art, the purpose of the present invention is to provide a PDF signature and verification method that supports both RSA and SM2 signature algorithms. The PDF signature of the present invention realizes that a seal is compatible with Adobe and other readers and SM2 signature clients for signature and seal verification, and does not change the PDF document structure, which is completely consistent with the conventional PDF signature mode.

[0007] To achieve the above object, the technical solution adopted by the present invention is: a PDF signature and verification method that supports both RSA and SM2 signature algorithms, comprising the following steps: S100, when the user performs visual electronic signature on the PDF document, the user performs SM2 signature on the original PDF document based on the user's SM2 algorithm digital certificate, and adds a timestamp signature to the SM2 signature value; S200, based on the national secret certificate of SM2 algorithm, temporarily generate a one-time one-key, RSA algorithm digital certificate with the same subject, and write the SM2 certificate, SM2 signature value, and timestamp signature value into the extension item of the RSA certificate, and establish the binding relationship between PDF and SM2 signature through the RSA certificate data structure; S300, use the RSA certificate to perform RSA algorithm electronic signature on the original PDF document, first calculate the original Hash value, use the RSA certificate private key generated in S200 to perform RSA signature on the Hash value, then call the third-party timestamp to generate a timestamp signature value for the RSA signature value, and finally write the seal image and the two signature values ​​into the signature field of the PDF document; S400, verifying the RSA electronic signature on the PDF document, first verifying whether the timestamp signature in the signature field of the PDF document is valid, confirming that the RSA signature value has not been tampered with, and then verifying whether the RSA signature value is valid; S500, verify the SM2 digital signature on the PDF document. If S400 verification is valid, extract the extension item in the RSA certificate, check the consistency of related information, and verify the validity of the RSA certificate, timestamp signature value, and SM2 signature value. If all steps are valid, it means that the original PDF document and all signature values ​​have not been modified, and the document content is authentic and valid.

[0008] As a further improvement of the present invention, S100 specifically includes the following steps: S101, read the DER-encoded binary format data of the SM2 digital certificate in the user's USBKEY, recorded as SM2Cert; S102, extracting the original information M to be signed from the PDF document, and using the SM3 algorithm to calculate the hash value of the original information M to be signed, which is recorded as HSM3=SM3(M); S103, using the SM2 digital certificate private key SM2Pri in the user's USBKEY to encrypt HSM3, and obtain the SM2 signature value of the PDF document, recorded as PDF-SM2Sign=SM2Enc(SM2Pri,HSM3); S104. Use PDF-SM2Sign as the original text, call a third-party timestamp signature service, and obtain a timestamp signature value, which is recorded as PDF-SM2TimeStamp.

[0009] As a further improvement of the present invention, S200 specifically includes the following steps: S201, generate an RSA asymmetric key pair, the private key is recorded as RSAPri, and the public key is recorded as RSAPub; S202, extract the subject information SubjectDN from the digital certificate of user SM2, and use it as the subject information of the RSA certificate; S203, using the SM3 algorithm to calculate the hash value of RSAPub||SubjectDN, recorded as KeyDNHash=SM3(RSAPub||SubjectDN), where || is a concatenation operation; S204. Use the private key SM2Pri of the user SM2 digital certificate to encrypt KeyDNHash to obtain the RSA public key subject signature value, which is recorded as KeyDNHash-SM2Sign=SM2Enc(SM2Pri,KeyDNHash); S205, use KeyDNHash-SM2Sign in S204 as one of the custom extensions of the RSA certificate; use SM2Cert in S101 as the second custom extension of the RSA certificate; use PDF-SM2Sign in S103 as the third custom extension of the RSA certificate; use PDF-SM2TimeStamp in S104 as the fourth custom extension of the RSA certificate; S206. Set the validity period of the RSA certificate, use RSAPri to self-sign the RSA certificate information, and generate a self-signed RSA certificate, which is recorded as RSACert.

[0010] As a further improvement of the present invention, S300 specifically includes the following steps: S301, extract the original information M to be signed in the PDF document, and use the SHA256 algorithm to calculate the hash value of M, denoted as H SHA256 =SHA256(M); S302, use the RSA digital certificate private key RSAPri in S206 to SHA256 Encrypt and get the RSA signature value of the PDF document, recorded as PDF-RSASign=RSAEnc(RSAPri,H SHA256 ); S303, using PDF-RSASign as the original text, calling a third-party timestamp signature service, and obtaining a timestamp signature value, recorded as PDF-RSATimeStamp; S304. Create a signature field at the location to be signed in the PDF file, add the seal image in the user's USBKEY, PDF-RSASign in S302, and PDF-RSATimeStamp in S303 to the signature field to complete the RSA electronic signature of the PDF file. The signed file is recorded as PDF-Signed.

[0011] As a further improvement of the present invention, S400 specifically includes the following steps: S401, verify whether the electronic signature containing the timestamp in PDF-Signed is valid, call the third-party timestamp verification service, and confirm whether PDF-RSASign and PDF-RSATimeStamp are valid; S402. If the timestamp signature is valid, extract PDF-RSASign and RSA digital certificate public key RSAPub from PDF-Signed, use RSAPub to decrypt PDF-RSASign to obtain HSHA256'=RSADec(RSAPub,PDF-RSASign), repeat S301 to calculate HSHA256, if HSHA256'=HSHA256, it means that the RSA signature of the PDF document is valid, otherwise it means that the PDF document has been tampered with.

[0012] As a further improvement of the present invention, S500 specifically includes the following steps: S501. If the verification in S402 is valid, extract RSACert in PDF-Signed, extract RSAPub, SubjectDN and four custom extensions in RSACert: KeyDNHash-SM2Sign, SM2Cert, PDF-SM2Sign, PDF-SM2TimeStamp, and check whether the subject information SubjectDN in SM2Cert and RSACert is completely consistent; S502. If SubjectDN is exactly the same, extract the public key RSAPub in RSACert, use RSAPub to decrypt KeyDNHash-SM2Sign to get KeyDNHash'=SM2Dec(SM2Pub,KeyDNHash-SM2Sign), repeat S203 to calculate KeyDNHash, if KeyDNHash=KeyDNHash', it means RSACert is valid, otherwise it means RSACert is not signed by SM2Cert; S503. If RSACert is valid, call the third-party timestamp verification service to confirm whether PDF-SM2Sign and PDF-SM2TimeStamp are valid; S504. If the timestamp signature is valid, extract the public key SM2Pub in SM2Cert, use SM2Pub to decrypt PDF-SM2Sign, and obtain HSM3'=SM2Dec(SM2Pub, PDF-SM2Sign). Repeat S102 to calculate HSM3. If HSM3=HSM3', it means that the SM2 signature of the PDF document is valid, otherwise it means that the PDF document has been tampered with. S505. If the PDF document signature is valid after the above S402 RSA signature verification and S504 SM2 signature verification, it means that the original text and signature value of the PDF document have not been modified since the user signed the PDF document, and the document content is authentic and valid.

[0013] The beneficial effects of the present invention are: 1. The present invention derives a one-time pad RSA certificate with the same subject based on the user's SM2 certificate, and the RSA certificate data structure carries the signature and timestamp of the user's SM2 certificate on the RSA public key and subject information, ensuring that the RSA certificate is generated after reliable authorization from the user's SM2 certificate, preventing the RSA certificate from being forged afterwards, and the user's validity of the RSA certificate cannot be denied, thereby ensuring the validity and reliability of using the RSA certificate to sign PDF documents.

[0014] 2. The present invention stores the signature values ​​of both RSA and SM2 certificates in one PDF signature field. The outer layer uses RSA signature to meet the algorithm requirements of general PDF readers such as Adobe for electronic signature verification; the inner layer uses SM2 signature, and the binding relationship between PDF and SM2 signature is built-in based on the RSA certificate data structure. The SM2 algorithm is autonomous and controllable, with high security, and meets the requirements for the use of cryptographic algorithms in important information system fields such as e-government and finance. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 is a flow chart of an embodiment of the present invention. DETAILED DESCRIPTION

[0016] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0017] Example

[0018] A PDF signature and verification method that supports both RSA and SM2 signature algorithms, comprising: when a user performs visual electronic signature on a PDF document, firstly, the original PDF document is SM2 signed based on the user's SM2 algorithm digital certificate, and the SM2 signature value is stamped with a timestamp signature, and then, based on the national secret certificate of the SM2 algorithm, a one-time one-key, RSA algorithm digital certificate with the same subject is temporarily generated, and the SM2 certificate, SM2 signature value, and timestamp signature value are written into the extension item of the RSA certificate, a binding relationship between PDF and SM2 signature is established through the RSA certificate data structure, and finally, the original PDF document is electronically signed with the RSA algorithm using the RSA certificate, the original hash value is first calculated, and the RSA generated by S200 is used to generate a timestamp signature. The private key of the certificate performs RSA signing on the Hash value, and then calls the third-party timestamp to generate a timestamp signature value for the RSA signature value. Finally, the seal image and the two signature values ​​are written into the signature field of the PDF document. To verify the RSA electronic signature of the PDF document, first verify whether the timestamp signature in the signature field of the PDF document is valid, confirm that the RSA signature value has not been tampered with, and then verify whether the RSA signature value is valid. To verify the SM2 digital signature of the PDF document, if the S400 verification is valid, extract the extension item in the RSA certificate, check the consistency of relevant information, and verify the validity of the RSA certificate, timestamp signature value, and SM2 signature value. If all verification steps are valid, it means that the original PDF document and all signature values ​​have not been modified, and the document content is authentic and valid.

[0019] It realizes the digital signature of both RSA and SM2 algorithm digital certificates in one signature area without affecting the traditional PDF signature document structure and the verification effect of general PDF readers. Compared with the traditional single certificate signing method, it is more secure and satisfies the user experience at the same time.

[0020] The present embodiment is further described below: like Figure 1 As shown, this embodiment specifically includes the following steps: S100: Digitally sign a PDF using an SM2 certificate: S101: Read the DER-encoded binary format data of the SM2 digital certificate in the user's USBKEY, recorded as SM2Cert; S102: extract the original information M to be signed from the PDF document, and use the SM3 algorithm to calculate the hash value of M, which is recorded as HSM3=SM3(M); S103: Use the SM2 digital certificate private key SM2Pri in the user's USBKEY to encrypt HSM3 to obtain the SM2 signature value of the PDF document, which is recorded as PDF-SM2Sign=SM2Enc(SM2Pri,HSM3); S104: Using PDF-SM2Sign as the original text, calling a third-party timestamp signature service, and obtaining a timestamp signature value, recorded as PDF-SM2TimeStamp.

[0021] S200: Generate a one-time RSA digital certificate: S201: Generate an RSA asymmetric key pair, with the private key denoted as RSAPri and the public key denoted as RSAPub; S202: extract the subject information SubjectDN from the digital certificate of user SM2 and use it as the subject information of the RSA certificate; S203: Calculate the hash value of RSAPub||SubjectDN using the SM3 algorithm, recorded as KeyDNHash=SM3(RSAPub||SubjectDN); S204: Use the user SM2 digital certificate private key SM2Pri to encrypt KeyDNHash to obtain the RSA public key subject signature value, which is recorded as KeyDNHash-SM2Sign=SM2Enc(SM2Pri,KeyDNHash); S205: Use KeyDNHash-SM2Sign in step S204 as one of the custom extensions of the RSA certificate; use SM2Cert in step S101 as the second custom extension of the RSA certificate; use PDF-SM2Sign in step S103 as the third custom extension of the RSA certificate; use PDF-SM2TimeStamp in step S104 as the fourth custom extension of the RSA certificate; S206: Set the validity period of the RSA certificate to 10 minutes, use RSAPri to self-sign the RSA certificate information, and generate a self-signed RSA certificate, which is recorded as RSACert.

[0022] S300: Electronically sign PDF using RSA certificate: S301: extract the original information M to be signed from the PDF document, and use the SHA256 algorithm to calculate the hash value of M, which is recorded as HSHA256=SHA256(M); S302: Use the RSA digital certificate private key RSAPri in step S206 to encrypt HSHA256 to obtain the RSA signature value of the PDF document, which is recorded as PDF-RSASign=RSAEnc(RSAPri,HSHA256); S303: Using PDF-RSASign as the original text, calling a third-party timestamp signature service, and obtaining a timestamp signature value, recorded as PDF-RSATimeStamp; S304: Create a signature field at the location to be signed in the PDF file, add the seal image in the user's USBKEY, PDF-RSASign in step S302, and PDF-RSATimeStamp in step S303 to the signature field to complete the RSA electronic signature of the PDF file. The signed file is recorded as PDF-Signed.

[0023] S400: Verify RSA electronic signature on PDF document: S401: Use conventional methods to verify whether the electronic signature (including timestamp) in PDF-Signed is valid. First, call the third-party timestamp verification service to confirm whether PDF-RSASign and PDF-RSATimeStamp are valid; S402: If the timestamp signature is valid, extract PDF-RSASign and RSA digital certificate public key RSAPub from PDF-Signed, use RSAPub to decrypt PDF-RSASign to obtain HSHA256'=RSADec(RSAPub,PDF-RSASign), repeat step S301 to calculate HSHA256, if HSHA256'=HSHA256, it means that the RSA signature of the PDF document is valid, otherwise it means that the PDF document has been tampered with.

[0024] S500: Verify SM2 digital signature on PDF document: S501: If S402 verification is valid, extract RSACert in PDF-Signed, extract RSAPub, SubjectDN and four custom extensions in RSACert: KeyDNHash-SM2Sign, SM2Cert, PDF-SM2Sign, PDF-SM2TimeStamp, and check whether the subject information SubjectDN in SM2Cert and RSACert is completely consistent; S502: If SubjectDN is exactly the same, extract the public key RSAPub in RSACert, use RSAPub to decrypt KeyDNHash-SM2Sign to get KeyDNHash'=SM2Dec(SM2Pub,KeyDNHash-SM2Sign), repeat S203 to calculate KeyDNHash, if KeyDNHash=KeyDNHash', it means RSACert is valid, otherwise it means RSACert is not signed by SM2Cert; S503: If RSACert is valid, call the third-party timestamp verification service to confirm whether PDF-SM2Sign and PDF-SM2TimeStamp are valid; S504: If the timestamp signature is valid, extract the public key SM2Pub in SM2Cert, use SM2Pub to decrypt PDF-SM2Sign, and get HSM3'=SM2Dec(SM2Pub,PDF-SM2Sign). Repeat step S102 to calculate HSM3. If HSM3=HSM3', it means that the SM2 signature of the PDF document is valid, otherwise it means that the PDF document has been tampered with. S505: If the PDF document signature is valid after the RSA signature verification in step S402 and the SM2 signature verification in step S504, it means that the original text and signature value of the PDF document have not been modified since the user signed the PDF document, and the document content is authentic and valid.

[0025] The above-mentioned embodiments only express the specific implementation of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A PDF signature and verification method that supports both RSA and SM2 signature algorithms, characterized in that: The following steps are involved: S100, when the user performs visual electronic signature on the PDF document, the user performs SM2 signature on the original PDF document based on the user's SM2 algorithm digital certificate, and adds a timestamp signature to the SM2 signature value; S200, based on the national secret certificate of SM2 algorithm, temporarily generate a one-time one-key, RSA algorithm digital certificate with the same subject, and write the SM2 certificate, SM2 signature value, and timestamp signature value into the extension item of the RSA certificate, and establish the binding relationship between PDF and SM2 signature through the RSA certificate data structure; S300, use the RSA certificate to perform RSA algorithm electronic signature on the original PDF document, first calculate the original Hash value, use the RSA certificate private key generated in S200 to perform RSA signature on the Hash value, then call the third-party timestamp to generate a timestamp signature value for the RSA signature value, and finally write the seal image and the two signature values ​​into the signature field of the PDF document; S400, verifying the RSA electronic signature on the PDF document, first verifying whether the timestamp signature in the signature field of the PDF document is valid, confirming that the RSA signature value has not been tampered with, and then verifying whether the RSA signature value is valid; S500, verify the SM2 digital signature on the PDF document. If S400 verification is valid, extract the extension item in the RSA certificate, check the consistency of related information, and verify the validity of the RSA certificate, timestamp signature value, and SM2 signature value. If all steps are valid, it means that the original PDF document and all signature values ​​have not been modified, and the document content is authentic and valid.

2. The PDF signature and verification method supporting both RSA and SM2 signature algorithms according to claim 1, characterized in that: S100 specifically includes the following steps: S101, read the DER-encoded binary format data of the SM2 digital certificate in the user's USBKEY, recorded as SM2Cert; S102, extracting the original information M to be signed from the PDF document, and using the SM3 algorithm to calculate the hash value of the original information M to be signed, which is recorded as HSM3=SM3(M); S103, using the SM2 digital certificate private key SM2Pri in the user's USBKEY to encrypt HSM3, and obtain the SM2 signature value of the PDF document, recorded as PDF-SM2Sign=SM2Enc(SM2Pri,HSM3); S104. Use PDF-SM2Sign as the original text, call a third-party timestamp signature service, and obtain a timestamp signature value, which is recorded as PDF-SM2TimeStamp.

3. The PDF signature and verification method supporting both RSA and SM2 signature algorithms according to claim 2, characterized in that: S200 specifically includes the following steps: S201, generate an RSA asymmetric key pair, the private key is recorded as RSAPri, and the public key is recorded as RSAPub; S202, extract the subject information SubjectDN from the digital certificate of user SM2, and use it as the subject information of the RSA certificate; S203, using the SM3 algorithm to calculate the hash value of RSAPub||SubjectDN, recorded as KeyDNHash=SM3(RSAPub||SubjectDN), where || is a concatenation operation; S204. Use the private key SM2Pri of the user SM2 digital certificate to encrypt KeyDNHash to obtain the RSA public key subject signature value, which is recorded as KeyDNHash-SM2Sign=SM2Enc(SM2Pri,KeyDNHash); S205, use KeyDNHash-SM2Sign in S204 as one of the custom extensions of the RSA certificate; use SM2Cert in S101 as the second custom extension of the RSA certificate; use PDF-SM2Sign in S103 as the third custom extension of the RSA certificate; use PDF-SM2TimeStamp in S104 as the fourth custom extension of the RSA certificate; S206. Set the validity period of the RSA certificate, use RSAPri to self-sign the RSA certificate information, and generate a self-signed RSA certificate, which is recorded as RSACert.

4. The PDF signature and verification method supporting both RSA and SM2 signature algorithms according to claim 3, characterized in that: S300 specifically includes the following steps: S301, extract the original information M to be signed in the PDF document, and use the SHA256 algorithm to calculate the hash value of M, denoted as H SHA256 =SHA256(M); S302, use the RSA digital certificate private key RSAPri in S206 to SHA256 Encrypt and get the RSA signature value of the PDF document, recorded as PDF-RSASign=RSAEnc(RSAPri,H SHA256 ); S303, using PDF-RSASign as the original text, calling a third-party timestamp signature service, and obtaining a timestamp signature value, recorded as PDF-RSATimeStamp; S304. Create a signature field at the location to be signed in the PDF file, add the seal image in the user's USBKEY, PDF-RSASign in S302, and PDF-RSATimeStamp in S303 to the signature field to complete the RSA electronic signature of the PDF file. The signed file is recorded as PDF-Signed.

5. The PDF signature and verification method supporting both RSA and SM2 signature algorithms according to claim 4, characterized in that: S400 specifically includes the following steps: S401, verify whether the electronic signature containing the timestamp in PDF-Signed is valid, call the third-party timestamp verification service, and confirm whether PDF-RSASign and PDF-RSATimeStamp are valid; S402. If the timestamp signature is valid, extract PDF-RSASign and RSA digital certificate public key RSAPub from PDF-Signed, use RSAPub to decrypt PDF-RSASign to obtain HSHA256'=RSADec(RSAPub,PDF-RSASign), repeat S301 to calculate HSHA256, if HSHA256'=HSHA256, it means that the RSA signature of the PDF document is valid, otherwise it means that the PDF document has been tampered with.

6. The PDF signature and verification method supporting both RSA and SM2 signature algorithms according to claim 5, characterized in that: S500 specifically includes the following steps: S501. If the verification in S402 is valid, extract RSACert in PDF-Signed, extract RSAPub, SubjectDN and four custom extensions in RSACert: KeyDNHash-SM2Sign, SM2Cert, PDF-SM2Sign, PDF-SM2TimeStamp, and check whether the subject information SubjectDN in SM2Cert and RSACert is completely consistent; S502. If SubjectDN is exactly the same, extract the public key RSAPub in RSACert, use RSAPub to decrypt KeyDNHash-SM2Sign to get KeyDNHash'=SM2Dec(SM2Pub,KeyDNHash-SM2Sign), repeat S203 to calculate KeyDNHash, if KeyDNHash=KeyDNHash', it means RSACert is valid, otherwise it means RSACert is not signed by SM2Cert; S503. If RSACert is valid, call the third-party timestamp verification service to confirm whether PDF-SM2Sign and PDF-SM2TimeStamp are valid; S504. If the timestamp signature is valid, extract the public key SM2Pub in SM2Cert, use SM2Pub to decrypt PDF-SM2Sign, and obtain HSM3'=SM2Dec(SM2Pub, PDF-SM2Sign). Repeat S102 to calculate HSM3. If HSM3=HSM3', it means that the SM2 signature of the PDF document is valid, otherwise it means that the PDF document has been tampered with. S505. If the PDF document signature is valid after the above S402 RSA signature verification and S504 SM2 signature verification, it means that the original text and signature value of the PDF document have not been modified since the user signed the PDF document, and the document content is authentic and valid.

Citation Information

Patent Citations

  • PDF signature method and system capable of supporting multiple algorithms

    CN106330462A

  • Digital signature verification method and system for PDF by using SM3 algorithm and SM2 algorithm

    CN107947938A

  • Long-acting digital signature method based on OFD format file

    CN111274615A

  • Electronic signature method, electronic signature verification method and electronic signature verification system for PDF file

    CN111368335A

  • Method for jointly generating electronic signature based on server side and client side

    CN112019353A