WO2023193700A1 - 数字证书的验证方法、装置、设备及计算机可读存储介质 - Google Patents

数字证书的验证方法、装置、设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2023193700A1
WO2023193700A1 PCT/CN2023/086128 CN2023086128W WO2023193700A1 WO 2023193700 A1 WO2023193700 A1 WO 2023193700A1 CN 2023086128 W CN2023086128 W CN 2023086128W WO 2023193700 A1 WO2023193700 A1 WO 2023193700A1
Authority
WO
WIPO (PCT)
Prior art keywords
certificate
root
connection
certificates
digital
Prior art date
Application number
PCT/CN2023/086128
Other languages
English (en)
French (fr)
Inventor
王贵林
杨艳江
张�杰
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023193700A1 publication Critical patent/WO2023193700A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3263Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
    • H04L9/3268Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements using certificate validation, registration, distribution or revocation, e.g. certificate revocation list [CRL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0823Network architectures or network communication protocols for network security for authentication of entities using certificates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3263Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • This application relates to the field of information and communications technology (ICT), especially to verification methods, devices, equipment and computer-readable storage media for digital certificates.
  • ICT information and communications technology
  • devices hold digital certificates. Before one device can communicate with another device, the legitimacy of the digital certificate held by the other device needs to be verified. Among them, the legality verification process relies on the root certificate, which has a certain validity period. In order to ensure the continuity of the communication process, a new root certificate needs to be introduced before the old root certificate expires. The validity period of the new root certificate is later than the validity period of the old root certificate. As a result, at least two root certificates coexist. How to verify the legitimacy of digital certificates when at least two root certificates coexist has become an urgent problem to be solved.
  • This application provides a digital certificate verification method, device, equipment and computer-readable storage medium to verify the legitimacy of the digital certificate when at least two root certificates coexist.
  • the technical solutions provided by this application are as follows.
  • the first aspect provides a digital certificate verification method, which method is applied to the first device.
  • the first device receives the first connection certificate and the first digital certificate sent by the second device, and verifies the first digital certificate based on the root certificate and the first connection certificate trusted by the first device.
  • the first connection certificate is at least one of at least one connection certificate stored on the second device, and one connection certificate is based on the private key of the root certificate with an earlier validity period among the two root certificates and the public key of the root certificate with a later validity period.
  • Signing is performed to obtain that the two root certificates are any two of the at least two root certificates stored on the second device, the root certificate trusted by the first device is at least one of the at least two root certificates, and the first digital certificate is based on at least The private key of the root certificate with the latest validity period among the two root certificates and the information of the second device are generated.
  • the first device stores a root certificate trusted by the first device.
  • the first device does not need to upload other certificates. It only needs to receive the first connection certificate and the first digital certificate sent by the second device, and then the first device can When the second device has at least two root certificates, the validity of the first digital certificate is verified. Moreover, the first device and the second device do not need to mutually confirm the root certificate trusted by the peer device, so that the coexistence of at least two root certificates is transparent and insensible to the first device.
  • the method provided in this application is not only simple and easy to implement, but also has a wide range of applications. Moreover, it reduces the complexity of the digital certificate verification process and saves verification costs.
  • the root certificate trusted by the first device is any one of at least two root certificates
  • the method further includes: the first device sends a second digital certificate to the second device, so that the second device verifies the second digital certificate.
  • the validity of the second digital certificate, the second digital certificate is generated based on the private key of the root certificate trusted by the first device and the information of the first device.
  • the first device sends the second digital certificate to the second device so that the second device can verify the validity of the second digital certificate. Dharma nature.
  • the first device and the second device do not need to confirm the root certificate trusted by the peer device, and the first device does not need to be aware of the coexistence of at least two root certificates, which has a wide application range.
  • the root certificate trusted by the first device includes at least two of the at least two root certificates
  • the method further includes: the first device sends a second connection certificate and a second digital certificate to the second device, Cause the second device to verify the legitimacy of the second digital certificate.
  • the second connection certificate is at least one of the connection certificates corresponding to the root certificate trusted by the first device.
  • the second digital certificate is based on the latest validity period among the root certificates trusted by the first device. The private key of the root certificate and the first device information are generated.
  • the first device sends the second connection certificate and the second digital certificate to the second device, so that the second device can verify the validity of the second digital certificate.
  • the first device and the second device do not need to confirm the root certificate trusted by the peer device, and the first device does not need to be aware of the coexistence of at least two root certificates, which has a wide application range.
  • the root certificate trusted by the first device includes the root certificate with the latest validity period, and the method also includes: before the root certificate with the latest validity period expires, and at least one of the two root certificates has a validity period other than the latest.
  • the first device receives the first digital certificate sent by the second device; the first device verifies the legitimacy of the first digital certificate based on the root certificate with the latest validity period.
  • the first device can still verify the validity of the first digital certificate of the second device.
  • the method further includes: the first device uses a direct revocation method to revoke at least one certificate in the root certificate trusted by the first device, and invalidate the at least one revoked certificate.
  • the direct revocation method is universal and has a wide scope of application.
  • the method further includes: the first device receiving the application scenario information sent by the second device; and after verifying that the first digital certificate is legal, the first device confirms that the application scenario information is correct.
  • the digital certificate verification method provided in this application can be extended to different application scenarios.
  • the application scenario information can be flexibly determined based on the application scenario.
  • the first device satisfies a reference condition, which includes at least one of a certificate storage space capacity greater than a capacity threshold and a root certificate update function; or the first device has an alarm function.
  • the first device By making the first device meet the reference conditions, the first device is suitable for special scenarios such as root certificate emergency update, which enhances the scope of application of the first device.
  • the first device is equipped with an alarm function, which can promptly alarm the user, thereby preventing the failure of root certificate update from affecting the communication security of the first device.
  • a method for verifying a digital certificate is provided.
  • the method is applied to a first device and includes: the first device receiving a first connection certificate, at least one secondary certification center certificate and a first digital certificate sent by the second device. .
  • the first device verifies the validity of the first digital certificate based on the root certificate trusted by the first device, at least one secondary certification authority certificate and the first connection certificate.
  • the first connection certificate is at least one of at least one connection certificate stored on the second device
  • the root certificate trusted by the first device is at least one of at least two root certificates
  • one connection certificate is based on the validity period of the two root certificates.
  • the private key of the earlier root certificate is obtained by signing the public key of the root certificate with a later validity period among the two root certificates, and the two root certificates are any two of the at least two root certificates stored on the second device.
  • a digital certificate is generated based on the private key of the root certificate with the latest validity period among the at least two root certificates, at least one secondary certification center certificate stored on the second device, and information on the second device.
  • the first digital certificate of the second device is generated based on the private key of the root certificate with the latest validity period among the at least two root certificates, at least one secondary certification authority certificate stored on the second device, and information of the second device
  • the first device is still able to Verification of the legality of the first digital certificate is implemented without uploading additional certificates, without being aware of the coexistence of at least two root certificates, and without mutually confirming with the second device the root certificate trusted by the peer device.
  • the scope is wider.
  • a digital certificate verification method is provided.
  • the method is applied to a second device.
  • the second device stores at least two valid root certificates, at least one connection certificate and a first digital certificate.
  • a connection certificate is based on the two valid root certificates.
  • the private key of the root certificate with an earlier validity period is obtained by signing the public key of the root certificate with a later validity period.
  • the two root certificates are any two of at least two root certificates.
  • the first digital certificate is based on at least two root certificates.
  • the method includes: the second device sends the first connection certificate and the first digital certificate to the first device, causing the first device to verify the first The validity of the digital certificate, the first connection certificate is at least one of the at least one connection certificate, and the first connection certificate is used to verify the validity of the first digital certificate.
  • the second device only needs to send the first connection certificate and the first digital certificate to the first device, so that the first device can verify the validity of the first digital certificate.
  • the first device stores a root certificate trusted by the first device, and the first device does not need to upload other additional certificates during the verification process.
  • the second device and the first device do not need to mutually confirm the root certificate trusted by the peer device, so that the coexistence of at least two root certificates is transparent and insensible to the first device.
  • the method provided in this application is not only simple and easy to implement, but also has a wide range of applications. Moreover, it reduces the complexity of the digital certificate verification process and saves verification costs.
  • the two root certificates are any two root certificates with adjacent validity periods among at least two root certificates.
  • This application generates connection certificates from root certificates with adjacent validity periods, so that the number of generated connection certificates is smaller. Since the first connection certificate is at least one of the connection certificates, the number of connection certificates is smaller, which is beneficial to reducing the number of certificates included in the first connection certificate, thereby reducing the time required for the second device to send the first connection certificate to the first device. Transport resources.
  • the method before the second device sends the first connection certificate and the first digital certificate to the first device, the method further includes: the second device queries a root certificate trusted by the first device.
  • the certificate is at least one of at least two root certificates; the second device selects the first connection certificate from at least one connection certificate based on the root certificate trusted by the first device, and the root certificate trusted by the first device is used to verify the first connection The legality of the certificate.
  • the second device can selectively select the first connection certificate from at least one connection certificate without using all connection certificates as the first connection certificate. As a result, the number of certificates included in the first connection certificate is reduced, and the transmission resources required by the second device to send the first connection certificate to the first device are reduced.
  • the root certificate trusted by the first device is any one of at least two root certificates
  • the method further includes: the second device receives a second digital certificate sent by the first device, and the second digital certificate is based on The private key of the root certificate trusted by the first device and the information of the first device are generated; the second device verifies the legitimacy of the second digital certificate based on the root certificate trusted by the first device.
  • the second device receives the second digital certificate and verifies the validity of the second digital certificate.
  • the first device and the second device do not need to confirm the root certificate trusted by the peer device, and the first device does not need to detect the coexistence of at least two root certificates, which has a wide application range.
  • the root certificates trusted by the first device are at least two of the at least two root certificates
  • the method further includes: the second device receives the second connection certificate and the second digital certificate sent by the first device.
  • the second connection certificate is at least one of the connection certificates corresponding to the root certificate trusted by the first device, and the second digital certificate is based on the private key of the root certificate with the latest validity period among the root certificates trusted by the first device and the information of the first device Generate; the second device is based on the root certificate trusted by the first device The certificate and the second connection certificate verify the validity of the second digital certificate.
  • the second device receives the second connection certificate and the second digital certificate, and verifies the validity of the second digital certificate.
  • the first device and the second device do not need to confirm the root certificate trusted by the peer device, and the first device does not need to be aware of the coexistence of at least two root certificates, which has a wide application range.
  • the root certificate trusted by the first device includes the root certificate with the latest validity period
  • the method also includes: before the root certificate with the latest validity period expires, and at least one of the two root certificates has a validity period other than the latest.
  • the second device sends the first digital certificate to the first device, so that the first device verifies the legitimacy of the first digital certificate based on the root certificate with the latest validity period.
  • the first device can still verify the validity of the first digital certificate of the second device.
  • the method further includes: the second device revokes at least two root certificates, at least one connection certificate, and at least one of the first digital certificates in a direct revocation manner, so that the revoked at least one certificate Invalid.
  • the direct revocation method is universal and has a wide scope of application.
  • the method further includes: the second device sending application scenario information corresponding to the second device to the first device, so that the first device verifies that the first digital certificate is legal and then confirms that the application scenario information is correct.
  • the second device By sending application scenario information to the first device, the second device enables the digital certificate verification method provided in this application to be extended to different application scenarios. Among them, the application scenario information can be flexibly determined based on the application scenario.
  • the second device satisfies a reference condition, which includes at least one of a certificate storage space capacity greater than a capacity threshold and a root certificate update function; or the second device has an alarm function.
  • the second device By making the second device meet the reference conditions, the second device is suitable for special scenarios such as emergency update of the root certificate, which enhances the scope of application of the second device.
  • emergency update of the root certificate which enhances the scope of application of the second device.
  • the user By providing the second device with an alarm function, the user can be alerted in a timely manner, thereby preventing the root certificate update failure from affecting the communication security of the second device.
  • the first device is configured to verify the legitimacy of the first digital certificate based on a root certificate trusted by the first device and a first connection certificate, and the root certificate trusted by the first device is one of at least two root certificates. at least one of.
  • a fourth aspect provides a digital certificate verification method, which method is applied to a second device, and the second device stores at least two valid root certificates, at least one secondary certification center certificate, at least one connection certificate and the first Digital certificate, a connection certificate is obtained by signing the public key of a later root certificate based on the private key of the earlier root certificate among the two root certificates.
  • the two root certificates are at least any two of the two root certificates.
  • the first digital certificate is generated based on the private key of the root certificate with the latest validity period among the at least two root certificates, at least one secondary certification center certificate and the information of the second device.
  • the method includes: the second device sends the first device to the first device.
  • connection certificate, at least one secondary certification center certificate and the first digital certificate enable the first device to verify the legitimacy of the first digital certificate
  • the first connection certificate is at least one of the at least one connection certificate
  • the first connection certificate and at least one The secondary certification center certificate is used to verify the legitimacy of the first digital certificate.
  • a digital certificate verification device is provided, the device is applied to the first device, and the device includes:
  • a receiving module configured to receive a first connection certificate and a first digital certificate sent by the second device.
  • the first connection certificate is at least one of at least one connection certificate stored on the second device.
  • One connection certificate is based on one of the two root certificates.
  • the private key of the root certificate with an earlier validity period is obtained by signing the public key of the root certificate with a later validity period among the two root certificates, and the two root certificates are any two of the at least two root certificates stored on the second device,
  • the first digital certificate is generated based on the private key of the root certificate with the latest validity period among the at least two root certificates and the information of the second device;
  • a verification module configured to verify the legitimacy of the first digital certificate based on the root certificate trusted by the first device and the first connection certificate,
  • the root certificate trusted by the first device is at least one of at least two root certificates.
  • the root certificate trusted by the first device is any one of at least two root certificates
  • the device further includes: a first sending module, configured to send a second digital certificate to the second device, so that the The second device verifies the validity of the second digital certificate, and the second digital certificate is generated based on the private key of the root certificate trusted by the first device and the information of the first device.
  • the root certificate trusted by the first device includes at least two of the at least two root certificates
  • the device further includes: a second sending module, configured to send the second connection certificate and the second connection certificate to the second device.
  • the second digital certificate enables the second device to verify the legitimacy of the second digital certificate.
  • the second connection certificate is at least one of the connection certificates corresponding to the root certificate trusted by the first device.
  • the second digital certificate is based on the root certificate trusted by the first device. The private key of the root certificate with the latest validity period and the information of the first device are generated.
  • the root certificate trusted by the first device includes the root certificate with the latest validity period
  • the receiving module is also used to ensure that the validity period of at least two root certificates is not the latest before the root certificate with the latest validity period expires.
  • the verification module is also used to verify the legitimacy of the first digital certificate based on the root certificate with the latest validity period.
  • the device further includes: a revocation module, configured to revoke at least one certificate in the root certificate trusted by the first device in a direct revocation manner, so as to invalidate the at least one revoked certificate.
  • a revocation module configured to revoke at least one certificate in the root certificate trusted by the first device in a direct revocation manner, so as to invalidate the at least one revoked certificate.
  • the receiving module is also used to receive the application scenario information sent by the second device; the verification module is also used to verify that the first digital certificate is legal and confirm that the application scenario information is correct.
  • the first device satisfies a reference condition, which includes at least one of a certificate storage space capacity greater than a capacity threshold and a root certificate update function; or the first device has an alarm function.
  • a digital certificate verification device is provided, the device is applied to the first device, and the device includes:
  • a receiving module configured to receive a first connection certificate, at least one secondary certification center certificate and a first digital certificate sent by the second device, where the first connection certificate is at least one of at least one connection certificate stored on the second device, a The connection certificate is obtained by signing the public key of the root certificate with a later validity period among the two root certificates based on the private key of the root certificate with an earlier validity period among the two root certificates.
  • the two root certificates are at least two stored on the second device.
  • the first digital certificate is generated based on the private key of the root certificate with the latest validity period among the at least two root certificates, at least one secondary certification center certificate stored on the second device, and information on the second device;
  • a verification module configured to verify the legitimacy of the first digital certificate based on a root certificate trusted by the first device, at least one secondary certification center certificate, and the first connection certificate.
  • the root certificate trusted by the first device is at least one of the two root certificates. at least one.
  • a digital certificate verification device is provided.
  • the device is applied to a second device.
  • the second device stores at least two valid root certificates, at least one connection certificate and a first digital certificate.
  • a connection certificate is based on two The private key of the root certificate with an earlier validity period in the root certificate is obtained by signing the public key of the root certificate with a later validity period.
  • the two root certificates are any two of at least two root certificates.
  • the first digital certificate is based on at least two Generate the private key of the root certificate with the latest validity period and the information of the second device.
  • the device includes:
  • a sending module configured to send a first connection certificate and a first digital certificate to the first device so that the first device verifies the validity of the first digital certificate.
  • the first connection certificate is at least one of the at least one connection certificate.
  • the certificate is used to verify the legitimacy of the first digital certificate.
  • the two root certificates are any two root certificates with adjacent validity periods among at least two root certificates.
  • the device further includes: a query module, configured to query the root certificate trusted by the first device,
  • the root certificate trusted by the first device is at least one of at least two root certificates;
  • the selection module is configured to select the first connection certificate from at least one connection certificate based on the root certificate trusted by the first device, which is trusted by the first device.
  • the root certificate is used to verify the validity of the first connection certificate.
  • the root certificate trusted by the first device is any one of at least two root certificates
  • the device further includes: a first verification module, configured to receive a second digital certificate sent by the first device, and a third The second digital certificate is generated based on the private key of the root certificate trusted by the first device and the information of the first device; the legitimacy of the second digital certificate is verified based on the root certificate trusted by the first device.
  • the root certificate trusted by the first device includes at least two of the at least two root certificates
  • the device further includes: a second verification module, configured to receive the second connection certificate sent by the first device and The second digital certificate, the second connection certificate is at least one of the connection certificates corresponding to the root certificate trusted by the first device, and the second digital certificate is based on the private key of the root certificate with the latest validity period among the root certificates trusted by the first device and the third Information generation of a device; verifying the legitimacy of the second digital certificate based on the root certificate trusted by the first device and the second connection certificate.
  • the root certificate trusted by the first device includes the root certificate with the latest validity period.
  • the sending module is also used to send the root certificate before the root certificate with the latest validity period expires, and the validity period of at least two root certificates is not the latest. After the later root certificate expires, the first digital certificate is sent to the first device, so that the first device verifies the legitimacy of the first digital certificate based on the root certificate with the latest validity period.
  • the device further includes: a revocation module, configured to revoke at least one of at least two root certificates, at least one connection certificate and the first digital certificate in a direct revocation manner, so that at least the revoked A certificate has expired.
  • a revocation module configured to revoke at least one of at least two root certificates, at least one connection certificate and the first digital certificate in a direct revocation manner, so that at least the revoked A certificate has expired.
  • the sending module is also configured to send the application scenario information corresponding to the second device to the first device, so that the first device verifies that the first digital certificate is legal and confirms that the application scenario information is correct.
  • the second device satisfies a reference condition, which includes at least one of a certificate storage space capacity greater than a capacity threshold and a root certificate update function; or the second device has an alarm function.
  • the first device is configured to verify the legitimacy of the first digital certificate based on a root certificate trusted by the first device and a first connection certificate, and the root certificate trusted by the first device is at least one of the two root certificates. at least one.
  • a digital certificate verification device is provided.
  • the device is applied to a second device.
  • the second device stores at least two valid root certificates, at least one secondary certification center certificate, at least one connection certificate and the first number.
  • Certificate, a connection certificate is obtained by signing the public key of a later root certificate based on the private key of the earlier root certificate among the two root certificates.
  • the two root certificates are any two of at least two root certificates.
  • the first digital certificate is generated based on the private key of the root certificate with the latest validity period among at least two root certificates, at least one secondary certification center certificate and information of the second device, and the device includes:
  • a sending module configured to send a first connection certificate, at least one secondary certification center certificate and a first digital certificate to the first device, so that the first device verifies the validity of the first digital certificate, and the first connection certificate is at least one connection certificate. At least one of the first connection certificate and at least one secondary certification center certificate is used to verify the legitimacy of the first digital certificate.
  • a digital certificate verification device includes a network interface, a memory and a processor; the network interface is used for device communication, and at least one instruction is stored in the memory, and at least one instruction is loaded and executed by the processor.
  • a digital certificate verification system in a tenth aspect, includes a first device and a second device that are communicatively connected.
  • the first device is used to implement the digital certificate verification method in the first aspect
  • the second device is used to implement the digital certificate verification method. Numbers in the third aspect
  • the verification method of the certificate, or the first device is used to implement the verification method of the digital certificate in the second aspect and the second device is used to implement the verification method of the digital certificate in the fourth aspect.
  • processors there are one or more processors and one or more memories.
  • the memory may be integrated with the processor, or the memory may be provided separately from the processor.
  • a computer program includes: computer program code.
  • the computer program code When the computer program code is run by a computer, it causes the computer to perform the methods in the above aspects.
  • a computer-readable storage medium stores programs or instructions. When the programs or instructions are run on the computer, the methods in the above aspects are executed.
  • a chip including a processor for calling and running instructions stored in the memory, so that the computer installed with the chip executes the methods in the above aspects.
  • a fourteenth aspect another chip is provided, including: an input interface, an output interface, a processor and a memory.
  • the input interface, the output interface, the processor and the memory are connected through an internal connection path, and the processor is used to execute the code in the memory.
  • the computer equipped with the chip performs the methods in the above aspects.
  • Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application.
  • Figure 2 is a flow chart of a digital certificate verification method provided by an embodiment of the present application.
  • Figure 3 is a schematic diagram of a certificate relationship provided by an embodiment of this application.
  • Figure 4 is a flow chart of another digital certificate verification method provided by the embodiment of the present application.
  • Figure 5 is a schematic diagram of a digital certificate verification process provided by an embodiment of the present application.
  • Figure 6 is a schematic diagram of the verification process of another digital certificate provided by the embodiment of the present application.
  • Figure 7 is a schematic diagram of another digital certificate verification process provided by the embodiment of the present application.
  • Figure 8 is a schematic structural diagram of a digital certificate verification device provided by an embodiment of the present application.
  • Figure 9 is a schematic structural diagram of another digital certificate verification device provided by an embodiment of the present application.
  • Figure 10 is a schematic structural diagram of another digital certificate verification device provided by an embodiment of the present application.
  • Figure 11 is a schematic structural diagram of yet another digital certificate verification device provided by an embodiment of the present application.
  • Figure 12 is a schematic structural diagram of a digital certificate verification device provided by an embodiment of the present application.
  • PKI public key infrastructure
  • PKI distributes digital certificates (certificates) to devices based on public key cryptography (PKC).
  • Digital certificates are also called device certificates, business certificates, etc. Before communication between different devices, they need to mutually verify the validity of the digital certificates of the peer devices.
  • the root certification authority holds the root certificate and RootCA's private key.
  • the root certificate includes a subject and the public key of the RootCA.
  • the subject of the root certificate includes information about the RootCA.
  • the public key of the RootCA corresponds to the private key of the RootCA.
  • RootCA is also called a first-level CA.
  • the secondary certification authority submits the relevant information of SubCA and the public key of SubCA to RootCA.
  • the SubCA-related information submitted by different SubCAs is different.
  • the public key of the SubCA submitted by a SubCA corresponds to the private key held by the SubCA.
  • RootCA uses RootCA's private key to sign SubCA's relevant information and SubCA's public key according to a certain cryptographic algorithm to form RootCA's signature.
  • RootCA issues a SubCA certificate to SubCA so that SubCA holds the SubCA certificate.
  • the SubCA certificate includes a subject, SubCA's public key, and RootCA's signature.
  • the subject of the SubCA certificate includes SubCA-related information. For this SubCA certificate, it can be considered that the SubCA certificate is signed by the root certificate.
  • the device submits device-related information and the device's public key to SubCA.
  • the device-related information submitted by different devices is different.
  • the public key of the device submitted by a device corresponds to the private key held by the device.
  • SubCA uses SubCA's private key to sign the device's relevant information and the device's public key according to a certain cryptographic algorithm to form a SubCA signature.
  • SubCA issues a digital certificate to the device so that the device holds the digital certificate.
  • the digital certificate includes the subject, the device's public key, and the SubCA's signature.
  • the subject of the digital certificate includes device-related information. For this digital certificate, it can be considered that the digital certificate is signed by a SubCA certificate.
  • SubCA includes multiple levels, and the SubCA certificate of the highest level SubCA among the multiple levels is signed by the root certificate.
  • SubCA certificates of other levels of SubCA except the highest level they are signed by the SubCA certificate of the previous level SubCA.
  • SubCA includes Level 2 CA and Level 3 CA.
  • the root certificate is signed to obtain the SubCA certificate of the second-level CA
  • the SubCA certificate of the second-level CA is signed to obtain the SubCA certificate of the third-level CA
  • the digital certificate is obtained by signing the SubCA certificate of the third-level CA.
  • the above-mentioned SubCA and SubCA certificates may not exist, then the root certificate is directly signed to obtain a digital certificate, and the root certificate and the digital certificate form a certificate chain.
  • the device needs to trust at least one root certificate.
  • the root certificate trusted by the device is the root certificate held by the RootCA trusted by the device. Based on this, the device trusts all certificates signed by a trusted root certificate. Accordingly, when a device verifies the legitimacy of a digital certificate, it needs to determine whether the certificate chain in which the digital certificate is located includes a root certificate trusted by the device. In other words, when the device verifies a digital certificate, it needs to start from the certificate that signed the digital certificate and trace it back to the root certificate. If the traced root certificate is the root certificate trusted by the device, the device can trust the digital certificate, or the digital certificate is legitimate and the verification passes.
  • the root certificate is the anchor of trust that PKI can use to ensure communication security.
  • the digital certificate can be signed by a SubCA certificate or directly signed by the root certificate.
  • a digital certificate signed by a SubCA certificate as an example to illustrate the process of verifying the digital certificate.
  • the device needs to obtain a SubCA certificate to obtain the SubCA's public key corresponding to the SubCA's private key from the SubCA certificate, thereby using the SubCA's public key to verify the signature included in the digital certificate.
  • the device Before using the SubCA's public key, the device needs to verify the SubCA certificate.
  • the device obtains the root certificate trusted by the device and obtains the RootCA's public key from the root certificate. If the device can decrypt the signature included in the SubCA certificate using RootCA's public key, it means that the signature included in the SubCA certificate was indeed signed using RootCA's private key. of. Therefore, the device can determine that the SubCA certificate is indeed a certificate signed by the root certificate held by the RootCA that the device trusts, and can therefore trust the SubCA certificate.
  • the device After trusting the SubCA certificate, the device can use the SubCA's public key. If the device can decrypt the signature included in the digital certificate using SubCA's public key, it means that the signature included in the digital certificate was indeed signed using SubCA's private key. Furthermore, the device can determine that the digital certificate is indeed a certificate signed by the SubCA certificate. . Because the device trusts the SubCA certificate, the device also trusts the digital certificate. That is, the digital certificate passes the verification of the device and is legal.
  • SubCA when a SubCA includes multiple levels, the legitimacy of the SubCA certificate of the highest level SubCA among the multiple levels is verified by the root certificate. For SubCA certificates of other levels except the highest level, the validity of the SubCA certificate is verified by the SubCA certificate of the previous level SubCA. The legality of the digital certificate is verified by the SubCA certificate of the lowest level SubCA.
  • the signing of certificates is nested, so the validity period of the SubCA certificate cannot exceed the validity period of the root certificate, and the validity period of the digital certificate cannot exceed the validity period of the SubCA certificate. Since new digital certificates with a certain validity period need to be frequently signed, the root certificate cannot be updated after the validity period of a root certificate has expired (that is, after a root certificate has become invalid or expired). Instead, the root certificate needs to be updated in advance. , to ensure the normal distribution of digital certificates. For example, if the root certificate is valid for 10 years, the SubCA certificate is valid for 6 years, and the digital certificate is valid for 4 years, the root certificate needs to be updated before the remaining 4 years of validity of the root certificate.
  • a new SubCA certificate can be signed with the updated root certificate, and then a new digital certificate with a validity period of 4 years can be signed with the new SubCA certificate. If the root certificate is not updated before the remaining 4 years of the root certificate's validity period, a new digital certificate with a validity period of 4 years cannot be signed normally. Similarly, before the validity period of the updated root certificate is 4 years, the root certificate needs to be updated again, and so on.
  • Root certificate updates include root certificate extension (certificate updating) and the introduction of a new root certificate (certificate rekeying).
  • the method of extending the root certificate only extends the validity period of the root certificate. It does not change the public key of RootCA and the private key of RootCA, nor does it change the cryptographic algorithm when using RootCA's private key for signing.
  • you need to update the RootCA's public key and RootCA's private key such as changing the length of the RootCA's public key and RootCA's private key, and you can also update the cryptographic algorithm when using the RootCA's private key for signing. .
  • the root certificate extension method is only suitable for the scenario of temporarily updating the root certificate, and cannot fundamentally solve the problem of root certificate update.
  • the key length can be increased according to the progress of cryptanalysis and the requirements of relevant regulatory agencies and standards organizations.
  • the cryptographic algorithm can also be updated, adding Attack difficulty. Therefore, the security of the root certificate is ensured, which is conducive to ensuring the security of communication between different devices. Therefore, when updating the root certificate, the method of introducing a new root certificate is often used to fundamentally solve the problem of root certificate update.
  • the root certificate since the root certificate cannot be updated after the validity period of a root certificate has expired, the root certificate needs to be updated in advance, and the method of introducing a new root certificate will be used when updating the root certificate, so it will Produces a situation where at least two root certificates coexist. Also, different devices that need to communicate may trust different root certificates. How to verify the legitimacy of the digital certificate under such circumstances has become an urgent problem to be solved.
  • the embodiment of this application provides a digital certificate verification method, which can be applied in the implementation environment shown in Figure 1.
  • the implementation environment includes a first device 101 and a second device 102 that are communicatively connected.
  • the second device 102 is a device with upload function and communication function.
  • the upload function is used for the second device 102 to accept the management operation of the management device, so that the management device uploads each certificate that needs to be used in the verification method of the digital certificate according to actual needs.
  • management devices include but are not limited to servers, controllers, network management systems, etc., which are not limited here.
  • the communication function is used for the first device 101 to interact with the second device 102.
  • the first device 101 is a device having at least a communication function.
  • the first device 101 may or may not have an upload function, which is not limited here.
  • embodiments of the present application provide a digital certificate verification method, which is implemented through the interaction process between the first device and the second device. As shown in Figure 2, the method includes the following steps 201 to 203.
  • Step 201 The second device sends the first connection certificate and the first digital certificate to the first device.
  • the second device stores at least two valid root certificates, at least one link certificate and the first digital certificate. Since at least two root certificates are valid, the moment when the second device performs step 201 is within the intersection of the validity periods of at least two root certificates.
  • the first connection certificate sent by the second device to the first device is at least one of at least one connection certificate, and the first connection certificate is used to verify the validity of the first digital certificate.
  • the second device obtains these certificates through an upload process. For example, the upload process can be completed before the second device performs step 201, then the second device stores these certificates, and reads the stored certificates when step 201 is performed.
  • the completion timing of the upload process is not limited.
  • the at least two root certificates, the at least one connection certificate and the first digital certificate stored in the second device are described respectively.
  • Root certificates trusted by the second device At least two root certificates: Root certificates trusted by the second device.
  • any two root certificates are selected from at least two root certificates.
  • the two root certificates will include a root certificate with an earlier validity period and a root certificate with a later validity period.
  • the validity period of the root certificate corresponds to a start time and an end time. For example, between a root certificate with an earlier validity period and a root certificate with a later validity period, the start time corresponding to the validity period of the root certificate with an earlier validity period is earlier than the start time corresponding to the validity period of the root certificate with a later validity period.
  • the end time corresponding to the validity period of the root certificate with an earlier validity period is earlier than the end time corresponding to the validity period of the root certificate with a later validity period.
  • the root certificate with an earlier validity period is valid from the beginning of the first year to the end of the second year
  • the root certificate with a later validity period is valid from the beginning of the second year to the end of the fourth year.
  • a root certificate may be called an "nth generation” root certificate, denoted as a Gn root certificate.
  • n is a positive integer greater than or equal to 1
  • the upper limit of the value of n is equal to the number N of root certificates
  • N is a positive integer greater than or equal to 2.
  • the number of root certificates is 3.
  • the root certificate with the earliest validity period is called the "1st generation” root certificate and is represented as the G1 root certificate.
  • the root certificate with the second earliest validity period is called the "2nd generation" root certificate.
  • a second device may be called an "n'th generation” device, denoted as a Gn' generation device.
  • the value of n' is the same as the value of n corresponding to the root certificate with the latest validity period trusted by the second device.
  • the second device trusts the root certificate with the latest validity period If it is a G3 root certificate, the second device can be called a "3rd generation” device, which is represented as a G3 device.
  • connection certificate is obtained by signing the public key of a later root certificate based on the private key of the earlier root certificate among the two root certificates.
  • the two root certificates are any of at least two root certificates. two.
  • the public key of a root certificate is the public key included in the root certificate
  • the private key of the root certificate is the private key corresponding to the public key included in the root certificate.
  • the subject of the root certificate with a later validity period and the public key of the root certificate with a later validity period are signed using the private key of the root certificate with an earlier validity period, to obtain the signature of the root certificate with an earlier validity period.
  • a connection certificate can be generated, which includes: the subject of the root certificate with a later validity period, the public key of the root certificate with a later validity period, and the signature of the root certificate with an earlier validity period.
  • the root certificate with an earlier validity period is represented as the old (old) root certificate
  • the root certificate with a later validity period is represented as the new (new) root certificate.
  • the generated connection certificate is represented as the NewWithOld connection certificate, that is, the old root certificate is used.
  • the connection certificate can be regarded as a certificate signed by a root certificate with an earlier validity period.
  • the root certificate with an earlier validity period also needs to be used.
  • the connection certificate includes the subject of the root certificate with a later validity period and the public key of the root certificate with a later validity period, the certificate signed by the root certificate with a later validity period can be regarded as being signed by the connection certificate. Certificate.
  • the validity of a certificate can be verified by a root certificate with a later validity period, the validity of the certificate can also be verified by the connection certificate and a root certificate with an earlier validity period.
  • a connection certificate may be represented as a GxGy connection certificate.
  • x is the value of n corresponding to the root certificate with an earlier validity period among the two root certificates
  • y is the value of n corresponding to the root certificate with a later validity period among the two root certificates.
  • a connection certificate is obtained by signing the private key of the G2 root certificate based on the private key of the G1 root certificate, then the connection certificate is represented as a G1G2 connection certificate.
  • the G1G2 connection certificate can be thought of as a certificate signed by the G1 root certificate.
  • a certificate signed by a G2 root certificate can be viewed as a certificate signed by a G1G2 connection certificate.
  • the G2G3 connection certificate and G3G4 connection certificate shown in Figure 3 will not be described again here.
  • the two root certificates are any two of the at least two root certificates. That is, every two root certificates in at least one root certificate are used to generate a connection certificate.
  • the number of root certificates is N
  • the number of connection certificates is (N 2 -N)/2.
  • root certificates include G1 root certificate, G2 root certificate, and G3 root certificate.
  • the private key of the G1 root certificate signs the public key of the G2 root certificate to obtain the G1G2 connection certificate.
  • the private key of the G2 root certificate signs the public key of the G3 root certificate to obtain the G2G3 connection certificate.
  • the private key of the G1 root certificate signs the public key of the G3 root certificate to obtain the G1G3 connection certificate.
  • a total of 3 connection certificates were obtained.
  • the two root certificates are any two root certificates with adjacent validity periods among the at least two root certificates. That is, every two root certificates with adjacent validity periods in at least one root certificate are used to generate a connection certificate.
  • the number of root certificates is N
  • the number of connection certificates is (N-1).
  • the private key of the G1 root certificate signs the public key of the G2 root certificate to obtain the G1G2 connection certificate
  • the private key of the G2 root certificate signs the G3 root certificate. Sign with the public key to obtain the G2G3 connection certificate.
  • a total of 2 connection certificates were obtained.
  • the first digital certificate generated based on the private key of the root certificate with the latest validity period among at least two root certificates trusted by the second device and the information of the second device.
  • the information of the second device includes but is not limited to related information of the second device and the public key of the second device.
  • the private key of the root certificate with the latest validity period signs the relevant information of the second device and the public key of the second device to obtain the signature of the root certificate with the latest validity period.
  • a first digital certificate can be generated, which includes the subject, the public key of the second device and the The signature of the root certificate with the latest validity period, the subject is the relevant information of the second device.
  • the first digital certificate is a certificate signed by the root certificate with the latest validity period, and the validity of the first digital certificate is verified by the root certificate with the latest validity period.
  • the root certificate is represented as a Gn root certificate
  • the first digital certificate signed by the Gn root certificate is represented as a Gn digital certificate.
  • a G3 root certificate can be signed to obtain a G3 digital certificate.
  • the first connection certificate includes case A1 and case A2 as follows.
  • the first connection certificate is a certificate selected from at least one connection certificate based on a root certificate trusted by the first device.
  • the method further includes: the second device queries a root certificate trusted by the first device, and the root certificate trusted by the first device is at least one of the at least two root certificates stored by the second device. one.
  • the second device selects the first connection certificate from at least one connection certificate based on the root certificate trusted by the first device, and the root certificate trusted by the first device is used to verify the legitimacy of the first connection certificate.
  • the second device communicates with the first device to query a root certificate trusted by the first device.
  • the management device stores a root certificate trusted by the first device, and the second device communicates with the management device to query the root certificate trusted by the first device.
  • the second device can also query the root certificate trusted by the first device through other methods, which is not limited here.
  • the second device After querying the root certificate trusted by the first device, the second device selects a first connection certificate from at least one connection certificate.
  • the manner in which the second device selects the first connection certificate includes the following situations A11 and A12.
  • the number of root certificates trusted by the first device is one.
  • the second device determines, among at least one connection certificate, the connection certificate generated based on the reference root certificate as the first connection certificate.
  • the validity period of the reference root certificate is not earlier than the validity period of the root certificate trusted by the first device, and is not later than the validity period of the root certificate with the latest validity period.
  • the reference root certificate includes the G1 root certificate, G2 root certificate, and G3 root certificate.
  • the connection certificate generated based on the reference root certificate includes a G1G2 connection certificate, a G2G3 connection certificate and a G1G3 connection certificate.
  • the connection certificate generated based on the reference root certificate includes a G1G2 connection certificate and a G2G3 connection certificate.
  • connection certificates in the connection certificate generated based on the reference root certificate are determined as the first connection certificate.
  • the first connection certificate can be used to verify the legitimacy of the first digital certificate
  • the root certificate trusted by the first device can be used to verify the legitimacy of the first connection certificate.
  • the connection certificate generated based on the reference root certificate includes a G1G2 connection certificate, a G2G3 connection certificate and a G1G3 connection certificate
  • the G1G2 connection certificate and the G2G3 connection certificate may be used as the first connection certificate.
  • the G1G3 connection certificate can also be used as the first connection certificate.
  • the G1G2 connection certificate, G2G3 connection certificate and G1G3 connection certificate can all be used as the first connection certificate.
  • the second device can directly send the first digital certificate to the first device, and the second device does not need to send the first connection certificate.
  • the number of root certificates trusted by the first device is at least two.
  • the second device determines the connection certificate corresponding to the root certificate according to situation A1. After that, the connection certificates corresponding to each root certificate are merged and deduplicated, and the merged and deduplicated The connection certificate is determined as the first connection certificate.
  • the root certificates trusted by the first device include the G1 root certificate and the G2 root certificate
  • the root certificate with the latest validity period trusted by the second device is the G3 root certificate.
  • the second device determines according to the situation A1 that the connection certificate corresponding to the G1 root certificate includes the G1G2 connection certificate, the G2G3 connection certificate and the G1G3 connection certificate.
  • the second device determines according to the situation A1 that the connection certificate corresponding to the G2 root certificate includes the G2G3 connection certificate.
  • the connection certificate corresponding to the G2 root certificate includes the G2G3 connection certificate.
  • duplicate G2G3 connection certificates are removed, thereby obtaining a first connection certificate, which includes a G1G2 connection certificate, a G2G3 connection certificate and a G1G3 connection certificate.
  • the second device selects one root certificate from at least two root certificates trusted by the first device, determines the connection certificate corresponding to the selected root certificate according to situation A1, and converts the connection certificate corresponding to the selected root certificate
  • the certificate is determined to be the first connection certificate.
  • the root certificate selected by the second device is the root certificate whose validity period is closest to the root certificate with the latest validity period among the at least two root certificates trusted by the first device.
  • the root certificates trusted by the first device include the G1 root certificate and the G2 root certificate, and the root certificate with the latest validity period stored by the second device is the G3 root certificate, then the second device chooses from the G1 root certificate and the G2 root certificate.
  • the G2 root certificate has a validity period closer to that of the G3 root certificate instead of the G1 root certificate.
  • the second device determines that the connection certificate corresponding to the G2 root certificate is the G2G3 connection certificate according to the situation A1, thereby obtaining that the first connection certificate is the G2G3 connection certificate.
  • the second device can also randomly select from at least two root certificates trusted by the first device, which is not limited here.
  • situation A1 including the above situations A11 and A12 is applicable to the scenario of allowing the second device to query the root certificate trusted by the first device.
  • Such scenarios include but are not limited to transport layer security (TLS) 1.2 Advanced versions of TLS 1.3 and more.
  • TLS transport layer security
  • the first device sends a trust center list (list of trusted authorities) to the second device, and the second device determines the root certificate trusted by the first device based on the trust center list.
  • the second device since in case A1 the second device needs to select the first connection certificate from at least one connection certificate based on the root certificate trusted by the first device, the second device needs to have strong certificate management capabilities. Used for the second device to select and send the connection certificate. Moreover, precisely because of the query and selection in case A1, compared with the method of using all connection certificates as the first connection certificate (that is, the following case A2), the number of certificates included in the first connection certificate in case A1 Less, the second device requires less transmission resources to send the first connection certificate to the first device, which is suitable for scenarios where transmission resources are tight.
  • the first connection certificate is all connection certificates.
  • the second device does not need to query the root certificate trusted by the first device, and can directly use all connection certificates as the first connection certificate.
  • situation A2 is applicable to a scenario where the second device is not allowed to query the root certificate trusted by the first device.
  • Such scenarios include but are not limited to open secure sockets layer (OpenSSL).
  • situation A2 is also applicable to the scenario where the second device is allowed to query the root certificate trusted by the first device.
  • the second device does not need to select the first connection certificate from at least one connection certificate based on the root certificate trusted by the first device, so the second device does not need to have strong certificate management capabilities.
  • the situations A1 and A2 described above are only two exemplary situations of the first connection certificate and are not used to limit the first connection certificate.
  • the second device needs to send the first connection certificate and the first digital certificate to the first device.
  • Step 202 The first device receives the first connection certificate and the first digital certificate sent by the second device.
  • the first device Since the second device sends the first connection certificate and the first digital certificate to the first device, the first device correspondingly receives the first connection certificate and the first digital certificate sent by the second device.
  • Step 203 The first device verifies the combination of the first digital certificate based on the root certificate trusted by the first device and the first connection certificate. Dharma nature.
  • the root certificate trusted by the first device is the root certificate that the first device has obtained, or in other words, the first device has already stored the root certificate trusted by the first device before receiving the first connection certificate and the first digital certificate, The first device does not need to go through an additional upload process to obtain these root certificates.
  • the root certificate trusted by the first device has been preset in the first device when the first device is produced or before the first device is used on the network.
  • the embodiments of this application do not limit the manner in which the first device obtains the root certificate trusted by the first device.
  • the root certificate trusted by the first device is at least one of at least two root certificates stored by the second device.
  • the first device first verifies the legitimacy of the first connection certificate through a root certificate trusted by the first device, that is, confirms whether the public key of the root certificate trusted by the first device can verify the validity of the first connection certificate included in the first connection certificate.
  • Signature is decrypted. After verifying that the first connection certificate is legal, verify the legality of the first digital certificate through the first connection certificate, that is, confirm whether the signature included in the first digital certificate can be decrypted by the public key included in the first connection certificate.
  • verifying the legitimacy of the first digital certificate through the first connection certificate includes: the first device determines at least one set of alternative connection certificates from the first connection certificate based on a root certificate trusted by the first device, and each set of backup certificates
  • the selected connection certificates include at least one of the first connection certificates.
  • the first device determines a set of candidate connection certificates including the smallest number of certificates as the target connection certificate, and verifies the legitimacy of the target connection certificate through a root certificate trusted by the first device. If the target connection certificate is valid, the validity of the first digital certificate is verified through the target connection certificate.
  • the root certificate trusted by the first device is the G1 root certificate
  • the root certificate with the latest validity period trusted by the second device is the G3 root certificate.
  • the first connection certificate includes a G1G2 connection certificate, a G2G3 connection certificate, and a G1G3 connection certificate. Then the first device determines that the first set of candidate connection certificates are G1G3 connection certificates, and determines that the second set of candidate connection certificates are G1G2 connection certificates and G2G3 connection certificates. Since the first set of alternative connection certificates includes a small number of certificates, only one, the first device determines the first set of alternative connection certificates as the target connection certificate. After that, the first device first verifies the legitimacy of the G1G3 connection certificate through the G1 root certificate, and then verifies the legitimacy of the first digital certificate through the G1G3 connection certificate.
  • the first device since the first device selects a set of alternative connection certificates with the smallest number of certificates as the target connection certificate, the first device establishes the shortest certificate chain in the process of verifying the legitimacy of the first digital certificate.
  • the shortest certificate chain Includes the root certificate trusted by the first device, the target connection certificate, and the first digital certificate.
  • this method is applicable to some versions of OpenSSL and Java development kit (JDK) 8 or higher.
  • JDK Java development kit
  • this method is used by default when the X509_V_FLAG_TRUSTED_FIRST option is turned on.
  • this method is adopted by default.
  • the first device can communicate with the second device based on the first digital certificate. For example, the second device sends information encrypted with the private key of the second device to the first device, and the first device can decrypt the information using the public key of the second device included in the first digital certificate, thereby realizing communication with the second device. Secure communication between devices.
  • the first device may directly determine that the verification of the first digital certificate fails and does not communicate with the second device. Or, for example, the first device can also traverse other groups of alternative connection certificates and verify the legitimacy of the first digital certificate through other groups of alternative connection certificates. If the first digital certificate is verified to be invalid through each set of candidate connection certificates, and then it is determined that the first digital certificate is invalid, the first device does not communicate with the second device.
  • the first device may not use the first connection certificate and directly use the root certificate trusted by the first device, that is, the validity period. the latest root certificate, Verify the legitimacy of the first digital certificate.
  • the verifiable level of the first device is 2, including the root certificate and the first digital certificate. Certificate.
  • the verifiable level of the first device is at least 3, including the root certificate, the first connection certificate and the first digital certificate. Certificate. If the number of first connection certificates used by the first device is multiple, the verifiable level of the first device is 4 or more. Therefore, when applying the embodiments of the present application, it is necessary to ensure that the first device has a high verifiable level. In other words, compared with the verification method that does not use the first connection certificate, the number of verifiable levels of the first device in the embodiment of the present application needs to be increased by at least one level.
  • the embodiment of the present application does not require the modification of the first device when applying the digital certificate verification method provided by the embodiment of the present application.
  • the first device can be configured when the first device is manufactured or used in the network. The higher verifiable level enables the first device to perform the digital certificate verification method provided by the embodiment of the present application without modifying the first device.
  • the first device can verify the first digital certificate only by using the root certificate trusted by the first device and the first connection certificate sent by the second device. Therefore, the first device does not need to upload additional certificates. Moreover, there is no need to confirm the certificate trusted by the peer device between the second device and the first device. Therefore, the process of verifying the first digital certificate is transparent and insensible to the first device, and the first device does not need to be aware of at least two root certificates. coexistence situation. Therefore, the digital certificate verification method provided by the embodiment of the present application is essentially automatically compatible with the first device, and there is no need to improve the first device.
  • the digital certificate verification method provided by the embodiment of the present application has a wide application range. Scenarios where this method is applicable include but are not limited to: scenarios where the first device cannot upload, scenarios where the first device is difficult or slow to upload, scenarios where the first device cannot perceive the coexistence of at least two root certificates, etc. Moreover, the digital certificate verification method provided by the embodiment of this application is also relatively simple, which reduces the complexity of verifying the digital certificate during the update process of the root certificate and reduces the verification cost.
  • steps 201 to 203 are the process of the first device verifying the first digital certificate of the second device.
  • the second device can also verify the legitimacy of the second digital certificate of the first device.
  • the second device verifies the second digital certificate, including but not limited to the following situations B1 and B2.
  • the method further includes: the first device sends a second digital certificate to the second device, and the second digital certificate is based on the root certificate trusted by the first device.
  • the private key of the certificate and the information of the first device are generated.
  • the second device receives the second digital certificate sent by the first device, and the second device verifies the legitimacy of the second digital certificate based on the root certificate trusted by the first device.
  • the first device Since the root certificate trusted by the first device is any one of at least two root certificates, and generating a connection certificate requires two root certificates, the first device will only send the second digital certificate to the second device, but not to the second device.
  • the second device sends the connection certificate. Therefore, when the second device receives the second digital certificate sent by the first device, it can directly verify the legitimacy of the second digital certificate through the root certificate trusted by the first device.
  • the verification method please refer to the first device verification in step 203 above. The method of the first digital certificate will not be described again here.
  • the root certificates trusted by the first device are at least two of the at least two root certificates.
  • the method further includes: the first device sends a second connection certificate and a second digital certificate to the second device, and the second connection certificate is the second root certificate. At least one of the connection certificates corresponding to the root certificate trusted by the first device, and the second digital certificate is generated based on the private key of the root certificate with the latest validity period among the root certificates trusted by the first device and the information of the first device.
  • the second device receives the second connection certificate and the second digital certificate sent by the first device, and the second device verifies the second digital certificate based on the root certificate and the second connection certificate trusted by the first device.
  • a connection certificate can be generated based on the root certificate trusted by the first device, and the generated connection certificate is the connection certificate corresponding to the root certificate trusted by the first device.
  • a second connection certificate may be determined based on the generated connection certificate.
  • the method of generating a connection certificate based on the root certificate trusted by the first device please refer to the description of at least one connection certificate in step 201 above.
  • the method of determining the second connection certificate based on the generated connection certificate please refer to the second connection certificate in step 201 above. The method by which the device chooses to obtain the first connection certificate will not be described again here.
  • the second device After the second device receives the second connection certificate and the second digital certificate sent by the first device, the second device verifies the validity of the second digital certificate based on the root certificate and the second connection certificate trusted by the first device.
  • the verification method please refer to the method of the first device verifying the first digital certificate in step 203 above, which will not be described again here.
  • the second device uses dual storage areas to separately store the certificate.
  • the dual storage area includes a first storage area and a second storage area.
  • the first storage area is used to store certificates that need to be sent to the first device, including but not limited to the above-mentioned at least one connection certificate and the first digital certificate.
  • the second memory is used to store certificates sent by the first device, including but not limited to the above-mentioned second connection certificate and second digital certificate. Therefore, when the second device needs to send a certificate to the first device, it only needs to read the first storage area. When the second device needs to verify the certificate sent by the first device, it only needs to read the second storage area.
  • Applicable scenarios include but are not limited to OpenSSL version 1.0.2 and JDK8.
  • chainCApath is specified as the above-mentioned first storage area
  • verifyCApath is specified as the above-mentioned second storage area.
  • KeyStore is designated as the above-mentioned first storage area
  • TrustStore is designated as the above-mentioned second storage area.
  • the first device may also use dual storage areas, one of which is used to store certificates that need to be sent to the second device, such as the connection certificate and the second digital certificate corresponding to the root certificate trusted by the first device. Another storage area is used to store certificates sent by the second device, such as the above-mentioned first connection certificate and first digital certificate. This enables separate storage of certificates. I won’t go into details here.
  • the method further includes: the second device sends the first digital certificate to the first device, the first device receives the first digital certificate sent by the second device, and the first device verifies the first digital certificate based on the root certificate with the latest validity period. Certificate.
  • the root certificate trusted by the first device includes the root certificate with the latest validity period.
  • the second device Since the root certificate with a non-latest validity period among the at least two root certificates is invalid, at least one connection certificate stored by the second device has also become invalid, and both the second device and the first device only trust the root certificate with the latest validity period. Therefore, the second device does not need to send the first connection certificate, but directly sends the first digital certificate to the first device, and the first device can verify the first digital certificate through the root certificate with the latest validity period. Similarly, the first device can also directly send the second digital certificate to the second device, and the second device can verify the first digital certificate through the root certificate with the latest validity period.
  • the method further includes: the second device revokes at least two root certificates in a direct revocation manner, At least one of the at least one connection certificate and the first digital certificate invalidates the revoked at least one certificate.
  • certificate revocation (certificate revocation) is also called certificate revocation. If the certificate needs to be invalidated in advance before the validity period of the certificate ends, certificate revocation needs to be performed.
  • Request for comments (RFC) 5280 describes two revocation methods: direct revocation and indirect revocation. Among them, the indirect revocation method is not universal and may not be applicable to software such as OpenSSL, TLS, and red hat products. Therefore, as an example, the embodiment of this application adopts the direct revocation method to perform certificate revocation.
  • certificate revocation is performed by signing certificate revocation lists (CRLs).
  • the signers of CRLs are the same as the signers of the individual certificates included in the CRLs.
  • the private key of the non-latest valid root certificate can be directly destroyed or sealed.
  • the private key of a root certificate with a non-latest validity period may not be destroyed or sealed temporarily, but the private key may continue to be used to sign the above-mentioned CRLs.
  • this private key is no longer used to sign new certificates. As a result, the security of private keys is guaranteed through restrictions and enhanced management.
  • the first device may also use a direct revocation method to revoke at least one of the root certificates trusted by the first device, making the at least one revoked certificate invalid. I won’t go into details here.
  • the second device satisfies a reference condition, which includes at least one of a certificate storage space capacity greater than a capacity threshold and a root certificate update function; or the second device has an alarm function.
  • the second device By making the second device meet the reference conditions, it is possible to avoid emergency updates of the root certificate (for example, the need to urgently update the root certificate when it is detected that the private key of the root certificate is not secure enough or even leaked), and switch to a new cryptography system (for example, switching to post-quantum cryptography). Algorithm) and other situations lead to the problem of insufficient certificate storage space in the second device.
  • the second device can generate an alarm to provide the user with countermeasures. For example, users are prompted to replace the second device with other devices in a timely manner to ensure the continuity of communication services.
  • the cryptographic agility of the second device can be improved, which is suitable for situations where the second device is a security critical equipment.
  • the second device may issue an alarm if the second device does not meet the reference condition.
  • the first device meets the above reference conditions, or the first device has an alarm function.
  • the reference conditions and alarm functions will not be described in detail.
  • the method further includes: the second device sending application scenario information corresponding to the second device to the first device.
  • the first device receives the application scenario information sent by the second device, and after verifying that the first digital certificate is legal, the first device confirms that the application scenario information is correct.
  • the application scenario is a code signing PKI system
  • the application scenario information is code, patches or installation packages that need to be released.
  • the second device sends the first connection certificate, the first digital certificate and the above code, patch or installation package to the first device through (cryptographic message syntax, CMS).
  • CMS cryptographic message syntax
  • the CMS method allows the first connection certificate and the first digital certificate to be carried, so that the first device can verify the validity of the first digital certificate in the above method.
  • the CMS method also allows not to carry these certificates.
  • the first device should try to support a larger number of cryptographic algorithms and key lengths to ensure that when the first connection certificate and the first digital certificate adopt new cryptographic algorithms and key lengths, the digital The certificate verification process is still can proceed normally.
  • the algorithms supported by the first device include but are not limited to: Rivest-Shamir-Adleman (RSA)-public-key cryptography standards (PKCS) Various versions, RSA-probabilistic signature scheme (PSS), elliptic curve digital signature algorithm (ECDSA), etc.
  • Key lengths supported by the first device include but are not limited to: RSA 2048, RSA 3072, RSA 4096 or above, and ECDSA 256, ECDSA 384, ECDSA 512, etc.
  • the application scenario is a timestamp PKI system, and accordingly, the application scenario information is a timestamp. Then, after the first device verifies that the first digital certificate is legal and confirms that the timestamp is correct, the timestamp can be embedded in the relevant data of the first device for use.
  • the timestamp may be a timestamp randomly generated by a timestamp mechanism, and such timestamp may be used by various devices including the first device.
  • the timestamp may also be a timestamp issued by the timestamp mechanism to the first device according to the first device's request, and such timestamp is only used by the first device. No limitation is made here.
  • digital certificate verification solution provided by the embodiments of this application can also be combined with other types of devices to form a hybrid architecture, thereby further expanding the scope of application and increasing the redundancy and flexibility of the system.
  • a third device can be added, which stores at least two root certificates and a third digital certificate.
  • the third digital certificate is generated based on the private key of the root certificate with the latest validity period and the information of the third device.
  • the device does not store at least one connection certificate.
  • the second device provided in the embodiment of this application can send the first connection certificate and the first digital certificate to the third device, so that the third device verifies the legitimacy of the first digital certificate.
  • the second device provided in the embodiment of this application can also receive a third digital certificate sent by the third device to verify the legitimacy of the third digital certificate. Wherein, before and after the root certificate with the latest validity expires, the third device sends the third digital certificate without switching the sent certificate, thereby reducing interference to the business.
  • a fourth device may be added, which stores at least two root certificates and a fourth digital certificate.
  • the fourth digital certificate is generated based on the private key of the root certificate with the earliest validity period and the information of the fourth device.
  • the second device provided in the embodiment of this application can send the first connection certificate and the first digital certificate to the fourth device, so that the fourth device verifies the legitimacy of the first digital certificate.
  • the first device provided in the embodiment of this application may send a second digital certificate to the fourth device, or send a second connection certificate and a second digital certificate, so that the fourth device verifies the legitimacy of the second digital certificate.
  • the second device provided in the embodiment of the present application can also receive a fourth digital certificate sent by the fourth device to verify the legitimacy of the fourth digital certificate. If the root certificate trusted by the first device provided by the embodiment of this application includes the root certificate with the earliest validity period, the first device can also receive and verify the legitimacy of the fourth digital certificate sent by the fourth device.
  • the third device and the fourth device can also interact with each other.
  • the fourth device can receive and verify the legitimacy of the third digital certificate sent by the third device.
  • the third device may also receive and verify the legitimacy of the fourth digital certificate sent by the fourth device.
  • the embodiment of the present application also provides a digital certificate verification method, which is implemented through the interaction between the first device and the second device. As shown in Figure 4, the method includes the following steps 401 to 403.
  • Step 401 The second device sends the first connection certificate, at least one SubCA certificate and the first digital certificate to the first device.
  • the second device stores at least two valid root certificates, at least one SubCA certificate, at least one connection certificate and the first digital certificate.
  • at least two root certificates, at least one connection certificate and the first connection certificate please refer to the corresponding description of the method embodiment shown in Figure 2 above, which will not be described again here.
  • the first digital certificate processes the information of the second device based on the private key of at least one SubCA certificate.
  • the signature is obtained by at least one SubCA certificate signing the SubCA information based on the private key of the root certificate with the latest validity period.
  • the SubCA certificate of the highest level SubCA among the multiple levels is signed by the root certificate.
  • SubCA certificates of other levels of SubCA except the highest level are signed by the SubCA certificate of the previous level of SubCA.
  • Digital certificates are signed by the SubCA certificate of the lowest level SubCA.
  • the SubCA certificate signed by the Gn root certificate is represented as a GnSubCA certificate. For example, see Figure 3. Taking a SubCA that only includes one level as an example, the G3 root certificate is signed to obtain the G3SubCA certificate, and the G3SubCA certificate is signed to obtain the G3 digital certificate.
  • Step 402 The first device receives the first connection certificate, at least one SubCA certificate and the first digital certificate sent by the second device.
  • the first device Since the second device performs the above step 401, the first device accordingly receives the first connection certificate, at least one SubCA certificate and the first digital certificate sent by the second device.
  • Step 403 The first device verifies the validity of the first digital certificate based on the root certificate trusted by the first device, at least one SubCA certificate, and the first connection certificate.
  • the first device first verifies the legitimacy of the first connection certificate through a root certificate trusted by the first device, that is, confirms whether the signature included in the first connection certificate can be decrypted by the public key of the root certificate trusted by the first device. After verifying the legitimacy of the first connection certificate, verify the legitimacy of the at least one SubCA certificate through the first connection certificate, that is, confirm whether the signature included in the at least one SubCA can be decrypted by the public key included in the first digital certificate. After verifying the legitimacy of the at least one SubCA certificate, verify the legitimacy of the first digital certificate through the at least one SubCA certificate, that is, confirm whether the signature included in the first digital certificate can be decrypted by the public key included in the at least one SubCA certificate. It should be understood that when SubCA includes multiple levels, the validity of the SubCA certificate of the highest level SubCA is verified by the first connection certificate, and the validity of the first digital certificate is determined by the SubCA certificate of the lowest level SubCA. Verification will not be repeated here.
  • step 203 illustrates the process in which the first device verifies the legitimacy of the first digital certificate based on the root certificate trusted by the first device and the first connection certificate. If the content described in step 203 is applicable to step 403 here, it is also included here by reference.
  • the verification process includes the following situations C1 to C3.
  • device A is a new G2 device and trusts the G1 root certificate, G2 root certificate, G1G2 connection certificate, G2SubCA certificate signed by the G2 root certificate, and G2 digital certificate A signed by the G2SubCA certificate.
  • Device B is an old G1 device and trusts the G1 root certificate, the G1SubCA certificate signed by the G1 root certificate, and the G1 digital certificate B signed by the G1SubCA certificate.
  • device A corresponds to the second device above
  • device B corresponds to the first device above
  • the root certificate trusted by the first device is the root certificate with the earliest validity period.
  • device A sends the G1G2 connection certificate, G2SubCA certificate and G2 digital certificate A to device B.
  • Device B verifies the G1 root certificate, G1G2 connection certificate, G2SubCA certificate and G2 digital certificate A in the order;
  • device B sends G1SubCA certificate and G1 digital certificate B to device A, and device A verifies in the order of G1 root certificate, G1SubCA certificate and G1 digital certificate B;
  • device A is the same as device A in scenario C1, and device B is also a new G2 device.
  • device A corresponds to the second device above
  • device B corresponds to the first device above
  • the root certificate trusted by the first device is the root certificate with the latest validity period.
  • device A sends the G1G2 connection certificate, G2SubCA certificate and G2 digital certificate A to device B.
  • Device B verifies the G1 root certificate, G1G2 connection certificate, G2SubCA certificate and G2 digital certificate A in the order;
  • device B sends the G1G2 connection certificate, G2SubCA certificate and G2 digital certificate B to device A.
  • Device A verifies the G1 root certificate, G1G2 connection certificate, G2SubCA certificate and G2 digital certificate B in the order;
  • device A sends the G2SubCA certificate and G2 digital certificate A to device B.
  • Device B verifies in the order of the G2 root certificate, G2SubCA certificate and G2 digital certificate A;
  • device B sends the G2SubCA certificate and G2 digital certificate B to device A.
  • Device A performs verification in the order of the G2 root certificate, G2SubCA certificate, and G2 digital certificate B.
  • device A is an old G1 device and trusts the G1 root certificate, G1SubCA certificate and G1 digital certificate A signed by the G1SubCA certificate.
  • Device B is the same as device B in scenario C1. In case C1, both device A and device B correspond to the first device above, and the root certificate trusted by the first device is the root certificate with the earliest validity period.
  • device A sends the G1SubCA certificate and G1 digital certificate A to device B.
  • Device B verifies the sequence of G1 root certificate, G1SubCA certificate and G1 digital certificate A;
  • device B sends G1SubCA certificate and G1 digital certificate B to device A, and device A verifies in the order of G1 root certificate, G1SubCA certificate and G1 digital certificate B;
  • both device A and device B stop operating and go offline, and device A and device B no longer interact.
  • the new device (Device A in case C1, Device A and Device B in case C2) and the old device (Device B in case C1, Device A and Device B in case C3)
  • the root certificate trusted by the device For new devices, before the G1 root certificate expires, the G1G2 connection certificate, G2SubCA certificate, and digital certificate signed by the G2SubCA certificate are sent. After the G1 root certificate expires, the G1G2 connection certificate is no longer sent, but the G2SubCA certificate and the G2SubCA certificate are sent. Certificate signed digital certificate. For old devices, the G1SubCA certificate and the digital certificate signed by the G1SubCA certificate are only sent before the G1 root certificate expires. After the G1 root certificate expires, it stops operating and goes offline.
  • the first device stores the root certificate trusted by the first device.
  • the first device does not need to upload other certificates. It only needs to receive the first connection certificate and the first digital certificate sent by the second device (or receive the first digital certificate sent by the second device).
  • the validity of the first digital certificate can be verified.
  • the first device and the second device do not need to mutually confirm the root certificate trusted by the peer device, so that the coexistence of at least two root certificates is transparent and insensible to the first device.
  • the method provided by the embodiments of this application is simple and easy to implement, and has a wide application range. Even if the first device does not have the upload function, or cannot sense the coexistence of at least two root certificates, it can still verify the digital certificate. Moreover, it reduces the complexity of the digital certificate verification process and saves verification costs.
  • the embodiment of the present application also provides another digital certificate verification device.
  • the device is applied to the first device.
  • the device is used to execute the digital certificate verification method executed by the first device in FIG. 2 through each module shown in FIG. 8 .
  • the digital certificate provided by the embodiment of this application The verification device includes the following modules.
  • Receiving module 801 configured to receive a first connection certificate and a first digital certificate sent by the second device.
  • the first connection certificate is at least one of at least one connection certificate stored on the second device.
  • One connection certificate is based on two root certificates.
  • the private key of the root certificate with an earlier validity period is obtained by signing the public key of the root certificate with a later validity period.
  • the two root certificates are any two of the at least two root certificates stored on the second device.
  • the first digital certificate Generating based on the private key of the root certificate with the latest validity period among at least two root certificates and the information of the second device;
  • the verification module 802 is configured to verify the legitimacy of the first digital certificate based on the root certificate trusted by the first device and the first connection certificate.
  • the root certificate trusted by the first device is at least one of at least two root certificates.
  • the root certificate trusted by the first device is at least one of at least two root certificates
  • the apparatus further includes: a first sending module, configured to send a second digital certificate to the second device, so that the second device The validity of the second digital certificate is verified, and the second digital certificate is generated based on the private key of the root certificate trusted by the first device and the information of the first device.
  • the root certificate trusted by the first device includes at least two of the at least two root certificates
  • the apparatus further includes: a second sending module, configured to send the second connection certificate and the second number to the second device.
  • the certificate enables the second device to verify the legitimacy of the second digital certificate.
  • the second connection certificate is at least one of the connection certificates corresponding to the root certificate trusted by the first device.
  • the second digital certificate is based on the validity period of the root certificate trusted by the first device.
  • the private key of the latest root certificate and the information of the first device are generated.
  • the root certificate trusted by the first device includes the root certificate with the latest validity period, and the receiving module 801 is also used to wait until the root certificate with the latest validity period expires, and the validity period of at least two root certificates is not the latest. After the root certificate of the device expires, receive the first digital certificate sent by the second device; the verification module 802 is also configured to verify the legitimacy of the first digital certificate based on the root certificate with the latest validity period.
  • the apparatus further includes: a revocation module, configured to revoke at least one certificate in the root certificate trusted by the first device in a direct revocation manner, so as to invalidate the at least one revoked certificate.
  • a revocation module configured to revoke at least one certificate in the root certificate trusted by the first device in a direct revocation manner, so as to invalidate the at least one revoked certificate.
  • the receiving module 801 is also configured to receive the application scenario information sent by the second device; the verification module 802 is also configured to confirm that the application scenario information is correct after verifying that the first digital certificate is legal.
  • the first device satisfies a reference condition, which includes at least one of a certificate storage space capacity greater than a capacity threshold and a root certificate update function; or the first device has an alarm function.
  • embodiments of the present application also provide a digital certificate verification device.
  • the device is applied to the second device.
  • the device is used to execute the digital certificate verification method executed by the second device in FIG. 2 through each module shown in FIG. 9 .
  • the digital certificate verification device provided by the embodiment of this application includes the following modules.
  • the sending module 901 is configured to send the first connection certificate and the first digital certificate to the first device, so that the first device verifies the validity of the first digital certificate.
  • the second device stores at least two valid root certificates, at least one connection certificate and a first digital certificate.
  • One connection certificate is based on the private key of the root certificate with an earlier validity period among the two root certificates and the root certificate with a later validity period.
  • the two root certificates are any two of at least two root certificates.
  • the first digital certificate is generated based on the private key of the root certificate with the latest validity period among the at least two root certificates and the information of the second device. .
  • the first connection certificate is at least one of at least one connection certificate, and the first connection certificate is used to verify the validity of the first digital certificate.
  • the two root certificates are any two root certificates with adjacent validity periods among the at least two root certificates.
  • the apparatus further includes: a query module, configured to query a root certificate trusted by the first device, where the root certificate trusted by the first device is at least one of at least two root certificates; and a selection module, configured to query based on the first A root certificate of device trust certificate, select the first connection certificate from at least one connection certificate, and the root certificate trusted by the first device is used to verify the legitimacy of the first connection certificate.
  • a query module configured to query a root certificate trusted by the first device, where the root certificate trusted by the first device is at least one of at least two root certificates
  • a selection module configured to query based on the first A root certificate of device trust certificate, select the first connection certificate from at least one connection certificate, and the root certificate trusted by the first device is used to verify the legitimacy of the first connection certificate.
  • the root certificate trusted by the first device is any one of at least two root certificates
  • the device further includes: a first verification module, configured to receive a second digital certificate sent by the first device, the second digital certificate The certificate is generated based on the private key of the root certificate trusted by the first device and the information of the first device; the legitimacy of the second digital certificate is verified based on the root certificate trusted by the first device.
  • the root certificates trusted by the first device are at least two of the at least two root certificates
  • the apparatus further includes: a second verification module, configured to receive the second connection certificate and the second certificate sent by the first device.
  • Digital certificate, the second connection certificate is at least one of the connection certificates corresponding to the root certificate trusted by the first device, and the second digital certificate is based on the private key of the root certificate with the latest validity period among the root certificates trusted by the first device and the first device Information generation; verify the legitimacy of the second digital certificate based on the root certificate trusted by the first device and the second connection certificate.
  • the root certificates trusted by the first device include the root certificate with the latest validity period.
  • the sending module 901 is also used to send the root certificate with the latest validity period before the root certificate with the latest validity period expires, and the validity period of at least two root certificates is not the latest. After the root certificate expires, the first digital certificate is sent to the first device, so that the first device verifies the legitimacy of the first digital certificate based on the root certificate with the latest validity period.
  • the device further includes: a revocation module, configured to revoke at least one of at least two root certificates, at least one connection certificate and the first digital certificate in a direct revocation manner, so that the revoked at least one certificate Invalid.
  • a revocation module configured to revoke at least one of at least two root certificates, at least one connection certificate and the first digital certificate in a direct revocation manner, so that the revoked at least one certificate Invalid.
  • the sending module 901 is also configured to send the application scenario information corresponding to the second device to the first device, so that the first device can confirm that the application scenario information is correct after verifying that the first digital certificate is legal.
  • the second device satisfies a reference condition, which includes at least one of a certificate storage space capacity greater than a capacity threshold and a root certificate update function; or the second device has an alarm function.
  • the first device is configured to verify the legitimacy of the first digital certificate based on a root certificate trusted by the first device and a first connection certificate, and the root certificate trusted by the first device is at least one of the at least two root certificates. one.
  • embodiments of the present application also provide a digital certificate verification device.
  • the device is applied to the first device.
  • the device is used to execute the digital certificate verification method executed by the first device in FIG. 4 through each module shown in FIG. 10 .
  • the device includes the following modules.
  • the receiving module 1001 is configured to receive a first connection certificate, at least one secondary certification center certificate and a first digital certificate sent by the second device, where the first connection certificate is at least one of at least one connection certificate stored on the second device, A connection certificate is obtained by signing the public key of the root certificate with a later validity period among the two root certificates based on the private key of the earlier root certificate among the two root certificates.
  • the two root certificates are at least two stored on the second device. Any two of the root certificates, the first digital certificate is generated based on the private key of the root certificate with the latest validity period among the at least two root certificates, at least one secondary certification center certificate stored on the second device, and the information of the second device ;
  • the verification module 1002 is configured to verify the legitimacy of the first digital certificate based on the root certificate trusted by the first device, at least one secondary certification center certificate, and the first connection certificate.
  • the root certificate trusted by the first device is at least one of the two root certificates. at least one of.
  • embodiments of the present application also provide a digital certificate verification device.
  • the device is applied to a second device.
  • the second device stores at least two valid root certificates, at least one secondary certification center certificate, at least one connection certificate and a first digital certificate.
  • a connection certificate is based on the longer validity period of the two root certificates.
  • the private key of the earlier root certificate is obtained by signing the public key of the root certificate with a later validity period.
  • the two root certificates are any two of at least two root certificates.
  • the first digital certificate is based on at least two root certificates with the longest validity period.
  • the device is used to execute the digital certificate verification method executed by the second device in FIG. 4 through each module shown in FIG. 11 . As shown in Figure 11, the device includes the following modules.
  • the sending module 1101 is configured to send the first connection certificate, at least one secondary certification center certificate and the first digital certificate to the first device, so that the first device verifies the validity of the first digital certificate.
  • the first connection certificate is at least one connection certificate. At least one of the certificates, the first connection certificate and at least one secondary certification center certificate are used to verify the legitimacy of the first digital certificate.
  • the first device stores a root certificate trusted by the first device.
  • the first device does not need to upload other additional certificates, nor does it need to detect the coexistence of at least two root certificates. Instead, it is based on the root certificate trusted by the first device and
  • the received first connection certificate (or based on the root certificate trusted by the first device, the received at least one secondary CA certificate and the first connection certificate) can realize the verification of the first digital certificate. Therefore, the device provided by the embodiment of the present application has a wide application range, and can realize the verification of digital certificates even if the first device does not have the upload function or cannot detect the coexistence of at least two root certificates. This reduces the complexity of the digital certificate verification process and saves verification costs.
  • FIG 12 shows a schematic structural diagram of an exemplary digital certificate verification device 1200 of this application.
  • the digital certificate verification device 1200 includes at least one processor 1201, a memory 1203, and at least one network interface 1204.
  • the processor 1201 is, for example, a general central processing unit (Central Processing Unit, CPU), digital signal processor (digital signal processor, DSP), network processor (network processor, NP), GPU, neural network processor (neural-network processing) units (NPU), data processing unit (Data Processing Unit, DPU), microprocessor or one or more integrated circuits or application-specific integrated circuits (ASIC), programmable logic used to implement the solution of this application device (programmable logic device, PLD), other general-purpose processors or other programmable logic devices, discrete gates, transistor logic devices, discrete hardware components, or any combination thereof.
  • CPU Central Processing Unit
  • DSP digital signal processor
  • network processor network processor
  • NP network processor
  • GPU neural network processor
  • neural-network processing units NPU
  • data processing unit Data Processing Unit
  • programmable logic used to implement the solution of this application device programmable logic device, PLD
  • PLD programmable logic device
  • PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (GAL), or any combination thereof.
  • a general-purpose processor can be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports advanced RISC machines (ARM) architecture. It may implement or execute the various logical blocks, modules, and circuits described in connection with this disclosure.
  • the processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on.
  • the digital certificate verification device 1200 also includes a bus 1202.
  • Bus 1202 is used to transfer information between components of the digital certificate verification device 1200 .
  • the bus 1202 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • the bus 1202 can be divided into an address bus, a data bus, a control bus, etc. For ease of presentation, only one line is used in Figure 12, but it does not mean that there is only one bus or one type of bus.
  • Memory 1203 is, for example, volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory can be read-only memory (ROM), programmable read-only memory Memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be random access memory (RAM), which is used as an external cache.
  • ROM is a compact disc read-only memory (CD-ROM).
  • RAM includes but is not limited to static random access memory (static RAM, SRAM), dynamic random access memory (dynamic random access memory, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic Random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) and direct memory bus random access memory (direct rambus RAM, DR RAM).
  • static random access memory static random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • double data rate SDRAM double data rate SDRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced synchronous dynamic random access memory
  • SLDRAM synchronous link dynamic random access memory
  • direct rambus RAM direct rambus RAM
  • Memory 1203 may also be other types of storage devices that may store static information and instructions. Or it could be other types of dynamic storage devices that can store information and instructions. Or it can be other optical disk storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store instructions or data structures without limitation, any other medium in the form of the desired program code and capable of being accessed by a computer.
  • the memory 1203 exists independently, for example, and is connected to the processor 1201 through the bus 1202 . Memory 1203 may also be integrated with processor 1201.
  • the network interface 1204 uses any device such as a transceiver for communicating with other devices or a communication network.
  • the communication network can be an Ethernet, a radio access network (RAN), or a wireless local area network (WLAN). )wait.
  • the network interface 1204 may include a wired network interface and may also include a wireless network interface.
  • the network interface 1204 can be an Ethernet interface, such as: Fast Ethernet (FE) interface, Gigabit Ethernet (GE) interface, Asynchronous Transfer Mode (Asynchronous Transfer Mode, ATM) interface, WLAN interface, a cellular network interface, or a combination thereof.
  • the Ethernet interface can be an optical interface, an electrical interface, or a combination thereof.
  • the network interface 1204 may be used for the digital certificate verification device 1200 to communicate with other devices.
  • the processor 1201 may include one or more CPUs, such as CPU0 and CPU1 as shown in FIG. 12 . Each of these processors can be a single-core processor or a multi-core processor.
  • a processor here may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
  • the digital certificate verification device 1200 may include multiple processors, such as the processor 1201 and the processor 1205 shown in FIG. 12 . Each of these processors can be a single-core processor or a multi-core processor.
  • a processor here may refer to one or more devices, circuits, and/or processing cores for processing data (such as computer program instructions).
  • the memory 1203 is used to store program instructions 1210 for executing the solution of the present application
  • the processor 1201 can execute the program instructions 1210 stored in the memory 1203. That is to say, the digital certificate verification device 1200 can implement the method provided by the method embodiment through the processor 1201 and the program instructions 1210 in the memory 1203, that is, the method executed by the first device or the second device in Figures 2 and 4. method.
  • Program instructions 1210 may include one or more software modules.
  • the processor 1201 itself can also store program instructions for executing the solution of the present application.
  • the digital certificate verification device 1200 of this application may correspond to the first network element device used to perform the above method.
  • the processor 1201 in the digital certificate verification device 1200 reads the instructions in the memory 1203, so that Figure 12
  • the digital certificate verification device 1200 shown is capable of performing all or part of the steps in the method embodiment.
  • the digital certificate verification device 1200 may also correspond to the above-mentioned devices shown in FIGS. 8 to 11 .
  • Each functional module in the devices shown in FIGS. 8 to 11 is implemented using the software of the digital certificate verification device 1200 .
  • the functional modules included in the devices shown in FIGS. 8 to 11 are generated after the processor 1201 of the digital certificate verification device 1200 reads the program instructions 1210 stored in the memory 1203 .
  • Each step of the methods shown in FIG. 2 and FIG. 4 is completed through an integrated logic circuit of hardware or instructions in the form of software in the processor of the digital certificate verification device 1200 .
  • the steps of the method embodiments disclosed in this application can be directly implemented by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • the software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method embodiment in combination with its hardware. To avoid repetition, the details will not be described here.
  • a digital certificate verification system in an exemplary embodiment, includes a first device and a second device that are communicatively connected.
  • the first device and the second device are used to implement the digital certificate verification method shown in Figure 2, or the first device and the second device are used to implement the digital certificate verification method shown in Figure 4.
  • a computer program (product) is provided.
  • the computer program (product) includes: computer program code.
  • the computer program code When the computer program code is run by a computer, it causes the computer to execute the numbers shown in Figure 2 or Figure 4 above. Certificate verification method.
  • a computer-readable storage medium stores programs or instructions.
  • the program or instructions When the program or instructions are run on a computer, the verification of the digital certificate shown in Figure 2 or Figure 4 is performed. The method is executed.
  • a chip including a processor for calling and running instructions stored in the memory, so that the computer installed with the chip executes the above-mentioned digital certificate shown in Figure 2 or Figure 4 Authentication method.
  • another chip including: an input interface, an output interface, a processor, and a memory.
  • the input interface, the output interface, the processor, and the memory are connected through an internal connection path.
  • the processor is used to execute the memory.
  • the computer installed with the chip executes the above-mentioned verification method of the digital certificate shown in Figure 2 or Figure 4.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more available media integrated.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk), etc.
  • first, second, etc. are used to distinguish the same or similar items with basically the same functions and functions. It should be understood that the terms “first”, “second” and “nth” There are no logical or sequential dependencies, and there is no control over quantity or execution. Row order is limited. It should also be understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another.
  • the size of the sequence number of each process does not mean the order of execution.
  • the execution order of each process should be determined by its function and internal logic, and should not be determined by the execution order of the embodiments of the present application.
  • the implementation process constitutes no limitation.
  • the term "at least one” in this application means one or more, and the term “plurality” in this application means two or more.
  • a plurality of first devices means two or more.
  • the terms “system” and “network” are often used interchangeably in this article.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Storage Device Security (AREA)

Abstract

本申请公开了数字证书的验证方法、装置、设备及计算机可读存储介质,属于信息与通信技术领域。其中,方法包括:第一设备接收第二设备发送的第一连接证书和第一数字证书,基于第一设备信任的根证书和第一连接证书验证该第一数字证书的合法性。本申请中第一设备与第二设备无需确认对端设备信任的根证书,且第一设备无需额外上载其他证书,也无需感知至少两个根证书共存的情况。第一设备基于第一设备信任的根证书和接收的第一连接证书即可验证第一数字证书的合法性。该方法简单易行、适用范围广。

Description

数字证书的验证方法、装置、设备及计算机可读存储介质
本申请要求于2022年4月7日提交的申请号为202210363720.9、发明名称为“数字证书的验证方法、装置、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息与通信技术(information and communications technology,ICT)领域,特别涉及数字证书的验证方法、装置、设备及计算机可读存储介质。
背景技术
在ICT领域中,设备持有数字证书。在一个设备与另一个设备进行通信之前,需要验证另一个设备持有的数字证书的合法性。其中,合法性的验证过程依赖于根证书,根证书具有一定的有效期。为保证通信过程的连续性,需要在旧根证书失效之前就引入新根证书,新根证书的有效期晚于旧根证书的有效期。由此,形成了至少两个根证书共存的情况。如何在至少两个根证书共存的情况下验证数字证书的合法性,成为亟待解决的问题。
发明内容
本申请提供了一种数字证书的验证方法、装置、设备及计算机可读存储介质,以在至少两个根证书共存的情况下验证数字证书的合法性。本申请提供的技术方案如下。
第一方面,提供了一种数字证书的验证方法,该方法应用于第一设备。第一设备接收第二设备发送的第一连接证书和第一数字证书,基于第一设备信任的根证书和第一连接证书验证第一数字证书。其中,第一连接证书为第二设备上存储的至少一个连接证书中的至少一个,一个连接证书基于两个根证书中有效期较早的根证书的私钥对有效期较晚的根证书的公钥进行签名得到,两个根证书为第二设备上存储的至少两个根证书中的任意两个,第一设备信任的根证书为至少两个根证书中的至少一个,第一数字证书基于至少两个根证书中有效期最晚的根证书的私钥和第二设备的信息生成。
在本申请中,第一设备存储有第一设备信任的根证书,该第一设备无需额外上载其他证书,仅需接收第二设备发送的第一连接证书和第一数字证书,即可在第二设备存在至少两个根证书的情况下实现第一数字证书的合法性的验证。并且,第一设备与第二设备之间无需互相确认对端设备信任的根证书,使得至少两个根证书共存的情况对于第一设备而言是透明无感的。本申请提供的方法不仅简单易行,而且适用范围较广。并且,降低了数字证书的验证过程的复杂度,节约了验证成本。
在一种可能的实现方式中,第一设备信任的根证书为至少两个根证书中的任意一个,方法还包括:第一设备向第二设备发送第二数字证书,使第二设备验证第二数字证书的合法性,第二数字证书基于第一设备信任的根证书的私钥和第一设备的信息生成。
第一设备通过向第二设备发送第二数字证书,使得第二设备能够验证第二数字证书的合 法性。在该过程中,第一设备和第二设备无需确认对端设备信任的根证书,第一设备无需感知至少两个根证书共存的情况,适用范围广。
在一种可能的实现方式中,第一设备信任的根证书包括至少两个根证书中的至少两个,方法还包括:第一设备向第二设备发送第二连接证书和第二数字证书,使第二设备验证第二数字证书的合法性,第二连接证书为第一设备信任的根证书对应的连接证书中的至少一个,第二数字证书基于第一设备信任的根证书中有效期最晚的根证书的私钥和第一设备的信息生成。
第一设备通过向第二设备发送第二连接证书和第二数字证书,使得第二设备能够验证第二数字证书的合法性。在该过程中,第一设备和第二设备无需确认对端设备信任的根证书,第一设备无需感知至少两个根证书共存的情况,适用范围广。
在一种可能的实现方式中,第一设备信任的根证书包括有效期最晚的根证书,方法还包括:在有效期最晚的根证书失效之前,且至少两个根证书中有效期非最晚的根证书失效之后,第一设备接收第二设备发送的第一数字证书;第一设备基于有效期最晚的根证书验证第一数字证书的合法性。
随着时间变化,有效的至少两个根证书中仅有效期最晚的根证书仍然有效。在此种情况下,第一设备仍然能够验证第二设备的第一数字证书的合法性。
在一种可能的实现方式中,方法还包括:第一设备采用直接撤销的方式撤销第一设备信任的根证书中的至少一个证书,使被撤销的至少一个证书失效。
其中,直接撤销的方式具有普适性,适用范围广。
在一种可能的实现方式中,方法还包括:第一设备接收第二设备发送的应用场景信息;第一设备验证第一数字证书合法之后,确认应用场景信息正确。
通过该应用场景信息,使得本申请提供的数字证书的验证方法可以扩展应用于不同的应用场景。其中,应用场景信息可以基于应用场景灵活确定。
在一种可能的实现方式中,第一设备满足参考条件,参考条件包括证书存储空间的容量大于容量阈值和具备根证书更新功能中的至少一个条件;或者,第一设备具备告警功能。
通过令第一设备满足参考条件,使得第一设备适用于根证书紧急更新等特殊场景,增强了第一设备的适用范围。此外,令第一设备具备告警功能,可以及时对用户进行告警,从而可避免根证书更新失败影响第一设备的通信安全。
第二方面,提供了一种数字证书的验证方法,该方法应用于第一设备,包括:第一设备接收第二设备发送的第一连接证书、至少一个次级认证中心证书和第一数字证书。之后,该第一设备基于第一设备信任的根证书、至少一个次级认证中心证书和第一连接证书验证第一数字证书的合法性。其中,第一连接证书为第二设备上存储的至少一个连接证书中的至少一个,第一设备信任的根证书为至少两个根证书中的至少一个,一个连接证书基于两个根证书中有效期较早的根证书的私钥对两个根证书中有效期较晚的根证书的公钥进行签名得到,两个根证书为第二设备上存储的至少两个根证书中的任意两个,第一数字证书基于至少两个根证书中有效期最晚的根证书的私钥、第二设备上存储的至少一个次级认证中心证书和第二设备的信息生成。
在第二设备的第一数字证书基于至少两个根证书中有效期最晚的根证书的私钥、第二设备上存储的至少一个次级认证中心证书和第二设备的信息生成的情况下,第一设备仍然能够 在不额外上载其他证书、不感知至少两个根证书共存的情况且不与第二设备互相确认对端设备信任的根证书的前提下,实现对该第一数字证书的合法性的验证,适用范围较广。
第三方面,提供了一种数字证书的验证方法,该方法应用于第二设备,第二设备存储有有效的至少两个根证书、至少一个连接证书和第一数字证书,一个连接证书基于两个根证书中有效期较早的根证书的私钥对有效期较晚的根证书的公钥进行签名得到,两个根证书为至少两个根证书中的任意两个,第一数字证书基于至少两个根证书中有效期最晚的根证书的私钥和第二设备的信息生成,该方法包括:第二设备向第一设备发送第一连接证书和第一数字证书,使第一设备验证第一数字证书的合法性,第一连接证书为至少一个连接证书中的至少一个,第一连接证书用于验证第一数字证书的合法性。
在本申请中,第二设备仅需向第一设备发送第一连接证书和第一数字证书,即可使得第一设备实现第一数字证书的合法性的验证。其中,第一设备存储有第一设备信任的根证书,且第一设备在验证过程中无需额外上载其他证书。并且,第二设备与第一设备之间无需互相确认对端设备信任的根证书,使得至少两个根证书共存的情况对于第一设备而言是透明无感的。本申请提供的方法不仅简单易行,而且适用范围较广。并且,降低了数字证书的验证过程的复杂度,节约了验证成本。
在一种可能的实现方式中,两个根证书为至少两个根证书中的任意两个有效期相邻的根证书。
本申请通过有效期相邻的根证书生成连接证书,使得所生成的连接证书的数量较少。由于第一连接证书为连接证书中的至少一个,因而连接证书的数量较少,有利于减少第一连接证书包括的证书数量,从而减少第二设备向第一设备发送第一连接证书所需的传输资源。
在一种可能的实现方式中,第二设备向第一设备发送第一连接证书和第一数字证书之前,方法还包括:第二设备查询第一设备信任的根证书,第一设备信任的根证书为至少两个根证书中的至少一个;第二设备基于第一设备信任的根证书,从至少一个连接证书中选择得到第一连接证书,第一设备信任的根证书用于验证第一连接证书的合法性。
通过令第二设备查询第一设备信任的根证书,使得第二设备可以从至少一个连接证书中有针对性的选择第一连接证书,而无需将全部的连接证书均作为第一连接证书。由此,降低了第一连接证书包括的证书数量,减少了第二设备向第一设备发送第一连接证书所需的传输资源。
在一种可能的实现方式中,第一设备信任的根证书为至少两个根证书中的任意一个,方法还包括:第二设备接收第一设备发送的第二数字证书,第二数字证书基于第一设备信任的根证书的私钥和第一设备的信息生成;第二设备基于第一设备信任的根证书验证第二数字证书的合法性。
第二设备接收该第二数字证书并验证该第二数字证书的合法性。其中,第一设备和第二设备无需确认对端设备信任的根证书,第一设备无需感知至少两个根证书共存的情况,适用范围广。
在一种可能的实现方式中,第一设备信任的根证书为至少两个根证书中的至少两个,方法还包括:第二设备接收第一设备发送的第二连接证书和第二数字证书,第二连接证书为第一设备信任的根证书对应的连接证书中的至少一个,第二数字证书基于第一设备信任的根证书中有效期最晚的根证书的私钥和第一设备的信息生成;第二设备基于第一设备信任的根证 书和第二连接证书验证第二数字证书的合法性。
第二设备接收第二连接证书和第二数字证书,并验证第二数字证书的合法性。在该过程中,第一设备和第二设备无需确认对端设备信任的根证书,第一设备无需感知至少两个根证书共存的情况,适用范围广。
在一种可能的实现方式中,第一设备信任的根证书包括有效期最晚的根证书,方法还包括:在有效期最晚的根证书失效之前,且至少两个根证书中有效期非最晚的根证书失效之后,第二设备向第一设备发送第一数字证书,使第一设备基于有效期最晚的根证书验证第一数字证书的合法性。
随着时间变化,有效的至少两个根证书中仅有效期最晚的根证书仍然有效。在此种情况下,第一设备仍然能够验证第二设备的第一数字证书的合法性。
在一种可能的实现方式中,方法还包括:第二设备采用直接撤销的方式撤销至少两个根证书、至少一个连接证书和第一数字证书中的至少一个证书,使被撤销的至少一个证书失效。
其中,直接撤销的方式具有普适性,适用范围广。
在一种可能的实现方式中,方法还包括:第二设备向第一设备发送第二设备对应的应用场景信息,使第一设备验证第一数字证书合法之后,确认应用场景信息正确。
第二设备通过向第一设备发送应用场景信息,使得本申请提供的数字证书的验证方法可以扩展应用于不同的应用场景。其中,应用场景信息可以基于应用场景灵活确定。
在一种可能的实现方式中,第二设备满足参考条件,参考条件包括证书存储空间的容量大于容量阈值和具备根证书更新功能中的至少一个条件;或者,第二设备具备告警功能。
通过令第二设备满足参考条件,使得第二设备适用于根证书紧急更新等特殊场景,增强了第二设备的适用范围。而令第二设备具备告警功能,可以及时对用户进行告警,从而可避免根证书更新失败影响第二设备的通信安全。
在一种可能的实现方式中,第一设备用于基于第一设备信任的根证书和第一连接证书验证第一数字证书的合法性,第一设备信任的根证书为至少两个根证书中的至少一个。
第四方面,提供了一种数字证书的验证方法,该方法应用于第二设备,第二设备存储有有效的至少两个根证书、至少一个次级认证中心证书、至少一个连接证书和第一数字证书,一个连接证书基于两个根证书中有效期较早的根证书的私钥对有效期较晚的根证书的公钥进行签名得到,两个根证书为至少两个根证书中的任意两个,第一数字证书基于至少两个根证书中有效期最晚的根证书的私钥、至少一个次级认证中心证书和第二设备的信息生成,方法包括:第二设备向第一设备发送第一连接证书、至少一个次级认证中心证书和第一数字证书,使第一设备验证第一数字证书的合法性,第一连接证书为至少一个连接证书中的至少一个,第一连接证书和至少一个次级认证中心证书用于验证第一数字证书的合法性。
第五方面,提供了一种数字证书的验证装置,该装置应用于第一设备,装置包括:
接收模块,用于接收第二设备发送的第一连接证书和第一数字证书,第一连接证书为第二设备上存储的至少一个连接证书中的至少一个,一个连接证书基于两个根证书中有效期较早的根证书的私钥对两个根证书中有效期较晚的根证书的公钥进行签名得到,两个根证书为第二设备上存储的至少两个根证书中的任意两个,第一数字证书基于至少两个根证书中有效期最晚的根证书的私钥和第二设备的信息生成;
验证模块,用于基于第一设备信任的根证书和第一连接证书验证第一数字证书的合法性, 第一设备信任的根证书为至少两个根证书中的至少一个。
在一种可能的实现方式中,第一设备信任的根证书为至少两个根证书中的任意一个,装置还包括:第一发送模块,用于向第二设备发送第二数字证书,使第二设备验证第二数字证书的合法性,第二数字证书基于第一设备信任的根证书的私钥和第一设备的信息生成。
在一种可能的实现方式中,第一设备信任的根证书包括至少两个根证书中的至少两个,装置还包括:第二发送模块,用于向第二设备发送第二连接证书和第二数字证书,使第二设备验证第二数字证书的合法性,第二连接证书为第一设备信任的根证书对应的连接证书中的至少一个,第二数字证书基于第一设备信任的根证书中有效期最晚的根证书的私钥和第一设备的信息生成。
在一种可能的实现方式中,第一设备信任的根证书包括有效期最晚的根证书,接收模块,还用于在有效期最晚的根证书失效之前,且至少两个根证书中有效期非最晚的根证书失效之后,接收第二设备发送的第一数字证书;验证模块,还用于基于有效期最晚的根证书验证第一数字证书的合法性。
在一种可能的实现方式中,装置还包括:撤销模块,用于采用直接撤销的方式撤销第一设备信任的根证书中的至少一个证书,使被撤销的至少一个证书失效。
在一种可能的实现方式中,接收模块,还用于接收第二设备发送的应用场景信息;验证模块,还用于验证第一数字证书合法之后,确认应用场景信息正确。
在一种可能的实现方式中,第一设备满足参考条件,参考条件包括证书存储空间的容量大于容量阈值和具备根证书更新功能中的至少一个条件;或者,第一设备具备告警功能。
第六方面,提供了一种数字证书的验证装置,该装置应用于第一设备,装置包括:
接收模块,用于接收第二设备发送的第一连接证书、至少一个次级认证中心证书和第一数字证书,第一连接证书为第二设备上存储的至少一个连接证书中的至少一个,一个连接证书基于两个根证书中有效期较早的根证书的私钥对两个根证书中有效期较晚的根证书的公钥进行签名得到,两个根证书为第二设备上存储的至少两个根证书中的任意两个,第一数字证书基于至少两个根证书中有效期最晚的根证书的私钥、第二设备上存储的至少一个次级认证中心证书和第二设备的信息生成;
验证模块,用于基于第一设备信任的根证书、至少一个次级认证中心证书和第一连接证书验证第一数字证书的合法性,第一设备信任的根证书为至少两个根证书中的至少一个。
第七方面,提供了一种数字证书的验证装置,装置应用于第二设备,第二设备存储有有效的至少两个根证书、至少一个连接证书和第一数字证书,一个连接证书基于两个根证书中有效期较早的根证书的私钥对有效期较晚的根证书的公钥进行签名得到,两个根证书为至少两个根证书中的任意两个,第一数字证书基于至少两个根证书中有效期最晚的根证书的私钥和第二设备的信息生成,装置包括:
发送模块,用于向第一设备发送第一连接证书和第一数字证书,使第一设备验证第一数字证书的合法性,第一连接证书为至少一个连接证书中的至少一个,第一连接证书用于验证第一数字证书的合法性。
在一种可能的实现方式中,两个根证书为至少两个根证书中的任意两个有效期相邻的根证书。
在一种可能的实现方式中,装置还包括:查询模块,用于查询第一设备信任的根证书, 第一设备信任的根证书为至少两个根证书中的至少一个;选择模块,用于基于第一设备信任的根证书,从至少一个连接证书中选择得到第一连接证书,第一设备信任的根证书用于验证第一连接证书的合法性。
在一种可能的实现方式中,第一设备信任的根证书为至少两个根证书中的任意一个,装置还包括:第一验证模块,用于接收第一设备发送的第二数字证书,第二数字证书基于第一设备信任的根证书的私钥和第一设备的信息生成;基于第一设备信任的根证书验证第二数字证书的合法性。
在一种可能的实现方式中,第一设备信任的根证书包括至少两个根证书中的至少两个,装置还包括:第二验证模块,用于接收第一设备发送的第二连接证书和第二数字证书,第二连接证书为第一设备信任的根证书对应的连接证书中的至少一个,第二数字证书基于第一设备信任的根证书中有效期最晚的根证书的私钥和第一设备的信息生成;基于第一设备信任的根证书和第二连接证书验证第二数字证书的合法性。
在一种可能的实现方式中,第一设备信任的根证书包括有效期最晚的根证书,发送模块,还用于在有效期最晚的根证书失效之前,且至少两个根证书中有效期非最晚的根证书失效之后,向第一设备发送第一数字证书,使第一设备基于有效期最晚的根证书验证第一数字证书的合法性。
在一种可能的实现方式中,装置还包括:撤销模块,用于采用直接撤销的方式撤销至少两个根证书、至少一个连接证书和第一数字证书中的至少一个证书,使被撤销的至少一个证书失效。
在一种可能的实现方式中,发送模块,还用于向第一设备发送第二设备对应的应用场景信息,使第一设备验证第一数字证书合法之后,确认应用场景信息正确。
在一种可能的实现方式中,第二设备满足参考条件,参考条件包括证书存储空间的容量大于容量阈值和具备根证书更新功能中的至少一个条件;或者,第二设备具备告警功能。
在一些可能的实现方式中,第一设备用于基于第一设备信任的根证书和第一连接证书验证第一数字证书的合法性,第一设备信任的根证书为至少两个根证书中的至少一个。
第八方面,提供了一种数字证书的验证装置,装置应用于第二设备,第二设备存储有有效的至少两个根证书、至少一个次级认证中心证书、至少一个连接证书和第一数字证书,一个连接证书基于两个根证书中有效期较早的根证书的私钥对有效期较晚的根证书的公钥进行签名得到,两个根证书为至少两个根证书中的任意两个,第一数字证书基于至少两个根证书中有效期最晚的根证书的私钥、至少一个次级认证中心证书和第二设备的信息生成,装置包括:
发送模块,用于向第一设备发送第一连接证书、至少一个次级认证中心证书和第一数字证书,使第一设备验证第一数字证书的合法性,第一连接证书为至少一个连接证书中的至少一个,第一连接证书和至少一个次级认证中心证书用于验证第一数字证书的合法性。
第九方面,提供了一种数字证书的验证设备,设备包括网络接口、存储器及处理器;网络接口用于设备进行通信,存储器中存储有至少一条指令,至少一条指令由处理器加载并执行,以使设备实现上述各方面中的方法。
第十方面,提供了一种数字证书的验证系统,系统包括通信连接的第一设备和第二设备,第一设备用于实现第一方面中的数字证书的验证方法且第二设备用于实现第三方面中的数字 证书的验证方法,或者,第一设备用于实现第二方面中的数字证书的验证方法且第二设备用于实现第四方面中的数字证书的验证方法。
可选地,处理器为一个或多个,存储器为一个或多个。
可选地,存储器可以与处理器集成在一起,或者存储器与处理器分离设置。
第十一方面,提供了一种计算机程序(产品),计算机程序(产品)包括:计算机程序代码,当计算机程序代码被计算机运行时,使得计算机执行上述各方面中的方法。
第十二方面,提供了一种计算机可读存储介质,计算机可读存储介质存储程序或指令,当程序或指令在计算机上运行时,上述各方面中的方法被执行。
第十三方面,提供了一种芯片,包括处理器,用于从存储器中调用并运行存储器中存储的指令,使得安装有芯片的计算机执行上述各方面中的方法。
第十四方面,提供另一种芯片,包括:输入接口、输出接口、处理器和存储器,输入接口、输出接口、处理器以及存储器之间通过内部连接通路相连,处理器用于执行存储器中的代码,当代码被执行时,安装有芯片的计算机执行上述各方面中的方法。
附图说明
图1为本申请实施例提供的一种实施环境的示意图;
图2为本申请实施例提供的一种数字证书的验证方法的流程图;
图3为本申请实施例提供的一种证书关系的示意图;
图4为本申请实施例提供的另一种数字证书的验证方法的流程图;
图5为本申请实施例提供的一种数字证书的验证过程的示意图;
图6为本申请实施例提供的另一种数字证书的验证过程的示意图;
图7为本申请实施例提供的又一种数字证书的验证过程的示意图;
图8为本申请实施例提供的一种数字证书的验证装置的结构示意图;
图9为本申请实施例提供的另一种数字证书的验证装置的结构示意图;
图10为本申请实施例提供的又一种数字证书的验证装置的结构示意图;
图11为本申请实施例提供的再一种数字证书的验证装置的结构示意图;
图12为本申请实施例提供的一种数字证书的验证设备的结构示意图。
具体实施方式
本申请的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。
在ICT领域中,公钥基础设施(public key infrastructure,PKI)是保障通信安全的基础。PKI基于公钥密码学(public key cryptography,PKC)为设备分发数字证书(certificate),数字证书又称设备证书、业务证书等。在不同设备之间进行通信之前,需要互相验证对端设备的数字证书的合法性。
首先,对分发数字证书的过程进行说明。
根认证中心(root certification authority,RootCA)持有根证书和RootCA的私钥。根证书包括主题(subject)和RootCA的公钥,根证书的主题包括RootCA的相关信息,RootCA的公钥与RootCA的私钥相对应。RootCA也称为一级CA。
次级认证中心(subordinate certification authority,SubCA)向RootCA提交SubCA的相关信息和SubCA的公钥。不同的SubCA所提交的SubCA的相关信息不同,一个SubCA所提交的SubCA的公钥与该SubCA持有的私钥相对应。之后,RootCA使用RootCA的私钥按照一定的密码算法对SubCA的相关信息和SubCA的公钥进行签名,形成RootCA的签名。RootCA向SubCA下发SubCA证书,使得SubCA持有该SubCA证书。该SubCA证书包括主题、SubCA的公钥和RootCA的签名,SubCA证书的主题包括SubCA的相关信息。对于该SubCA证书,可以认为该SubCA证书由根证书签署得到。
设备向SubCA提交设备的相关信息和设备的公钥。不同的设备所提交的设备的相关信息不同,一个设备所提交的设备的公钥与该设备持有的私钥相对应。SubCA使用SubCA的私钥按照一定的密码算法对设备的相关信息和设备的公钥进行签名,形成SubCA的签名。之后,SubCA向设备下发数字证书,使得设备持有数字证书。该数字证书包括主题、设备的公钥和SubCA的签名,数字证书的主题包括设备的相关信息。对于该数字证书,可以认为该数字证书由SubCA证书签署得到。
基于以上说明的根证书、SubCA证书和数字证书可知,证书的签署是嵌套的。也即是,根证书签署得到SubCA证书,SubCA证书签署得到数字证书。根证书、SubCA证书和数字证书形成证书链。在一些实施方式中,SubCA包括多个级别,多个级别中最高级别的SubCA的SubCA证书由根证书签署得到。对于除最高级别之外的其他级别的SubCA的SubCA证书,则由上一个级别的SubCA的SubCA证书签署得到。而对于数字证书,则由最低级别的SubCA的SubCA证书签署得到。例如,SubCA包括二级CA和三级CA。则,根证书签署得到二级CA的SubCA证书,二级CA的SubCA证书签署得到三级CA的SubCA证书,三级CA的SubCA证书签署得到数字证书。当然,在一些实施方式中,可以不存在上述SubCA和SubCA证书,则根证书直接签署得到数字证书,根证书和数字证书形成证书链。
其次,对设备验证数字证书的过程进行说明。
对于一个设备而言,该设备需要信任至少一个根证书,设备信任的根证书为设备信任的RootCA持有的根证书。基于此,该设备信任所有基于所信任的根证书签署得到的证书。相应地,设备验证一个数字证书的合法性时,需要确定该数字证书所在的证书链中是否包括设备信任的根证书。换言之,在设备验证数字证书的过程中,需要从签署该数字证书的证书开始,追溯至根证书为止。如果追溯到的根证书即为设备信任的根证书,则设备可以信任该数字证书,或者说该数字证书合法,验证通过。如果追溯到的根证书不为设备信任的根证书,则设备不信任该数字证书,或者说该数字证书不合法,验证不通过。因此,验证数字证书的过程是依赖于根证书的。根证书是PKI能够保障通信安全的信任根基(anchor of trust)。
根据以上说明可知,数字证书可以由SubCA证书签署得到,也可以由根证书直接签署得到。在此,以数字证书由SubCA证书签署得到为例,说明验证数字证书的过程。
由于数字证书由SubCA证书签署得到,因而数字证书包括的签名应当是使用SubCA的私钥进行签名得到。因此,设备需要获得SubCA证书,以从SubCA证书中获得与该SubCA的私钥对应的SubCA的公钥,从而使用SubCA的公钥验证数字证书包括的签名。
在使用SubCA的公钥之前,设备需要对SubCA证书进行验证。设备获取设备信任的根证书,从根证书中获得RootCA的公钥。如果设备使用RootCA的公钥能够对SubCA证书包括的签名进行解密,则说明SubCA证书包括的签名确实是使用RootCA的私钥进行签名得到 的。因此,设备可以确定SubCA证书确实是设备信任的RootCA持有的根证书签署得到的证书,从而可以信任SubCA证书。
在信任SubCA证书之后,设备可以使用SubCA的公钥。如果设备使用SubCA的公钥能够对数字证书包括的签名进行解密,则说明数字证书包括的签名确实是使用SubCA的私钥进行签名得到,进而,设备可以确定数字证书确实是SubCA证书签署得到的证书。由于设备信任SubCA证书,因而设备也信任数字证书,也即是该数字证书通过设备的验证,该数字证书合法。
应理解的是,在SubCA包括多个级别的情况下,多个级别中最高级别的SubCA的SubCA证书的合法性由根证书验证。对于除最高级别之外的其他级别的SubCA的SubCA证书的合法性,则由上一个级别的SubCA的SubCA证书验证。而数字证书的合法性,则由最低级别的SubCA的SubCA证书验证。
接着,对根证书需要更新的原因进行说明。
如前所述,证书的签署是嵌套的,则SubCA证书的有效期不能超过根证书的有效期,而数字证书的有效期又不能超过SubCA证书的有效期。由于需要经常签署具有一定有效期的新的数字证书,因而不能在一个根证书的有效期结束之后(即,一个根证书失效、过期之后)再进行根证书的更新,而是需要提前进行根证书的更新,以保证数字证书的正常分发。比如,根证书的有效期为10年,SubCA证书的有效期为6年,数字证书的有效期为4年,则需要在根证书的有效期剩余4年之前,完成对根证书的更新。由此,才可以通过更新的根证书签署新的SubCA证书,再通过新的SubCA证书签署有效期为4年的新的数字证书。如果不在根证书的有效期剩余4年之前完成对根证书的更新,则无法正常签署有效期为4年的新的数字证书。类似的,在更新的根证书的有效期剩余4年之前,需要再次完成对根证书的更新,以此类推。
再有,对根证书更新的方式进行说明。
根证书的更新方式包括根证书延长(certificate updating)和引入新的根证书(certificate rekeying)。其中,根证书延长的方式仅延长根证书的有效期,不改变RootCA的公钥和RootCA的私钥,也不改变使用RootCA的私钥进行签名时的密码算法。而引入新的根证书的方式,则需要更新RootCA的公钥和RootCA的私钥,例如改变RootCA的公钥和RootCA的私钥的长度,还可以更新使用RootCA的私钥进行签名时的密码算法。
对于根证书延长的方式,虽然不改变RootCA的公钥、RootCA的私钥和密码算法,但也需要重新签署根证书,从证书管理角度来讲,并未简化管理成本。况且,延长根证书的有效期,意味着RootCA的公钥和RootCA的私钥将遭受更长时间的密码攻击,可能导致根证书的安全性一定程度的下降,不利于保证不同设备之间的通信安全。并且,根证书的有效期也不能无限延长,后续仍然需要采用引入新的根证书的方式。总之,根证书延长的方式仅适于临时更新根证书的场景,不能根本性的解决根证书更新的问题。
对于引入新的根证书的方式,可以在更新RootCA的公钥和RootCA的私钥时,根据密码分析的进展、相关监管机构与标准组织的要求增加密钥长度,还可以更新密码算法,增加了攻击难度。因此,保证了根证书的安全性,有利于保证不同设备之间的通信安全。因此,在对根证书进行更新时,往往会使用引入新的根证书的方式,以根本性的解决根证书更新的问题。
综合以上说明,由于不能在一个根证书的有效期结束之后再进行根证书的更新,而是需要提前进行根证书的更新,且进行根证书的更新时会使用引入新的根证书的方式,因而会产生至少两个根证书共存的情况。并且,需要通信的不同设备可能信任不同的根证书。如何在此种情况下验证数字证书的合法性,成为亟待解决的问题。
针对以上情况,本申请实施例提供了一种数字证书的验证方法,该方法可以应用于图1所示的实施环境中。如图1所示,该实施环境中包括通信连接的第一设备101和第二设备102。其中,第二设备102是具备上载功能和通信功能的设备。上载功能用于第二设备102接受管理设备的管理操作,以使得管理设备根据实际需要上载数字证书的验证方法中需要使用的各个证书。示例性地,管理设备包括但不限于服务器、控制器和网络管理系统等,在此不作限定。通信功能用于第一设备101与第二设备102进行交互。第一设备101是至少具备通信功能的设备。第一设备101可以具备上载功能,也可以不具备上载功能,在此不作限定。
基于以上图1所示的实施环境,本申请实施例提供了一种数字证书的验证方法,该方法通过第一设备与第二设备之间的交互过程实现。如图2所示,该方法包括如下的步骤201至步骤203。
步骤201,第二设备向第一设备发送第一连接证书和第一数字证书。
其中,第二设备存储有有效的至少两个根证书、至少一个连接(link)证书以及第一数字证书。由于至少两个根证书是有效的,因而第二设备执行步骤201的时刻,处于至少两个根证书的有效期的交集之内。第二设备向第一设备发送的第一连接证书为至少一个连接证书中的至少一个,该第一连接证书用于验证第一数字证书的合法性。示例性地,第二设备通过上载过程获得这些证书。例如,上载过程可以在第二设备执行步骤201之前完成,则第二设备对这些证书进行存储,在执行步骤201时读取存储的证书。在此,不对上载过程的完成时机进行限定。
接下来,对第二设备存储的至少两个根证书、至少一个连接证书和第一数字证书分别进行说明。
至少两个根证书:为第二设备信任的根证书。
在至少两个根证书中,不同根证书的有效期不同。因此,从至少两个根证书中任选两个根证书,这两个根证书会包括一个有效期较早的根证书和一个有效期较晚的根证书。其中,根证书的有效期对应有开始时刻和结束时刻。示例性地,在有效期较早的根证书和有效期较晚的根证书中,有效期较早的根证书的有效期对应的开始时刻,早于有效期较晚的根证书的有效期对应的开始时刻。并且,有效期较早的根证书的有效期对应的结束时刻,早于有效期较晚的根证书的有效期对应的结束时刻。例如,有效期较早的根证书的有效期为第1年年初至第2年年末,有效期较晚的根证书的有效期为第2年年初至第4年年末。
示例性地,一个根证书可以称为“第n代”根证书,表示为Gn根证书。其中,n为大于或者等于1的正整数,且n的取值的上限等于根证书的数量N,N为大于或者等于2的正整数。根证书的有效期越早则n的取值越小。比如,参见图3,根证书的数量为3个,有效期最早的根证书称为“第1代”根证书并表示为G1根证书,有效期次早的根证书称为“第2代”根证书并表示为G2根证书,有效期最晚的根证书称为“第3代”根证书并表示为G3根证书。示例性地,一个第二设备可以称为“第n’代”设备,表示为Gn’代设备。其中,n’的取值与第二设备信任的有效期最晚的根证书对应的n的取值相同。例如,第二设备信任的有效期最晚的根证书 为G3根证书,则第二设备可以称为“第3代”设备,表示为G3设备。
至少一个连接证书:一个连接证书基于两个根证书中有效期较早的根证书的私钥对有效期较晚的根证书的公钥进行签名得到,两个根证书为至少两个根证书中的任意两个。
其中,一个根证书的公钥即为该根证书包括的公钥,根证书的私钥为根证书包括的公钥对应的私钥。示例性地,通过有效期较早的根证书的私钥,对有效期较晚的根证书的主题和有效期较晚的根证书的公钥进行签名,得到有效期较早的根证书的签名。由此,可以生成连接证书,该连接证书包括:有效期较晚的根证书的主题、有效期较晚的根证书的公钥和该有效期较早的根证书的签名。其中,将有效期较早的根证书表示为旧(old)根证书,将有效期较晚的根证书表示为新(new)根证书,则生成的连接证书表示为NewWithOld连接证书,即用旧根证书的私钥对新根证书的公钥进行签名得到的连接证书。
对于一个连接证书而言,由于在生成该连接证书时使用了有效期较早的根证书的私钥进行签名,因而可以将该连接证书看作是有效期较早的根证书签署得到的证书。相应地,在验证该连接证书的合法性时,也需要使用该有效期较早的根证书。并且,由于该连接证书包括有效期较晚的根证书的主题和有效期较晚的根证书的公钥,因而由有效期较晚的根证书签署得到的证书,可以看作是由该连接证书签署得到的证书。相应地,如果一个证书的合法性能够被有效期较晚的根证书验证,则该证书的合法性也能够被该连接证书和有效期较早的根证书验证。
示例性地,一个连接证书可以表示为GxGy连接证书。x为两个根证书中有效期较早的根证书对应的n的取值,y的取值为两个根证书中有效期较晚的根证书对应的n的取值。例如,参见图3,一个连接证书基于G1根证书的私钥对G2根证书的私钥进行签名得到,则该连接证书表示为G1G2连接证书。G1G2连接证书可以看作是G1根证书签署的证书。而对于由G2根证书签署的证书,可以看作是由G1G2连接证书签署的证书。对于图3中示出的G2G3连接证书和G3G4连接证书,在此不再赘述。
在一些实施方式中,两个根证书为至少两个根证书中的任意两个根证书。也即是,至少一个根证书中的每两个根证书用于生成一个连接证书。当根证书的数量为N时,连接证书的数量为(N2-N)/2。例如,根证书包括G1根证书、G2根证书和G3根证书。G1根证书的私钥对G2根证书的公钥进行签名,得到G1G2连接证书。G2根证书的私钥对G3根证书的公钥进行签名,得到G2G3连接证书。G1根证书的私钥对G3根证书的公钥进行签名,得到G1G3连接证书。共得到3个连接证书。
示例性地,两个根证书为至少两个根证书中的任意两个有效期相邻的根证书。也即是,至少一个根证书中的每两个有效期相邻的根证书用于生成一个连接证书。当根证书的数量为N时,连接证书的数量为(N-1)。仍以根证书包括G1根证书、G2根证书和G3根证书为例,G1根证书的私钥对G2根证书的公钥进行签名,得到G1G2连接证书,G2根证书的私钥对G3根证书的公钥进行签名,得到G2G3连接证书。共得到2个连接证书。
第一数字证书:基于第二设备信任的至少两个根证书中有效期最晚的根证书的私钥和第二设备的信息生成。
其中,第二设备的信息包括但不限于第二设备的相关信息和第二设备的公钥。有效期最晚的根证书的私钥对第二设备的相关信息和第二设备的公钥进行签名,得到有效期最晚的根证书的签名。由此,可以生成第一数字证书,第一数字证书包括主题、第二设备的公钥和有 效期最晚的根证书的签名,主题即为第二设备的相关信息。示例性地,第一数字证书为有效期最晚的根证书签署的证书,第一数字证书的合法性由有效期最晚的根证书验证。示例性地,根据上文说明可知根证书表示为Gn根证书,则由Gn根证书签署得到的第一数字证书表示为Gn数字证书。例如,参见图3,G3根证书可以签署得到G3数字证书。
以上,对第二设备存储的至少两个根证书、至少一个连接证书和第一数字证书分别进行了说明。下面,基于以上说明的至少一个连接证书,进一步对第一连接证书进行说明。在示例性实施例中,第一连接证书包括如下的情况A1和情况A2。
情况A1,第一连接证书为基于第一设备信任的根证书从至少一个连接证书中选择得到的证书。
在情况A1中,第二设备执行步骤201之前,方法还包括:第二设备查询第一设备信任的根证书,第一设备信任的根证书为第二设备存储的至少两个根证书中的至少一个。第二设备基于第一设备信任的根证书,从至少一个连接证书中选择得到第一连接证书,第一设备信任的根证书用于验证第一连接证书的合法性。
示例性地,第二设备与第一设备进行通信,以查询第一设备信任的根证书。或者,管理设备存储有第一设备信任的根证书,第二设备与管理设备进行通信,以查询第一设备信任的根证书。第二设备也可以通过其他方式查询第一设备信任的根证书,在此不作限定。
在查询到第一设备信任的根证书之后,第二设备从至少一个连接证书中选择第一连接证书。示例性地,第二设备选择第一连接证书的方式包括如下的情况A11和情况A12。
情况A11,第一设备信任的根证书的数量为一个。
在情况A11中,第二设备在至少一个连接证书中,将基于参考根证书生成的连接证书确定为第一连接证书。其中,参考根证书的有效期不早于第一设备信任的根证书的有效期,且不晚于有效期最晚的根证书的有效期。
例如,第一设备信任的根证书为G1根证书,有效期最晚的根证书为G3根证书,则参考根证书包括G1根证书、G2根证书和G3根证书。在每两个根证书用于生成一个连接证书的情况下,基于参考根证书生成的连接证书包括G1G2连接证书、G2G3连接证书和G1G3连接证书。而在每两个有效期相邻的根证书用于生成一个连接证书的情况下,基于参考根证书生成的连接证书,包括G1G2连接证书和G2G3连接证书。
示例性地,将基于参考根证书生成的连接证书中的部分或全部连接证书确定为第一连接证书,在此不作限定,只要保证第一连接证书能够用于验证第一数字证书的合法性,且第一设备信任的根证书能够用于验证第一连接证书的合法性即可。例如,在基于参考根证书生成的连接证书包括G1G2连接证书、G2G3连接证书和G1G3连接证书的情况下,可以将G1G2连接证书和G2G3连接证书作为第一连接证书。或者,也可以将G1G3连接证书作为第一连接证书。又或者,可以将G1G2连接证书、G2G3连接证书和G1G3连接证书均作为第一连接证书。
示例性地,对于第一设备信任的根证书仅为有效期最晚的根证书的情况,第二设备可以直接向第一设备发送第一数字证书,第二设备无需发送第一连接证书。
情况A12,第一设备信任的根证书的数量为至少两个。
在一些实施方式中,针对第一设备信任的每个根证书,第二设备均按照情况A1确定该根证书对应的连接证书。之后,对各个根证书对应的连接证书进行合并去重,将合并去重后 的连接证书确定为第一连接证书。例如,第一设备信任的根证书包括G1根证书和G2根证书,第二设备信任的有效期最晚的根证书为G3根证书。则,第二设备按照情况A1确定G1根证书对应的连接证书包括G1G2连接证书、G2G3连接证书和G1G3连接证书,第二设备按照情况A1确定G2根证书对应的连接证书包括G2G3连接证书。通过合并去重的过程,去除重复出现的G2G3连接证书,从而得到第一连接证书,该第一连接证书包括G1G2连接证书、G2G3连接证书和G1G3连接证书。
在另一些实施方式中,第二设备从第一设备信任的至少两个根证书中选择一个根证书,按照情况A1确定所选择的根证书对应的连接证书,将所选择的根证书对应的连接证书确定为第一连接证书。示例性地,第二设备选择的根证书,为第一设备信任的至少两个根证书中与有效期最晚的根证书的有效期最接近的根证书。例如,第一设备信任的根证书包括G1根证书和G2根证书,第二设备存储的有效期最晚的根证书为G3根证书,则第二设备选择从G1根证书和G2根证书中,选择与G3根证书的有效期更为接近的G2根证书,而不选择G1根证书。之后,第二设备按照情况A1确定G2根证书对应的连接证书为G2G3连接证书,从而得到第一连接证书为G2G3连接证书。当然,第二设备也可以从第一设备信任的至少两个根证书中随机进行选择,在此不作限定。
示例性地,包括上述情况A11和情况A12的情况A1,适用于允许第二设备查询第一设备信任的根证书的场景,此种场景包括但不限于传输层安全(transport layer security,TLS)1.2的高级版本、TLS 1.3等等。示例性地,此种场景下第一设备向第二设备发送信任中心列表(list of trusted authorities),第二设备基于信任中心列表确定第一设备信任的根证书。
此外,由于情况A1中第二设备需要基于第一设备信任的根证书从至少一个连接证书中选择得到第一连接证书,因而需要第二设备具备较强的证书管理能力,较强的证书管理能力用于第二设备实现连接证书的选择及发送。并且,正是由于情况A1中进行了查询及选择,因而相比于将全部的连接证书作为第一连接证书的方式(也即如下的情况A2),情况A1中第一连接证书包括的证书数量较少,第二设备向第一设备发送第一连接证书所需的传输资源较少,适用于传输资源紧张的场景。
情况A2,第一连接证书为全部的连接证书。
此种情况下,第二设备无需查询第一设备信任的根证书,直接将全部的连接证书作为第一连接证书即可。
示例性地,情况A2适用于不允许第二设备查询第一设备信任的根证书的场景,此种场景包括但不限于开放式安全套接层协议(open secure sockets layer,OpenSSL)。当然,情况A2也适用于允许第二设备查询第一设备信任的根证书的场景,详见上文情况A1中的说明,在此不再赘述。相比于情况A1,情况A2中第二设备无需基于第一设备信任的根证书从至少一个连接证书中选择得到第一连接证书,因而第二设备无需具备较强的证书管理能力。
以上说明的情况A1和情况A2仅为第一连接证书的两种示例性情况,不用于对第一连接证书造成限定。总之,第二设备需要向第一设备发送第一连接证书和第一数字证书。
步骤202,第一设备接收第二设备发送的第一连接证书和第一数字证书。
由于第二设备向第一设备发送了第一连接证书和第一数字证书,因而第一设备相应的接收第二设备发送的第一连接证书和第一数字证书。
步骤203,第一设备基于第一设备信任的根证书和第一连接证书验证第一数字证书的合 法性。
其中,第一设备信任的根证书是第一设备已经获得的根证书,或者说第一设备在接收到第一连接证书和第一数字证书之前,已经存储有该第一设备信任的根证书,第一设备无需通过额外的上载过程获得这些根证书。例如,第一设备信任的根证书在生产第一设备时,或是第一设备入网使用之前已经预置于第一设备中。本申请实施例不对第一设备获得第一设备信任的根证书的方式进行限定。此外,如前所述,第一设备信任的根证书为第二设备存储的至少两个根证书中的至少一个。
在一些实施方式中,第一设备首先通过第一设备信任的根证书验证第一连接证书的合法性,即,确认通过第一设备信任的根证书的公钥是否能够对第一连接证书包括的签名进行解密。在验证第一连接证书合法之后,通过第一连接证书验证第一数字证书的合法性,即,确认通过第一连接证书包括的公钥是否能够对第一数字证书包括的签名进行解密。
示例性地,通过第一连接证书验证第一数字证书的合法性,包括:第一设备基于第一设备信任的根证书,从第一连接证书中确定至少一组备选连接证书,每组备选连接证书包括第一连接证书中的至少一个。第一设备将包括的证书数量最少的一组备选连接证书确定为目标连接证书,通过第一设备信任的根证书验证目标连接证书的合法性。如果该目标连接证书合法,再通过目标连接证书验证第一数字证书的合法性。
例如,第一设备信任的根证书为G1根证书,第二设备信任的有效期最晚的根证书为G3根证书,第一连接证书包括G1G2连接证书、G2G3连接证书和G1G3连接证书。则第一设备确定第一组备选连接证书为G1G3连接证书,确定第二组备选连接证书为G1G2连接证书和G2G3连接证书。由于第一组备选连接证书包括的证书数量较少,仅为一个,因而第一设备将第一组备选连接证书确定为目标连接证书。之后,第一设备先通过G1根证书验证G1G3连接证书的合法性,再通过G1G3连接证书验证第一数字证书的合法性。
其中,由于第一设备选择了证书数量最少的一组备选连接证书作为目标连接证书,因而第一设备在验证第一数字证书的合法性的过程中,组建了最短证书链,该最短证书链包括第一设备信任的根证书、目标连接证书和第一数字证书。示例性地,此种方式适用于OpenSSL的部分版本,以及Java开发工具包(Java development kit,JDK)8或更高版本。例如,在OpenSSL的1.0.2u版本中,在开启了X509_V_FLAG_TRUSTED_FIRST选项的情况下默认采用此种方式。在OpenSSL的1.1.1g版本中,直接默认采用此种方式。
如果第一设备验证第一数字证书合法,第一设备便可以基于该第一数字证书与第二设备进行通信。例如,第二设备向第一设备发送通过第二设备的私钥加密后的信息,第一设备可以使用第一数字证书包括的第二设备的公钥对该信息进行解密,从而实现与第二设备之间的安全通信。
如果第一设备验证第一数字证书不合法,则第一设备可以直接确定对第一数字证书的验证失败,则不与第二设备进行通信。或者,示例性地,第一设备还可以遍历其他各组备选连接证书,通过其他各组备选连接证书分别验证第一数字证书的合法性。如果通过每组备选连接证书均验证第一数字证书不合法,再确定第一数字证书不合法,第一设备不与该第二设备进行通信。
示例性地,在第一设备信任的根证书仅包括有效期最晚的根证书的情况下,第一设备也可以不使用第一连接证书,直接通过第一设备信任的根证书,也即是有效期最晚的根证书, 验证第一数字证书的合法性。
需要说明的是,当第一设备不使用第一连接证书、直接使用第一设备信任的根证书验证第一数字证书时,第一设备的可验证级数为2,包括根证书和第一数字证书。而当第一设备基于第一设备信任的根证书和第一连接证书共同完成数字证书的验证时,第一设备的可验证级数至少为3,包括根证书、第一连接证书和第一数字证书。如果第一设备使用的第一连接证书的数量为多个,则第一设备的可验证级数为4或者更多。因此,在应用本申请实施例时,需要保证第一设备具备较高的可验证级数。换言之,相比于不使用第一连接证书的验证方式,本申请实施例中第一设备所具有的可验证级数至少需要增加一级。
当然,本申请实施例并不需要在应用本申请实施例提供的数字证书的验证方法时再对第一设备进行改造,而是可以在第一设备制造或入网使用时,就为第一设备配置较高的可验证级数,由此可以在不对第一设备进行改造的情况下,使得第一设备执行本申请实施例提供的数字证书的验证方法。
根据第一设备验证第一数字证书的合法性的过程可知,第一设备仅使用第一设备信任的根证书和第二设备发送的第一连接证书,即可实现对第一数字证书的验证。因此,第一设备无需额外上载其他证书。并且,第二设备与第一设备之间无需确认对端设备信任的证书,因而验证第一数字证书的过程对于第一设备而言是透明无感的,第一设备无需感知至少两个根证书共存的情况。因此,本申请实施例提供的数字证书的验证方法,本质上自动兼容了第一设备,无需对第一设备进行改进。
正是由于本申请实施例中第一设备无需额外上载其他证书,也无需感知至少两个根证书共存的情况,因而本申请实施例提供的数字证书的验证方法应用范围较广。其中,该方法所适用的场景包括但不限于:第一设备无法上载的场景、第一设备上载困难或者缓慢的场景、第一设备无法感知至少两个根证书共存的情况的场景,等等。并且,本申请实施例提供的数字证书的验证方法也较为简单,降低了根证书的更新过程中验证数字证书的复杂度,减少了验证成本。
以上内容,是针对步骤201至步骤203的说明。可以看出,步骤201至步骤203为第一设备验证第二设备的第一数字证书的过程。示例性地,在第二设备存储有有效的至少两个根证书、至少一个连接证书和第一数字证书的情况下,第二设备也可以验证第一设备的第二数字证书的合法性。示例性地,第二设备验证第二数字证书,包括但不限于如下的情况B1和情况B2。
情况B1,第一设备信任的根证书为至少两个根证书中的任意一个,则方法还包括:第一设备向第二设备发送第二数字证书,第二数字证书基于第一设备信任的根证书的私钥和第一设备的信息生成。第二设备接收第一设备发送的第二数字证书,第二设备基于第一设备信任的根证书验证第二数字证书的合法性。
其中,第一设备的信息可参见上文针对第二设备的信息的说明,第二数字证书可参见上文对于第一数字证书的说明,在此不再赘述。
由于第一设备信任的根证书为至少两个根证书中的任意一个,而生成一个连接证书需要两个根证书,因而第一设备仅会向第二设备发送第二数字证书,而不会向第二设备发送连接证书。因此,第二设备在接收到第一设备发送的第二数字证书时,可以直接通过第一设备信任的根证书验证第二数字证书的合法性。其中,验证方式参见上文步骤203中第一设备验证 第一数字证书的方式,此处不再进行赘述。
情况B2,第一设备信任的根证书为至少两个根证书中的至少两个,方法还包括:第一设备向第二设备发送第二连接证书和第二数字证书,第二连接证书为第一设备信任的根证书对应的连接证书中的至少一个,第二数字证书基于第一设备信任的根证书中有效期最晚的根证书的私钥和第一设备的信息生成。第二设备接收第一设备发送的第二连接证书和第二数字证书,第二设备基于第一设备信任的根证书和第二连接证书验证第二数字证书。
由于第一设备信任的根证书为至少两个,因而基于第一设备信任的根证书可以生成连接证书,所生成的连接证书即为第一设备信任的根证书对应的连接证书。基于所生成的连接证书可以确定第二连接证书。其中,基于第一设备信任的根证书生成连接证书的方式参见上文步骤201中对至少一个连接证书的说明,基于所生成的连接证书确定第二连接证书的方式参见上文步骤201中第二设备选择得到第一连接证书的方式,在此均不再赘述。
在第二设备接收第一设备发送的第二连接证书和第二数字证书之后,第二设备基于第一设备信任的根证书和第二连接证书验证第二数字证书的合法性。其中,验证方式参见上文步骤203中第一设备验证第一数字证书的方式,此处不再进行赘述。
在一些实施方式中,第二设备采用双存储区对证书进行分隔存储。示例性地,双存储区包括第一存储区和第二存储区。其中,第一存储区用于存储需要向第一设备发送的证书,包括但不限于上述至少一个连接证书和第一数字证书。第二存储器用于存储第一设备发送的证书,包括但不限于上述第二连接证书和第二数字证书。由此,在第二设备需要向第一设备发送证书时,仅需读取第一存储区。而在第二设备需要验证第一设备发送的证书时,仅需读取第二存储区。
示例性地,采用双存储区对证书进行分隔存储的方式,所适用的场景包括但不限于OpenSSL的1.0.2版本和JDK8。例如,在OpenSSL的1.0.2版本中,将chainCApath指定为上述第一存储区,将verifyCApath指定为上述第二存储区。又例如,在JDK8中,将KeyStore指定为上述第一存储区,将TrustStore指定为上述第二存储区。
类似的,第一设备也可以采用双存储区,其中一个存储区用于存储需要向第二设备发送的证书,例如上述第一设备信任的根证书对应的连接证书和第二数字证书。另一个存储区用于存储第二设备发送的证书,例如上述第一连接证书和第一数字证书。由此,实现了证书的分隔存储。在此不再赘述。
此外,随着时间的变化,有效的至少两个根证书中可能有部分根证书失效。例如,有效期最晚的根证书失效之前,且至少两个根证书中有效期非最晚的根证书失效之后,有效的根证书仅为有效期最晚的根证书。此种情况下,方法还包括:第二设备向第一设备发送第一数字证书,第一设备接收第二设备发送的第一数字证书,第一设备基于有效期最晚的根证书验证第一数字证书。其中,第一设备信任的根证书包括有效期最晚的根证书。
由于至少两个根证书中有效期非最晚的根证书失效,因而第二设备存储的至少一个连接证书也已失效,第二设备和第一设备均仅信任有效期最晚的根证书。因此,第二设备无需再发送第一连接证书,而是直接向第一设备发送第一数字证书,第一设备便可以通过有效期最晚的根证书验证该第一数字证书。类似的,第一设备也可以直接向第二设备发送第二数字证书,第二设备可以通过有效期最晚的根证书验证该第一数字证书。
在示例性实施例中,方法还包括:第二设备采用直接撤销的方式撤销至少两个根证书、 至少一个连接证书和第一数字证书中的至少一个证书,使被撤销的至少一个证书失效。
其中,证书撤销(certificate revocation)又称证书吊销,如果在证书的有效期结束之前,需要提前使得证书失效,则需要进行证书撤销。请求评议(request for comments,RFC)5280描述了两种撤销方式:直接撤销和间接撤销。其中,间接撤销方式不具有普适性,可能不适用于OpenSSL、TLS和红帽产品(red hat products)等软件。因此,示例性地,本申请实施例采用直接撤销方式进行证书撤销。
在直接撤销方式中,一个证书由谁签署得到,则该证书由谁进行撤销。换言之,RootCA签署过哪些证书,则RootCA对哪些证书进行撤销。示例性地,通过签署证书撤销列表(certificate revocation lists,CRLs)进行证书撤销。CRLs的签署者与CRLs包括的各个证书的签署者相同。
此外,对于至少两个根证书有效的情况,在引入有效最晚的根证书之后,有效期非最晚的根证书的私钥可以直接销毁或封存。或者,有效期非最晚的根证书的私钥也可以暂不销毁或封存,而是继续使用该私钥签署上述CRLs。当然,该私钥不再用于签署新的证书。由此,通过限制和加强管理的方式保障了私钥的安全性。
示例性地,第一设备也可以采用直接撤销的方式撤销第一设备信任的根证书中的至少一个证书,使被撤销的至少一个证书失效。在此不再赘述。
在示例性实施例中,第二设备满足参考条件,参考条件包括证书存储空间的容量大于容量阈值和具备根证书更新功能中的至少一个条件;或者,第二设备具备告警功能。
通过使得第二设备满足参考条件,可避免根证书紧急更新(例如在检测到根证书的私钥不够安全甚至发生泄漏时需要紧急更新根证书)、切换新的密码体系(例如切换至后量子密码算法)等情况导致第二设备中的证书存储空间容量不足的问题。此外,第二设备可以进行告警,以向用户提供应对策略。例如,提示用户及时使用其他设备替换第二设备,从而保证通信业务的连续性。由此,能够提高第二设备的密码敏捷性(cryptographic agility),适用于第二设备为安全敏感设备(security critical equipment)的情况。示例性地,第二设备可以在第二设备不满足参考条件的情况下进行告警。
示例性地,第一设备满足上述参考条件,或者,第一设备具备告警功能。在此,不再对参考条件和告警功能进行赘述。
在示例性实施例中,方法还包括:第二设备向第一设备发送第二设备对应的应用场景信息。第一设备接收第二设备发送的应用场景信息,第一设备验证第一数字证书合法之后,确认应用场景信息正确。
在一些实施方式中,应用场景为代码签名PKI系统,相应地,应用场景信息为需要发布的代码、补丁或安装包。则第一设备验证第一数字证书合法之后,可以确认需要代码、补丁或安装包正确,从而可以使用代码、补丁或安装包。示例性地,此种应用场景下,第二设备通过(cryptographic message syntax,CMS)方式向第一设备发送第一连接证书、第一数字证书以及上述代码、补丁或安装包。其中,CMS方式允许携带上述第一连接证书和第一数字证书,以便第一设备按照上述方式验证第一数字证书的合法性。当然,如果第一设备能够通过其他途径获取上述第一连接证书和第一数字证书,CMS方式也允许不携带这些证书。
在示例性实施例中,第一设备应尽量支持较多数量的密码算法和密钥长度,以保证第一连接证书和第一数字证书采用了新的密码算法和密钥长度的情况下,数字证书的验证过程仍 能够正常进行。示例性地,第一设备支持的算法包括但不限于:李维斯特-萨莫尔-阿德曼(Rivest-Shamir-Adleman,RSA)-公钥密码学标准(public-key cryptography standards,PKCS)的各个版本、RSA-概率签名方案(probabilistic signature scheme,PSS)、椭圆曲线数字签名算法(elliptic curve digital signature algorithm,ECDSA)等。第一设备支持的密钥长度包括但不限于:RSA 2048、RSA 3072、RSA 4096或以上,以及,ECDSA 256、ECDSA 384、ECDSA 512等等。
在另一些实施方式中,应用场景为时间戳PKI系统,相应地,应用场景信息为时间戳(timestamp)。则第一设备验证第一数字证书合法之后,确认时间戳正确,可以将该时间戳嵌入第一设备的相关数据中使用。其中,该时间戳可以是时间戳机构随机生成的时间戳,此种时间戳可以被包括第一设备在内的各个设备使用。或者,该时间戳也可以是时间戳机构根据第一设备的请求向第一设备下发的时间戳,此种时间戳仅由第一设备使用。在此不作限定。
此外,本申请实施例提供的数字证书的验证方案还可以与其他类型的设备相结合,形成混合架构,从而进一步扩大适用范围,增加系统的冗余度和灵活性。
例如,可以增加第三设备,该第三设备存储有至少两个根证书和第三数字证书,第三数字证书基于有效期最晚的根证书的私钥和第三设备的信息生成,该第三设备未存储至少一个连接证书。本申请实施例提供的第二设备可以向该第三设备发送第一连接证书和第一数字证书,以由第三设备验证第一数字证书的合法性。本申请实施例提供的第二设备还可以接收第三设备发送的第三数字证书,以验证该第三数字证书的合法性。其中,在有效期最晚的根证书失效之前和之后,该第三设备均发送第三数字证书,而无需切换所发送的证书,从而减少了对业务的干扰。
又例如,可以增加第四设备,该第四设备存储有至少两个根证书和第四数字证书,第四数字证书基于有效期最早的根证书的私钥和第四设备的信息生成。本申请实施例提供的第二设备可以向该第四设备发送第一连接证书和第一数字证书,以由第四设备验证第一数字证书的合法性。本申请实施例提供的第一设备可以向该第四设备发送第二数字证书,或者发送第二连接证书和第二数字证书,以由第四设备验证第二数字证书的合法性。本申请实施例提供的第二设备还可以接收第四设备发送的第四数字证书,以验证该第四数字证书的合法性。如果本申请实施例提供的第一设备信任的根证书包括有效期最早的根证书,则第一设备也可以接收并验证第四设备发送的第四数字证书的合法性。
此外,第三设备与第四设备之间也可以进行交互。第四设备可以接收并验证第三设备发送的第三数字证书的合法性。第三设备也可以接收并验证第四设备发送的第四数字证书的合法性。
此外,本申请实施例还提供了一种数字证书的验证方法,通过第一设备和第二设备之间的交互实现。如图4所示,该方法包括如下的步骤401至403。
步骤401,第二设备向第一设备发送第一连接证书、至少一个SubCA证书和第一数字证书。
其中,第二设备存储有有效的至少两个根证书、至少一个SubCA证书、至少一个连接证书和第一数字证书。至少两个根证书、至少一个连接证书和第一连接证书参见上文图2所示的方法实施例对应的说明,在此不再赘述。
对于第一数字证书,第一数字证书基于至少一个SubCA证书的私钥对第二设备的信息进 行签名得到,至少一个SubCA证书基于有效期最晚的根证书的私钥对SubCA的信息进行签名得到。示例性地,当SubCA包括多个级别时,多个级别中最高级别的SubCA的SubCA证书由根证书签署得到。除最高级别之外的其他级别的SubCA的SubCA证书,则由上一个级别的SubCA的SubCA证书签署得到。数字证书由最低级别的SubCA的SubCA证书签署得到。示例性地,由Gn根证书签署得到的SubCA证书表示为GnSubCA证书。例如,参见图3,以仅包括一个级别的SubCA为例,G3根证书签署得到G3SubCA证书,G3SubCA证书签署得到G3数字证书。
步骤402,第一设备接收第二设备发送的第一连接证书、至少一个SubCA证书和第一数字证书。
由于第二设备执行了上述步骤401,因而第一设备相应的接收第二设备发送的第一连接证书、至少一个SubCA证书和第一数字证书。
步骤403,第一设备基于第一设备信任的根证书、至少一个SubCA证书和第一连接证书验证第一数字证书的合法性。
其中,第一设备首先通过第一设备信任的根证书验证第一连接证书的合法性,即,确认通过第一设备信任的根证书的公钥是否能够对第一连接证书包括的签名进行解密。在验证第一连接证书合法之后,通过第一连接证书验证至少一个SubCA证书的合法性,即确认通过第一数字证书包括的公钥是否能够对至少一个SubCA包括的签名进行解密。在验证至少一个SubCA证书合法之后,通过至少一个SubCA证书验证第一数字证书的合法性,即,确认通过至少一个SubCA证书包括的公钥是否能够对第一数字证书包括的签名进行解密。应理解的是,在SubCA包括多个级别的情况下,通过第一连接证书验证的是最高级别的SubCA的SubCA证书的合法性,而第一数字证书的合法性由最低级别的SubCA的SubCA证书验证,在此不再赘述。
需要说明的是,上述步骤203说明了第一设备基于第一设备信任的根证书和第一连接证书验证第一数字证书的合法性的过程。步骤203中说明的内容如可适用于此处的步骤403,也以引用的方式包含于此。
接下来,以根证书包括G1根证书和G2根证书为例,举例说明数字证书的验证过程。示例性地,验证过程包括如下的情况C1至情况C3。
情况C1,如图5所示,设备A为新的G2设备,信任G1根证书、G2根证书、G1G2连接证书、G2根证书签署的G2SubCA证书和G2SubCA证书签署的G2数字证书A。设备B为旧的G1设备,信任G1根证书、G1根证书签署的G1SubCA证书和G1SubCA证书签署的G1数字证书B。在情况C1中,设备A对应上文的第二设备,设备B对应上文的第一设备,且第一设备信任的根证书为有效期最早的根证书。
G1根证书失效之前,设备A向设备B发送G1G2连接证书、G2SubCA证书和G2数字证书A,设备B按照G1根证书、G1G2连接证书、G2SubCA证书和G2数字证书A的顺序进行验证;
G1根证书失效之前,设备B向设备A发送G1SubCA证书和G1数字证书B,设备A通过G1根证书、G1SubCA证书和G1数字证书B的顺序进行验证;
G1根证书失效之后,设备B停止运作并下线,设备A与设备B不再交互。
情况C2,如图6所示,设备A同情况C1中的设备A,设备B也为新的G2设备,信任 G1根证书、G2根证书、G1G2连接证书、G2SubCA证书和G2数字证书B。在情况C2中,设备A对应上文的第二设备,设备B对应上文的第一设备,且第一设备信任的根证书为有效期最晚的根证书。
G1根证书失效之前,设备A向设备B发送G1G2连接证书、G2SubCA证书和G2数字证书A,设备B按照G1根证书、G1G2连接证书、G2SubCA证书和G2数字证书A的顺序进行验证;
G1根证书失效之前,设备B向设备A发送G1G2连接证书、G2SubCA证书和G2数字证书B,设备A按照G1根证书、G1G2连接证书、G2SubCA证书和G2数字证书B的顺序进行验证;
G1根证书失效之后,设备A向设备B发送G2SubCA证书和G2数字证书A,设备B按照G2根证书、G2SubCA证书和G2数字证书A的顺序进行验证;
G1根证书失效之后,设备B向设备A发送G2SubCA证书和G2数字证书B,设备A按照G2根证书、G2SubCA证书和G2数字证书B的顺序进行验证。
情况C3,如图7所示,设备A为旧的G1设备,信任G1根证书、G1SubCA证书和G1SubCA证书签署的G1数字证书A,设备B同情况C1中设备B。在情况C1中,设备A和设备B均对应上文的第一设备,且第一设备信任的根证书为有效期最早的根证书。
G1根证书失效之前,设备A向设备B发送G1SubCA证书和G1数字证书A,设备B通过G1根证书、G1SubCA证书和G1数字证书A的顺序进行验证;
G1根证书失效之前,设备B向设备A发送G1SubCA证书和G1数字证书B,设备A通过G1根证书、G1SubCA证书和G1数字证书B的顺序进行验证;
G1根证书失效之后,设备A和设备B均停止运作并下线,设备A与设备B不再交互。
作为总结,新设备(情况C1中的设备A、情况C2中的设备A和设备B)与旧设备(情况C1中的设备B、情况C3中的设备A和设备B)之间无需确认对端设备信任的根证书。对于新设备,在G1根证书失效之前,均发送G1G2连接证书、G2SubCA证书和G2SubCA证书签署的数字证书,且在G1根证书失效之后,均不再发送G1G2连接证书,而是发送G2SubCA证书和G2SubCA证书签署的数字证书。而对于旧设备,则仅在G1根证书失效之前,发送G1SubCA证书和G1SubCA证书签署的数字证书,在G1根证书失效之后则停止运作并下线。
综上所述,第一设备存储有第一设备信任的根证书,第一设备无需额外上载其他证书,仅需接收第二设备发送的第一连接证书和第一数字证书(或者接收第二设备发送的第一连接证书、至少一个次级CA证书和第一连接证书),即可实现对第一数字证书的合法性的验证。并且,第一设备与第二设备无需互相确认对端设备信任的根证书,使得至少两个根证书共存的情况对于第一设备而言是透明无感的。本申请实施例提供的方法简单易行,应用范围较广,即使第一设备不具备上载功能,或者无法感知至少两个根证书共存的情况,也能够实现对数字证书的验证。并且,降低了数字证书的验证过程的复杂度,节约了验证成本。
以上介绍了本申请实施例提供的数字证书的验证方法。与上述图2所示的方法对应,本申请实施例还提供了另一种数字证书的验证装置。其中,该装置应用于第一设备,第一设备参见方法实施例中的说明,在此不再赘述。该装置用于通过图8所示的各个模块执行上述图2中第一设备所执行的数字证书的验证方法。如图8所示,本申请实施例提供的数字证书的 验证装置包括如下几个模块。
接收模块801,用于接收第二设备发送的第一连接证书和第一数字证书,第一连接证书为第二设备上存储的至少一个连接证书中的至少一个,一个连接证书基于两个根证书中有效期较早的根证书的私钥对有效期较晚的根证书的公钥进行签名得到,两个根证书为第二设备上存储的至少两个根证书中的任意两个,第一数字证书基于至少两个根证书中有效期最晚的根证书的私钥和第二设备的信息生成;
验证模块802,用于基于第一设备信任的根证书和第一连接证书验证第一数字证书的合法性,第一设备信任的根证书为至少两个根证书中的至少一个。
在示例性实施例中,第一设备信任的根证书为至少两个根证书中的至少一个,装置还包括:第一发送模块,用于向第二设备发送第二数字证书,使第二设备验证第二数字证书的合法性,第二数字证书基于第一设备信任的根证书的私钥和第一设备的信息生成。
在示例性实施例中,第一设备信任的根证书包括至少两个根证书中的至少两个,装置还包括:第二发送模块,用于向第二设备发送第二连接证书和第二数字证书,使第二设备验证第二数字证书的合法性,第二连接证书为第一设备信任的根证书对应的连接证书中的至少一个,第二数字证书基于第一设备信任的根证书中有效期最晚的根证书的私钥和第一设备的信息生成。
在示例性实施例中,第一设备信任的根证书包括有效期最晚的根证书,接收模块801,还用于在有效期最晚的根证书失效之前,且至少两个根证书中有效期非最晚的根证书失效之后,接收第二设备发送的第一数字证书;验证模块802,还用于基于有效期最晚的根证书验证第一数字证书的合法性。
在示例性实施例中,装置还包括:撤销模块,用于采用直接撤销的方式撤销第一设备信任的根证书中的至少一个证书,使被撤销的至少一个证书失效。
在示例性实施例中,接收模块801,还用于接收第二设备发送的应用场景信息;验证模块802,还用于验证第一数字证书合法之后,确认应用场景信息正确。
在示例性实施例中,第一设备满足参考条件,参考条件包括证书存储空间的容量大于容量阈值和具备根证书更新功能中的至少一个条件;或者,第一设备具备告警功能。
与上述图2所示的方法对应,本申请实施例还提供了一种数字证书的验证装置。其中,该装置应用于第二设备,第二设备参见方法实施例中的说明,在此不再赘述。该装置用于通过图9所示的各个模块执行上述图2中第二设备所执行的数字证书的验证方法。如图9所示,本申请实施例提供的数字证书的验证装置包括如下几个模块。
发送模块901,用于向第一设备发送第一连接证书和第一数字证书,使第一设备验证第一数字证书的合法性。其中,第二设备存储有有效的至少两个根证书、至少一个连接证书和第一数字证书,一个连接证书基于两个根证书中有效期较早的根证书的私钥对有效期较晚的根证书的公钥进行签名得到,两个根证书为至少两个根证书中的任意两个,第一数字证书基于至少两个根证书中有效期最晚的根证书的私钥和第二设备的信息生成。第一连接证书为至少一个连接证书中的至少一个,第一连接证书用于验证第一数字证书的合法性。
在示例性实施例中,两个根证书为至少两个根证书中的任意两个有效期相邻的根证书。
在示例性实施例中,装置还包括:查询模块,用于查询第一设备信任的根证书,第一设备信任的根证书为至少两个根证书中的至少一个;选择模块,用于基于第一设备信任的根证 书,从至少一个连接证书中选择得到第一连接证书,第一设备信任的根证书用于验证第一连接证书的合法性。
在示例性实施例中,第一设备信任的根证书为至少两个根证书中的任意一个,装置还包括:第一验证模块,用于接收第一设备发送的第二数字证书,第二数字证书基于第一设备信任的根证书的私钥和第一设备的信息生成;基于第一设备信任的根证书验证第二数字证书的合法性。
在示例性实施例中,第一设备信任的根证书为至少两个根证书中的至少两个,装置还包括:第二验证模块,用于接收第一设备发送的第二连接证书和第二数字证书,第二连接证书为第一设备信任的根证书对应的连接证书中的至少一个,第二数字证书基于第一设备信任的根证书中有效期最晚的根证书的私钥和第一设备的信息生成;基于第一设备信任的根证书和第二连接证书验证第二数字证书的合法性。
在示例性实施例中,第一设备信任的根证书包括有效期最晚的根证书,发送模块901,还用于在有效期最晚的根证书失效之前,且至少两个根证书中有效期非最晚的根证书失效之后,向第一设备发送第一数字证书,使第一设备基于有效期最晚的根证书验证第一数字证书的合法性。
在示例性实施例中,装置还包括:撤销模块,用于采用直接撤销的方式撤销至少两个根证书、至少一个连接证书和第一数字证书中的至少一个证书,使被撤销的至少一个证书失效。
在示例性实施例中,发送模块901,还用于向第一设备发送第二设备对应的应用场景信息,使第一设备验证第一数字证书合法之后,确认应用场景信息正确。
在示例性实施例中,第二设备满足参考条件,参考条件包括证书存储空间的容量大于容量阈值和具备根证书更新功能中的至少一个条件;或者,第二设备具备告警功能。
在示例性实施例中,第一设备用于基于第一设备信任的根证书和第一连接证书验证第一数字证书的合法性,第一设备信任的根证书为至少两个根证书中的至少一个。
与上述图4所示的方法对应,本申请实施例还提供了一种数字证书的验证装置。该装置应用于第一设备。该装置用于通过图10所示的各个模块执行上述图4中第一设备所执行的数字证书的验证方法。如图10所示,该装置包括如下几个模块。
接收模块1001,用于接收第二设备发送的第一连接证书、至少一个次级认证中心证书和第一数字证书,第一连接证书为第二设备上存储的至少一个连接证书中的至少一个,一个连接证书基于两个根证书中有效期较早的根证书的私钥对两个根证书中有效期较晚的根证书的公钥进行签名得到,两个根证书为第二设备上存储的至少两个根证书中的任意两个,第一数字证书基于至少两个根证书中有效期最晚的根证书的私钥、第二设备上存储的至少一个次级认证中心证书和第二设备的信息生成;
验证模块1002,用于基于第一设备信任的根证书、至少一个次级认证中心证书和第一连接证书验证第一数字证书的合法性,第一设备信任的根证书为至少两个根证书中的至少一个。
与上述图4所示的方法对应,本申请实施例还提供了一种数字证书的验证装置。该装置应用于第二设备,第二设备存储有有效的至少两个根证书、至少一个次级认证中心证书、至少一个连接证书和第一数字证书,一个连接证书基于两个根证书中有效期较早的根证书的私钥对有效期较晚的根证书的公钥进行签名得到,两个根证书为至少两个根证书中的任意两个,第一数字证书基于至少两个根证书中有效期最晚的根证书的私钥、至少一个次级认证中心证 书和第二设备的信息生成。该装置用于通过图11所示的各个模块执行上述图4中第二设备所执行的数字证书的验证方法。如图11所示,该装置包括如下的模块。
发送模块1101,用于向第一设备发送第一连接证书、至少一个次级认证中心证书和第一数字证书,使第一设备验证第一数字证书的合法性,第一连接证书为至少一个连接证书中的至少一个,第一连接证书和至少一个次级认证中心证书用于验证第一数字证书的合法性。
综上所述,第一设备存储有第一设备信任的根证书,第一设备无需额外上载其他证书,也无需感知至少两个根证书共存的情况,而是基于第一设备信任的根证书和接收的第一连接证书(或者基于第一设备信任的根证书、接收的至少一个次级CA证书和第一连接证书)即可实现对第一数字证书的验证。因此,本申请实施例提供的装置适用范围较广,即使第一设备不具备上载功能,或者无法感知至少两个根证书共存的情况,也能够实现对数字证书的验证。由此,降低了数字证书的验证过程的复杂度,节约了验证成本。
应理解的是,上述图8至图11提供的装置在实现其功能时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的装置与方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
参见图12,图12示出了本申请一示例性的数字证书的验证设备1200的结构示意图,该数字证书的验证设备1200包括至少一个处理器1201、存储器1203以及至少一个网络接口1204。
处理器1201例如是通用中央处理器(Central Processing Unit,CPU)、数字信号处理器(digital signal processor,DSP)、网络处理器(network processer,NP)、GPU、神经网络处理器(neural-network processing units,NPU)、数据处理单元(Data Processing Unit,DPU)、微处理器或者一个或多个用于实现本申请方案的集成电路或专用集成电路(application-specific integrated circuit,ASIC)、可编程逻辑器件(programmable logic device,PLD)、其他通用处理器或者其他可编程逻辑器件、分立门、晶体管逻辑器件、分立硬件部件或者其任意组合。PLD例如是复杂可编程逻辑器件(complex programmable logic device,CPLD)、现场可编程逻辑门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合。通用处理器可以是微处理器或者是任何常规的处理器等。值得说明的是,处理器可以是支持进阶精简指令集机器(advanced RISC machines,ARM)架构的处理器。其可以实现或执行结合本申请公开内容所描述的各种逻辑方框、模块和电路。处理器也可以是实现计算功能的组合,例如包括一个或多个微处理器组合,DSP和微处理器的组合等等。
可选的,数字证书的验证设备1200还包括总线1202。总线1202用于在数字证书的验证设备1200的各组件之间传送信息。总线1202可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。总线1202可以分为地址总线、数据总线、控制总线等。为便于表示,图12中仅用一条线表示,但并不表示仅有一根总线或一种类型的总线。
存储器1203例如是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读 存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。
通过示例性但不是限制性说明,许多形式的ROM和RAM可用。例如,ROM为只读光盘(compact disc read-only memory,CD-ROM)。RAM包括但不限于静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic random access memory,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。
存储器1203还可以是可存储静态信息和指令的其它类型的存储设备。或者可以是可存储信息和指令的其它类型的动态存储设备。或者可以是其它光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其它磁存储设备,或者是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质,但不限于此。存储器1203例如是独立存在,并通过总线1202与处理器1201相连接。存储器1203也可以和处理器1201集成在一起。
网络接口1204使用任何收发器一类的装置,用于与其它设备或通信网络通信,通信网络可以为以太网、无线接入网(radio access network,RAN)或无线局域网(wireless local area network,WLAN)等。网络接口1204可以包括有线网络接口,还可以包括无线网络接口。具体的,网络接口1204可以为以太(Ethernet)接口,如:快速以太(Fast Ethernet,FE)接口、千兆以太(Gigabit Ethernet,GE)接口,异步传输模式(Asynchronous Transfer Mode,ATM)接口,WLAN接口,蜂窝网络接口或其组合。以太网接口可以是光接口,电接口或其组合。在本申请的一些实施方式中,网络接口1204可以用于数字证书的验证设备1200与其他设备进行通信。
在具体实现中,作为一些实施方式,处理器1201可以包括一个或多个CPU,如图12中所示的CPU0和CPU1。这些处理器中的每一个可以是一个单核处理器,也可以是一个多核处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。
在具体实现中,作为一些实施方式,数字证书的验证设备1200可以包括多个处理器,如图12中所示的处理器1201和处理器1205。这些处理器中的每一个可以是一个单核处理器,也可以是一个多核处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(如计算机程序指令)的处理核。
在一些实施方式中,存储器1203用于存储执行本申请方案的程序指令1210,处理器1201可以执行存储器1203中存储的程序指令1210。也即是,数字证书的验证设备1200可以通过处理器1201以及存储器1203中的程序指令1210,来实现方法实施例提供的方法,即图2和图4中第一设备或第二设备所执行的方法。程序指令1210中可以包括一个或多个软件模块。可选地,处理器1201自身也可以存储执行本申请方案的程序指令。
在具体实施过程中,本申请的数字证书的验证设备1200可对应于用于执行上述方法的第一网元设备,数字证书的验证设备1200中的处理器1201读取存储器1203中的指令,使图12所 示的数字证书的验证设备1200能够执行方法实施例中的全部或部分步骤。
数字证书的验证设备1200还可以对应于上述图8至图11所示的装置,图8至图11所示的装置中的每个功能模块采用数字证书的验证设备1200的软件实现。换句话说,图8至图11所示的装置包括的功能模块为数字证书的验证设备1200的处理器1201读取存储器1203中存储的程序指令1210后生成的。
其中,图2和图4所示的方法的各步骤通过数字证书的验证设备1200的处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请所公开的方法实施例的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法实施例的步骤,为避免重复,这里不再详细描述。
在示例性实施例中,提供了一种数字证书的验证系统,系统包括通信连接的第一设备和第二设备。其中,第一设备和第二设备用于实现图2所示的数字证书的验证方法,或者,第一设备和第二设备用于实现图4所示的数字证书的验证方法。
在示例性实施例中,提供了一种计算机程序(产品),计算机程序(产品)包括:计算机程序代码,当计算机程序代码被计算机运行时,使得计算机执行上述图2或图4所示的数字证书的验证方法。
在示例性实施例中,提供了一种计算机可读存储介质,计算机可读存储介质存储程序或指令,当程序或指令在计算机上运行时,上述图2或图4所示的数字证书的验证方法被执行。
在示例性实施例中,提供了一种芯片,包括处理器,用于从存储器中调用并运行存储器中存储的指令,使得安装有芯片的计算机执行上述图2或图4所示的数字证书的验证方法。
在示例性实施例中,提供另一种芯片,包括:输入接口、输出接口、处理器和存储器,输入接口、输出接口、处理器以及存储器之间通过内部连接通路相连,处理器用于执行存储器中的代码,当代码被执行时,安装有芯片的计算机执行上述图2或图4所示的数字证书的验证方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk)等。
本申请中术语“第一”“第二”等字样用于对作用和功能基本相同的相同项或相似项进行区分,应理解,“第一”、“第二”、“第n”之间不具有逻辑或时序上的依赖关系,也不对数量和执 行顺序进行限定。还应理解,尽管以下描述使用术语第一、第二等来描述各种元素,但这些元素不应受术语的限制。这些术语只是用于将一元素与另一元素区别分开。
还应理解,在本申请的各个实施例中,各个过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
本申请中术语“至少一个”的含义是指一个或多个,本申请中术语“多个”的含义是指两个或两个以上,例如,多个第一设备是指两个或两个以上的第一设备。本文中术语“系统”和“网络”经常可互换使用。
应理解,在本文中对各种所述示例的描述中所使用的术语只是为了描述特定示例,而并非旨在进行限制。如在对各种所述示例的描述和所附权利要求书中所使用的那样,单数形式“一个(“a”,“an”)”和“该”旨在也包括复数形式,除非上下文另外明确地指示。
还应理解,本文中所使用的术语“和/或”是指并且涵盖相关联的所列出的项目中的一个或多个项目的任何和全部可能的组合。术语“和/或”,是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本申请中的字符“/”,一般表示前后关联对象是一种“或”的关系。
还应理解,术语“若”和“如果”可被解释为意指“当...时”(“when”或“upon”)或“响应于确定”或“响应于检测到”。类似地,根据上下文,短语“若确定...”或“若检测到[所陈述的条件或事件]”可被解释为意指“在确定...时”或“响应于确定...”或“在检测到[所陈述的条件或事件]时”或“响应于检测到[所陈述的条件或事件]”。
以上所述仅为本申请的实施例,并不用以限制本申请,凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (42)

  1. 一种数字证书的验证方法,其特征在于,所述方法应用于第一设备,所述方法包括:
    所述第一设备接收第二设备发送的第一连接证书和第一数字证书,所述第一连接证书为所述第二设备上存储的至少一个连接证书中的至少一个,一个连接证书基于两个根证书中有效期较早的根证书的私钥对有效期较晚的根证书的公钥进行签名得到,所述两个根证书为所述第二设备上存储的至少两个根证书中的任意两个,所述第一数字证书基于所述至少两个根证书中有效期最晚的根证书的私钥和所述第二设备的信息生成;
    所述第一设备基于所述第一设备信任的根证书和所述第一连接证书验证所述第一数字证书的合法性,所述第一设备信任的根证书为所述至少两个根证书中的至少一个。
  2. 根据权利要求1所述的方法,其特征在于,所述第一设备信任的根证书为所述至少两个根证书中的任意一个,所述方法还包括:
    所述第一设备向所述第二设备发送第二数字证书,使所述第二设备验证所述第二数字证书的合法性,所述第二数字证书基于所述第一设备信任的根证书的私钥和所述第一设备的信息生成。
  3. 根据权利要求1所述的方法,其特征在于,所述第一设备信任的根证书为所述至少两个根证书中的至少两个,所述方法还包括:
    所述第一设备向所述第二设备发送所述第二连接证书和第二数字证书,使所述第二设备验证所述第二数字证书的合法性,所述第二连接证书为所述第一设备信任的根证书对应的连接证书中的至少一个,所述第二数字证书基于所述第一设备信任的根证书中有效期最晚的根证书的私钥和所述第一设备的信息生成。
  4. 根据权利要求1-3任一所述的方法,其特征在于,所述第一设备信任的根证书包括所述有效期最晚的根证书,所述方法还包括:
    在所述有效期最晚的根证书失效之前,且所述至少两个根证书中有效期非最晚的根证书失效之后,所述第一设备接收所述第二设备发送的所述第一数字证书;
    所述第一设备基于所述有效期最晚的根证书验证所述第一数字证书的合法性。
  5. 根据权利要求1-4任一所述的方法,其特征在于,所述方法还包括:
    所述第一设备采用直接撤销的方式撤销所述第一设备信任的根证书中的至少一个证书,使被撤销的至少一个证书失效。
  6. 根据权利要求1-5任一所述的方法,其特征在于,所述方法还包括:
    所述第一设备接收所述第二设备发送的应用场景信息;
    所述第一设备验证所述第一数字证书合法之后,确认所述应用场景信息正确。
  7. 根据权利要求1-6任一所述的方法,其特征在于,所述第一设备满足参考条件,所述参考条件包括证书存储空间的容量大于容量阈值和具备根证书更新功能中的至少一个条件;
    或者,所述第一设备具备告警功能。
  8. 一种数字证书的验证方法,其特征在于,所述方法应用于第一设备,所述方法包括:
    所述第一设备接收第二设备发送的第一连接证书、至少一个次级认证中心证书和第一数字证书,所述第一连接证书为所述第二设备上存储的至少一个连接证书中的至少一个,一个连接证书基于两个根证书中有效期较早的根证书的私钥对所述两个根证书中有效期较晚的根证书的公钥进行签名得到,所述两个根证书为所述第二设备上存储的至少两个根证书中的任意两个,所述第一数字证书基于所述至少两个根证书中有效期最晚的根证书的私钥、所述第二设备上存储的所述至少一个次级认证中心证书和所述第二设备的信息生成;
    所述第一设备基于所述第一设备信任的根证书、所述至少一个次级认证中心证书和所述第一连接证书验证所述第一数字证书的合法性,所述第一设备信任的根证书为所述至少两个根证书中的至少一个。
  9. 一种数字证书的验证方法,其特征在于,所述方法应用于第二设备,所述第二设备存储有有效的至少两个根证书、至少一个连接证书和第一数字证书,一个连接证书基于两个根证书中有效期较早的根证书的私钥对有效期较晚的根证书的公钥进行签名得到,所述两个根证书为所述至少两个根证书中的任意两个,所述第一数字证书基于所述至少两个根证书中有效期最晚的根证书的私钥和所述第二设备的信息生成,所述方法包括:
    所述第二设备向第一设备发送第一连接证书和所述第一数字证书,使所述第一设备验证所述第一数字证书的合法性,所述第一连接证书为所述至少一个连接证书中的至少一个,所述第一连接证书用于验证所述第一数字证书的合法性。
  10. 根据权利要求9所述的方法,其特征在于,所述两个根证书为所述至少两个根证书中的任意两个有效期相邻的根证书。
  11. 根据权利要求9或10所述的方法,其特征在于,所述第二设备向第一设备发送第一连接证书和所述第一数字证书之前,所述方法还包括:
    所述第二设备查询第一设备信任的根证书,所述第一设备信任的根证书为所述至少两个根证书中的至少一个;
    所述第二设备基于所述第一设备信任的根证书,从所述至少一个连接证书中选择得到所述第一连接证书,所述第一设备信任的根证书用于验证所述第一连接证书的合法性。
  12. 根据权利要求9-11任一所述的方法,其特征在于,所述第一设备信任的根证书为所述至少两个根证书中的任意一个,所述方法还包括:
    所述第二设备接收所述第一设备发送的第二数字证书,所述第二数字证书基于所述第一设备信任的根证书的私钥和所述第一设备的信息生成;
    所述第二设备基于所述第一设备信任的根证书验证所述第二数字证书的合法性。
  13. 根据权利要求9-11任一所述的方法,其特征在于,所述第一设备信任的根证书为所述至少两个根证书中的至少两个,所述方法还包括:
    所述第二设备接收所述第一设备发送的第二连接证书和第二数字证书,所述第二连接证书为所述第一设备信任的根证书对应的连接证书中的至少一个,所述第二数字证书基于所述第一设备信任的根证书中有效期最晚的根证书的私钥和所述第一设备的信息生成;
    所述第二设备基于所述第一设备信任的根证书和所述第二连接证书验证所述第二数字证书的合法性。
  14. 根据权利要求9-13任一所述的方法,其特征在于,所述第一设备信任的根证书包括所述有效期最晚的根证书,所述方法还包括:
    在所述有效期最晚的根证书失效之前,且所述至少两个根证书中有效期非最晚的根证书失效之后,所述第二设备向所述第一设备发送所述第一数字证书,使所述第一设备验证所述第一数字证书的合法性。
  15. 根据权利要求9-14任一所述的方法,其特征在于,所述方法还包括:
    所述第二设备采用直接撤销的方式撤销所述至少两个根证书、所述至少一个连接证书和所述第一数字证书中的至少一个证书,使被撤销的至少一个证书失效。
  16. 根据权利要求9-15任一所述的方法,其特征在于,所述方法还包括:
    所述第二设备向所述第一设备发送所述第二设备对应的应用场景信息,使所述第一设备验证所述第一数字证书合法之后,确认所述应用场景信息正确。
  17. 根据权利要求9-16任一所述的方法,其特征在于,所述第二设备满足参考条件,所述参考条件包括证书存储空间的容量大于容量阈值和具备根证书更新功能中的至少一个条件;
    或者,所述第二设备具备告警功能。
  18. 根据权利要求9-17任一所述的方法,其特征在于,所述第一设备用于基于所述第一设备信任的根证书和所述第一连接证书验证所述第一数字证书的合法性,所述第一设备信任的根证书为所述至少两个根证书中的至少一个。
  19. 一种数字证书的验证方法,其特征在于,所述方法应用于第二设备,所述第二设备存储有有效的至少两个根证书、至少一个次级认证中心证书、至少一个连接证书和第一数字证书,一个连接证书基于两个根证书中有效期较早的根证书的私钥对有效期较晚的根证书的公钥进行签名得到,所述两个根证书为所述至少两个根证书中的任意两个,所述第一数字证书基于所述至少两个根证书中有效期最晚的根证书的私钥、所述至少一个次级认证中心证书和所述第二设备的信息生成,所述方法包括:
    所述第二设备向第一设备发送第一连接证书、所述至少一个次级认证中心证书和所述第一数字证书,使所述第一设备验证所述第一数字证书的合法性,所述第一连接证书为所述至 少一个连接证书中的至少一个,所述第一连接证书和所述至少一个次级认证中心证书用于验证所述第一数字证书的合法性。
  20. 一种数字证书的验证装置,其特征在于,所述装置应用于第一设备,所述装置包括:
    接收模块,用于接收第二设备发送的第一连接证书和第一数字证书,所述第一连接证书为所述第二设备上存储的至少一个连接证书中的至少一个,一个连接证书基于两个根证书中有效期较早的根证书的私钥对所述两个根证书中有效期较晚的根证书的公钥进行签名得到,所述两个根证书为所述第二设备上存储的至少两个根证书中的任意两个,所述第一数字证书基于所述至少两个根证书中有效期最晚的根证书的私钥和所述第二设备的信息生成;
    验证模块,用于基于所述第一设备信任的根证书和所述第一连接证书验证所述第一数字证书的合法性,所述第一设备信任的根证书为所述至少两个根证书中的至少一个。
  21. 根据权利要求20所述的装置,其特征在于,所述第一设备信任的根证书为所述至少两个根证书中的任意一个,所述装置还包括:
    第一发送模块,用于向所述第二设备发送第二数字证书,使所述第二设备验证所述第二数字证书的合法性,所述第二数字证书基于所述第一设备信任的根证书的私钥和所述第一设备的信息生成。
  22. 根据权利要求20所述的装置,其特征在于,所述第一设备信任的根证书为所述至少两个根证书中的至少两个,所述装置还包括:
    第二发送模块,用于向所述第二设备发送所述第二连接证书和第二数字证书,使所述第二设备验证所述第二数字证书的合法性,所述第二连接证书为所述第一设备信任的根证书对应的连接证书中的至少一个,所述第二数字证书基于所述第一设备信任的根证书中有效期最晚的根证书的私钥和所述第一设备的信息生成。
  23. 根据权利要求20-22任一所述的装置,其特征在于,所述第一设备信任的根证书包括所述有效期最晚的根证书,所述接收模块,还用于在所述有效期最晚的根证书失效之前,且所述至少两个根证书中有效期非最晚的根证书失效之后,接收所述第二设备发送的所述第一数字证书;
    所述验证模块,还用于基于所述有效期最晚的根证书验证所述第一数字证书的合法性。
  24. 根据权利要求20-23任一所述的装置,其特征在于,所述装置还包括:
    撤销模块,用于采用直接撤销的方式撤销所述第一设备信任的根证书中的至少一个证书,使被撤销的至少一个证书失效。
  25. 根据权利要求20-24任一所述的装置,其特征在于,所述接收模块,还用于接收所述第二设备发送的应用场景信息;
    所述验证模块,还用于验证所述第一数字证书合法之后,确认所述应用场景信息正确。
  26. 根据权利要求20-25任一所述的装置,其特征在于,所述第一设备满足参考条件,所述参考条件包括证书存储空间的容量大于容量阈值和具备根证书更新功能中的至少一个条件;
    或者,所述第一设备具备告警功能。
  27. 一种数字证书的验证装置,其特征在于,所述装置应用于第一设备,所述装置包括:
    接收模块,用于接收第二设备发送的第一连接证书、至少一个次级认证中心证书和第一数字证书,所述第一连接证书为所述第二设备上存储的至少一个连接证书中的至少一个,一个连接证书基于两个根证书中有效期较早的根证书的私钥对所述两个根证书中有效期较晚的根证书的公钥进行签名得到,所述两个根证书为所述第二设备上存储的至少两个根证书中的任意两个,所述第一数字证书基于所述至少两个根证书中有效期最晚的根证书的私钥、所述第二设备上存储的所述至少一个次级认证中心证书和所述第二设备的信息生成;
    验证模块,用于基于所述第一设备信任的根证书、所述至少一个次级认证中心证书和所述第一连接证书验证所述第一数字证书的合法性,所述第一设备信任的根证书为所述至少两个根证书中的至少一个。
  28. 一种数字证书的验证装置,其特征在于,所述装置应用于第二设备,所述第二设备存储有有效的至少两个根证书、至少一个连接证书和第一数字证书,一个连接证书基于两个根证书中有效期较早的根证书的私钥对有效期较晚的根证书的公钥进行签名得到,所述两个根证书为所述至少两个根证书中的任意两个,所述第一数字证书基于所述至少两个根证书中有效期最晚的根证书的私钥和所述第二设备的信息生成,所述装置包括:
    发送模块,用于向第一设备发送第一连接证书和所述第一数字证书,使所述第一设备验证所述第一数字证书的合法性,所述第一连接证书为所述至少一个连接证书中的至少一个,所述第一连接证书用于验证所述第一数字证书的合法性。
  29. 根据权利要求28所述的装置,其特征在于,所述两个根证书为所述至少两个根证书中的任意两个有效期相邻的根证书。
  30. 根据权利要求28或29所述的装置,其特征在于,所述装置还包括:
    查询模块,用于查询所述第一设备信任的根证书,所述第一设备信任的根证书为所述至少两个根证书中的至少一个;
    选择模块,用于基于所述第一设备信任的根证书,从所述至少一个连接证书中选择得到所述第一连接证书,所述第一设备信任的根证书用于验证所述第一连接证书的合法性。
  31. 根据权利要求28-30任一所述的装置,其特征在于,所述第一设备信任的根证书为所述至少两个根证书中的任意一个,所述装置还包括:
    第一验证模块,用于接收所述第一设备发送的第二数字证书,所述第二数字证书基于所述第一设备信任的根证书的私钥和所述第一设备的信息生成;基于所述第一设备信任的根证书验证所述第二数字证书的合法性。
  32. 根据权利要求28-30任一所述的装置,其特征在于,所述第一设备信任的根证书为所述至少两个根证书中的至少两个,所述装置还包括:
    第二验证模块,用于接收所述第一设备发送的第二连接证书和第二数字证书,所述第二连接证书为所述第一设备信任的根证书对应的连接证书中的至少一个,所述第二数字证书基于所述第一设备信任的根证书中有效期最晚的根证书的私钥和所述第一设备的信息生成;基于所述第一设备信任的根证书和所述第二连接证书验证所述第二数字证书的合法性。
  33. 根据权利要求28-32任一所述的装置,其特征在于,所述第一设备信任的根证书包括所述有效期最晚的根证书,所述发送模块,还用于在所述有效期最晚的根证书失效之前,且所述至少两个根证书中有效期非最晚的根证书失效之后,向所述第一设备发送所述第一数字证书,使所述第一设备验证所述第一数字证书的合法性。
  34. 根据权利要求28-33任一所述的装置,其特征在于,所述装置还包括:
    撤销模块,用于采用直接撤销的方式撤销所述至少两个根证书、所述至少一个连接证书和所述第一数字证书中的至少一个证书,使被撤销的至少一个证书失效。
  35. 根据权利要求28-34任一所述的装置,其特征在于,所述发送模块,还用于向所述第一设备发送所述第二设备对应的应用场景信息,使所述第一设备验证所述第一数字证书合法之后,确认所述应用场景信息正确。
  36. 根据权利要求28-35任一所述的装置,其特征在于,所述第二设备满足参考条件,所述参考条件包括证书存储空间的容量大于容量阈值和具备根证书更新功能中的至少一个条件;
    或者,所述第二设备具备告警功能。
  37. 根据权利要求28-36任一所述的装置,其特征在于,所述第一设备用于基于所述第一设备信任的根证书和所述第一连接证书验证所述第一数字证书的合法性,所述第一设备信任的根证书为所述至少两个根证书中的至少一个。
  38. 一种数字证书的验证装置,其特征在于,所述装置应用于第二设备,所述第二设备存储有有效的至少两个根证书、至少一个次级认证中心证书、至少一个连接证书和第一数字证书,一个连接证书基于两个根证书中有效期较早的根证书的私钥对有效期较晚的根证书的公钥进行签名得到,所述两个根证书为所述至少两个根证书中的任意两个,所述第一数字证书基于所述至少两个根证书中有效期最晚的根证书的私钥、所述至少一个次级认证中心证书和所述第二设备的信息生成,所述装置包括:
    发送模块,用于向第一设备发送第一连接证书、所述至少一个次级认证中心证书和所述第一数字证书,使所述第一设备验证所述第一数字证书的合法性,所述第一连接证书为所述至少一个连接证书中的至少一个,所述第一连接证书和所述至少一个次级认证中心证书用于验证所述第一数字证书的合法性。
  39. 一种数字证书的验证设备,其特征在于,所述设备包括网络接口、存储器及处理器;所述网络接口用于所述设备进行通信,所述存储器中存储有至少一条指令,所述至少一条指令由所述处理器加载并执行,以使所述设备实现权利要求1-19中任一所述的数字证书的验证方法。
  40. 一种数字证书的验证系统,其特征在于,所述系统包括通信连接的第一设备和第二设备,所述第一设备用于实现权利要求1-7中任一所述的数字证书的验证方法且所述第二设备用于实现权利要求9-18中任一所述的数字证书的验证方法,或者,所述第一设备用于实现权利要求8所述的数字证书的验证方法且所述第二设备用于实现权利要求19所述的数字证书的验证方法。
  41. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有至少一条指令,所述指令由处理器加载并执行,以使计算机实现如权利要求1-19中任一所述的数字证书的验证方法。
  42. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序/指令,所述计算机程序/指令被处理器执行,以使计算机实现权利要求1-19中任一所述的数字证书的验证方法。
PCT/CN2023/086128 2022-04-07 2023-04-04 数字证书的验证方法、装置、设备及计算机可读存储介质 WO2023193700A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210363720.9A CN116938466A (zh) 2022-04-07 2022-04-07 数字证书的验证方法、装置、设备及计算机可读存储介质
CN202210363720.9 2022-04-07

Publications (1)

Publication Number Publication Date
WO2023193700A1 true WO2023193700A1 (zh) 2023-10-12

Family

ID=88244044

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/086128 WO2023193700A1 (zh) 2022-04-07 2023-04-04 数字证书的验证方法、装置、设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN116938466A (zh)
WO (1) WO2023193700A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104901794A (zh) * 2014-03-06 2015-09-09 苹果公司 根证书的撤销
US9252958B1 (en) * 2014-03-12 2016-02-02 Crimson Corporation Systems and methods for providing a self-maintaining PKI infrastructure among loosely connected entities
CN107294722A (zh) * 2016-03-31 2017-10-24 阿里巴巴集团控股有限公司 一种终端身份认证方法、装置及系统
CN111526159A (zh) * 2020-05-25 2020-08-11 普联技术有限公司 建立数据连接的方法、装置、终端设备及存储介质
CN111934870A (zh) * 2020-09-22 2020-11-13 腾讯科技(深圳)有限公司 区块链网络中的根证书更新方法、装置、设备以及介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104901794A (zh) * 2014-03-06 2015-09-09 苹果公司 根证书的撤销
US9252958B1 (en) * 2014-03-12 2016-02-02 Crimson Corporation Systems and methods for providing a self-maintaining PKI infrastructure among loosely connected entities
CN107294722A (zh) * 2016-03-31 2017-10-24 阿里巴巴集团控股有限公司 一种终端身份认证方法、装置及系统
CN111526159A (zh) * 2020-05-25 2020-08-11 普联技术有限公司 建立数据连接的方法、装置、终端设备及存储介质
CN111934870A (zh) * 2020-09-22 2020-11-13 腾讯科技(深圳)有限公司 区块链网络中的根证书更新方法、装置、设备以及介质

Also Published As

Publication number Publication date
CN116938466A (zh) 2023-10-24

Similar Documents

Publication Publication Date Title
US11074371B2 (en) Systems, methods and apparatuses for secure storage of data using a security-enhancing chip
EP3497878B1 (en) Apparatus and methods for distributed certificate enrollment
CN109328352B (zh) 靶向安全软件部署
WO2022095244A1 (zh) 跨链交易方法、系统、装置、设备和存储介质
US11722300B2 (en) Chip, private key generation method, and trusted certification method
CN112651037B (zh) 区块链系统的链外数据访问方法和系统
US20130346747A1 (en) Systems, methods and apparatuses for securing root certificates
EP3326321B1 (en) Method and apparatus for providing secure communication among constrained devices
CN113785548B (zh) 用于实施数据中心中的有效载荷安全性策略的证明服务
US10958450B1 (en) Constructing a multiple-entity root certificate data block chain
EP3598333A1 (en) Electronic device update management
CN111414640B (zh) 秘钥访问控制方法和装置
WO2022141700A1 (zh) 分布式节点设备的共识方法、节点设备及分布式网络
US20210399903A1 (en) Authorization delegation
WO2023193700A1 (zh) 数字证书的验证方法、装置、设备及计算机可读存储介质
CN111737766A (zh) 一种在区块链中判断数字证书签名数据合法性的方法
Zheng et al. Secure distributed applications the decent way
Marasco et al. AuthentiCAN: a Protocol for Improved Security over CAN
WO2022182341A1 (en) Trusted computing for digital devices
US20230076882A1 (en) A protocol for trustworthy, privacy preserving genomic database discovery
WO2024139741A1 (zh) 基于区块链的证书管理方法、系统及相关装置
Zheng et al. Building secure distributed applications the DECENT way
CN116938495A (zh) 数字证书的验证方法、装置、设备、系统及可读存储介质
CN118300801A (zh) 基于区块链的证书管理方法、系统及相关装置
CN118138251A (zh) 一种用于系统间互操作的方法、公证中继链和电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23784263

Country of ref document: EP

Kind code of ref document: A1