Certificate adaptive switching method, system, electronic device and storage medium
By obtaining and evaluating certificate status information in real time and automatically switching certificates, the problem of long interruption of encrypted communication caused by invalid certificates is solved, adaptive certificate switching is realized, and the continuity and security of communication are ensured.
Patent Information
- Application Number
- CN202410691012.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-05-30
AI Technical Summary
In the existing technology, when the certificate used by the website is invalid, it is necessary to manually switch to a new certificate, resulting in a long interruption period for encrypted communication.
By obtaining the risk status information of the initial certificate and backup certificate in real time, it can automatically select and evaluate candidate certificates, determine the target certificate, update certificate configuration items, and realize adaptive switching of certificates to avoid manual intervention.
It shortens the interruption period of encrypted communication, ensures the continuity and reliability of secure communication, and improves the automation of certificate management.
Smart Images

Figure CN118282671B
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a certificate adaptive switching method, system, electronic device and storage medium. Background Art
[0002] When a website uses the Hypertext Transfer Protocol Secure (HTTPS) protocol for secure communication, a website domain needs to use a certificate service to ensure secure communication, such as a Secure Sockets Layer (SSL) or Transport Layer Security (TLS) certificate, which is used to encrypt transmitted data and verify the identity of the website. Certificates are usually issued by a trusted third-party certificate authority (CA).
[0003] In the related art, when the certificate currently being used by a website is invalid, for example, the certificate is revoked or stopped by a third-party certificate authority, the website owner needs to apply for a new certificate from a new third-party certificate authority and manually switch to the new certificate to ensure encrypted communication. Before the new certificate takes effect, there will be a relatively long period of encrypted communication interruption. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a certificate adaptive switching method, system, electronic device and storage medium, which can shorten the duration of the encrypted communication interruption period.
[0005] To achieve the above-mentioned purpose, the first aspect of an embodiment of the present application proposes a certificate adaptive switching method, the method comprising: acquiring in real time from a certificate index database first risk status information of an initial certificate and second risk status information of a standby certificate, wherein the standby certificate is related to the initial certificate, the data of the certificate index database is updated in real time, and the certificate index database at least includes the risk status information corresponding to the initial certificate and the standby certificate; when the first risk status information indicates that the initial certificate needs to be replaced, based on the second risk status information and the issuing authority information of the standby certificate, selecting a candidate certificate from at least one of the standby certificates; performing a security assessment on the candidate certificates to obtain a certificate priority score, and determining a target certificate from the candidate certificates based on the certificate priority score; determining the target configuration information of the target certificate, and updating the certificate file configuration item according to the target configuration information, replacing the initial certificate with the target certificate, and continuing the communication process according to the target certificate.
[0006] In some embodiments, the selecting a candidate certificate from at least one of the standby certificates based on the second risk status information and the authority information of the standby certificate includes: obtaining certificate status information of the standby certificate, the certificate status information including idle or busy; if the certificate status information indicates that there is at least one standby certificate in an idle state, based on the second risk status information, selecting at least one risk-free standby certificate as an initial candidate certificate; and selecting the candidate certificate from the initial candidate certificate according to the issuing authority information.
[0007] In some embodiments, the selecting the candidate certificate from the initial candidate certificates according to the issuing authority information includes: obtaining an authorization issuance record for the website domain name; if the authorization issuance record does not exist, querying upward step by step to obtain an authorization issuance record for at least one of the parent domain name to the top-level domain name of the website domain name, and determining a target issuing authority for the website domain name according to the authorization issuance record; if the issuing authority information indicates that the issuing authority of the initial candidate certificate is the target issuing authority, selecting the initial candidate certificate as the candidate certificate.
[0008] In some embodiments, performing a security assessment on the candidate certificates to obtain a certificate priority score, and determining a target certificate from the candidate certificates based on the certificate priority score, includes: obtaining an initial certificate score obtained by performing a security assessment on the candidate certificates, the initial certificate score including a digital signature score, a cryptographic algorithm score, an algorithm strength score, and a key strength score; weighting the initial certificate score based on a first weight of the digital signature score, a second weight of the cryptographic algorithm score, a third weight of the algorithm strength score, and a fourth weight of the key strength score to obtain a certificate priority score, and determining a target certificate from the candidate certificates based on the certificate priority score, wherein the first weight is greater than the second weight, and the second weight is greater than the third weight or the fourth weight.
[0009] In some embodiments, the initial certificate score obtained by obtaining the candidate certificate for security assessment includes: obtaining the digital signature of the candidate certificate, and obtaining the digital signature score according to the number of fields in the digital signature; determining the cryptographic algorithm score according to the cryptographic algorithm of the candidate certificate, wherein the cryptographic algorithm includes an elliptic curve cryptography algorithm, a large number factorization algorithm, and a national secret algorithm, the cryptographic algorithm score of the elliptic curve cryptography algorithm is greater than the cryptographic algorithm score of the large number factorization algorithm, and the cryptographic algorithm score of the large number factorization algorithm is greater than the cryptographic algorithm score of the national secret algorithm; determining the algorithm strength score according to the strength of the hash function of the candidate certificate; and determining the key strength score according to the strength of the public key algorithm of the candidate certificate.
[0010] In some embodiments, determining the target configuration information of the target certificate includes: obtaining the certificate location and certificate key location of the target certificate from the certificate index database; obtaining the target certificate according to the certificate location, and obtaining the server private key of the corresponding issuing authority according to the certificate key location; storing the target certificate and the server private key in a configuration directory, and generating the target configuration information based on the configuration directory.
[0011] In some embodiments, determining the target configuration information of the target certificate further includes: obtaining the intermediate certificate location from the certificate index database, and obtaining the intermediate certificate according to the intermediate certificate location; storing the intermediate certificate in the configuration directory, and updating the target configuration information.
[0012] In some embodiments, before obtaining the first risk status information of the initial certificate and the second risk status information of the backup certificate in real time, the method also includes: generating a certificate application file according to configuration information during the initial certificate communication process; sending the certificate application file to at least one issuing authority different from the initial certificate; and obtaining the backup certificate after receiving the signature of the issuing authority on the certificate application file based on the server private key.
[0013] To achieve the above-mentioned purpose, the second aspect of an embodiment of the present application proposes a certificate adaptive switching system, including: a risk status information acquisition module, used to acquire in real time from a certificate index database the first risk status information of the initial certificate and the second risk status information of the standby certificate, wherein the standby certificate is related to the initial certificate, the data of the certificate index database is updated in real time, and the certificate index database at least includes the risk status information corresponding to the initial certificate and the standby certificate; a candidate certificate module, used to select a candidate certificate from at least one of the standby certificates based on the second risk status information and the issuing authority information of the standby certificate when the first risk status information indicates that the initial certificate needs to be replaced; a target certificate module, used to perform a security assessment on the candidate certificate to obtain a certificate priority score, and determine a target certificate from the candidate certificate based on the certificate priority score; a configuration module, used to determine the target configuration information of the target certificate, and update the certificate file configuration item according to the target configuration information, replace the initial certificate with the target certificate, and continue the communication process according to the target certificate.
[0014] To achieve the above-mentioned purpose, the third aspect of the embodiments of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the method described in the above-mentioned first aspect embodiment when executing the computer program.
[0015] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium, and the storage medium stores a computer program. When the computer program is executed by a processor, the method described in the embodiment of the first aspect above is implemented.
[0016] The certificate adaptive switching method, system, electronic device and storage medium proposed in the present application have the following beneficial effects: obtaining the first risk status information of the initial certificate and the second risk status information of the standby certificate in real time from the certificate index database, wherein the standby certificate is related to the initial certificate, the data of the certificate index database is updated in real time, and the certificate index database at least includes the risk status information corresponding to the initial certificate and the standby certificate; when the first risk status information indicates that the initial certificate needs to be replaced, based on the second risk status information and the issuing authority information of the standby certificate, a candidate certificate is selected from at least one standby certificate; a security assessment is performed on the candidate certificate to obtain a certificate priority score, and based on the certificate priority score, a candidate certificate is selected from Determine the target certificate in the candidate certificate, determine the target configuration information of the target certificate, and update the certificate file configuration items according to the target configuration information, use the target certificate to replace the initial certificate, and according to the continuous communication process of the target certificate, obtain the risk status information of the initial certificate and the backup certificate in real time by maintaining the certificate index database, timely discover and respond to security issues, and determine a safe, valid and correctly authorized target certificate based on the second risk status information, the issuing authority information of the backup certificate and the certificate priority score of the candidate certificate. There is no need for manual intervention, and it can quickly and adaptively switch from the initial certificate to the target certificate, and use the target certificate instead of the initial certificate for continuous communication, which can shorten the time of the encrypted communication interruption period. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flowchart of the certificate adaptive switching method provided in an embodiment of the present application.
[0018] Figure 2 It is a schematic diagram of real-time monitoring of certificate risk situations provided in an embodiment of the present application.
[0019] Figure 3 yes Figure 1 Flow chart of step 102 in FIG.
[0020] Figure 4 yes Figure 3 Flow chart of step 203 in FIG.
[0021] Figure 5 yes Figure 1 Flow chart of step 103 in FIG.
[0022] Figure 6 yes Figure 5Flow chart of step 401 in FIG.
[0023] Figure 7 yes Figure 1 Flow chart of step 104 in FIG.
[0024] Figure 8 This is another flow chart of the certificate adaptive switching method provided in an embodiment of the present application.
[0025] Fig. 9 This is another flow chart of the certificate adaptive switching method provided in an embodiment of the present application.
[0026] Fig.10 It is a schematic diagram of the functional modules of the certificate adaptive switching system provided in an embodiment of the present application.
[0027] Fig.11 This is another schematic diagram of the functional modules of the certificate adaptive switching system provided in an embodiment of the present application.
[0028] Fig.12 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0030] It should be noted that although the functional modules are divided in the device schematic and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0032] First, some nouns involved in this application are analyzed:
[0033] A certificate is a file containing digital information used to verify the identity and public key of a server or entity. It contains the server or entity's identification information, public key, and digital signature. Certificates are issued by a third-party certificate authority to ensure the security and credibility of communications.
[0034] A third-party Certificate Authority (CA) is an independent entity that is responsible for verifying and issuing Secure Sockets Layer (SSL) or Transport Layer Security (TLS) certificates. It is a trusted third-party organization with authority and credibility.
[0035] When a website uses the Hypertext Transfer Protocol Secure (HTTPS) protocol for secure communication, a website domain needs to use a certificate service to ensure secure communication, such as using a Secure Sockets Layer (SSL) / Transport Layer Security (TLS) certificate to encrypt transmitted data and verify the identity of the website. The certificate is usually issued by a trusted third-party certificate authority (CA).
[0036] In the related art, when the certificate currently used by a website is invalid, for example, the certificate is revoked or stopped by a third-party certificate authority, the website owner needs to apply for a new certificate from a new third-party certificate authority and manually switch to the new certificate to ensure encrypted communication. Before the new certificate takes effect, there will be a relatively long encrypted communication interruption period.
[0037] Based on this, the embodiments of the present application provide a certificate adaptive switching method, system, electronic device and storage medium, which can shorten the duration of the encrypted communication interruption period.
[0038] The certificate adaptive switching method, system, electronic device and storage medium provided in the embodiments of the present application are specifically described by the following embodiments. First, the certificate adaptive switching method in the embodiments of the present application is described. The certificate adaptive switching method in the embodiments of the present application can be described by the following embodiments.
[0039] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first. For example, when obtaining user stored data and the user's cached data access request, the user's permission or consent will be obtained first. Moreover, the collection, use and processing of these data will comply with the relevant laws, regulations and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or separate consent will be obtained by means of a pop-up window or jumping to a confirmation page. After clearly obtaining the user's separate permission or separate consent, the necessary user-related data used to enable the normal operation of the embodiment of the present application will be obtained.
[0040] The certificate adaptive switching method provided in the embodiment of the present application can be applied in the fields of Web servers, mobile applications, etc. In the field of Web servers, the method can be used to manage and update the SSL / TLS certificates of the server. By obtaining the risk status information of the certificate and the information of the backup certificate in real time, the system can automatically switch to the backup certificate when needed without manual intervention to ensure continuous secure communication. Servers and applications in a cloud computing environment need to communicate securely to protect the data and services hosted on the cloud. The method can be applied in a cloud environment to adaptively manage SSL / TLS certificates and switch to backup certificates when needed to ensure the security of cloud services.
[0041] Figure 1 is an optional flow chart of the certificate adaptive switching method provided in an embodiment of the present application. Figure 1 The method in the embodiment may include but is not limited to steps 101 to 104. Figure 1 The order of step 101 to step 104 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.
[0042] Step 101: Acquire first risk status information of an initial certificate and second risk status information of a backup certificate from a certificate index database in real time.
[0043] The backup certificate is related to the initial certificate, the data of the certificate index database is updated in real time, and the certificate index database at least includes the risk status information corresponding to the initial certificate and the backup certificate.
[0044] The following is a detailed description of step 101.
[0045] It is understandable that the initial certificate is the certificate currently being used by the website. It is a certificate issued by a third-party certificate authority and used to encrypt communications and verify the identity of the website. The backup certificate is a replacement certificate prepared to deal with the situation where the initial certificate is invalid or expired. It is related to the initial certificate and switches to and replaces the initial certificate when the initial certificate expires to maintain the continuity of encrypted communication.
[0046] Exemplarily, the first risk status information is the current certificate risk status of the initial certificate, which may include the validity, revocation status, expiration time, etc. of the initial certificate, which is used to evaluate the risk status of the initial certificate; the second risk status information is the current certificate risk status of the standby certificate, which may include the validity, revocation status, expiration time, etc. of the standby certificate, which is used to evaluate the risk status of the standby certificate.
[0047] It is understandable that the certificate index database is a database that stores and manages certificate-related information, contains data of multiple certificates, and updates data in real time based on the risk situation of each certificate to support query and retrieval of certificates.
[0048] In some embodiments, the certificate index database example is shown in Table 1, which includes at least the risk status information corresponding to the initial certificate and the backup certificate, wherein the risk status information may include revocation, outdate, mid-revoke, and no risk. Certificate revocation refers to the invalidation or revocation of an issued certificate. Due to the leakage of the private key of the certificate, the change of the identity information of the certificate holder, or the discovery of security issues in the certificate by a third-party certificate authority, the revoked certificate is listed as invalid in a specific revocation list and is no longer trusted; the certificate has a validity period, and once the period is exceeded, the certificate is considered expired; mid-revocation refers to the revocation of an intermediate certificate in the certificate chain. Since the certificate chain is a series of interconnected certificates used to establish a trust chain to verify the validity of the certificate, when an intermediate certificate in the certificate chain is revoked, it will affect the validity of other certificates in the certificate chain; no risk means that no risks or problems have been found in the certificate. For example, the risk status information of certificate A is revoked, indicating that it has been revoked and is no longer trustworthy.
[0049]
[0050] Table 1 Certificate index database example
[0051] Exemplarily, the certificate index database may also include information such as certificate name, certificate support algorithm, certificate location, certificate key location, intermediate certificate location, and certificate status. The certificate name is an identifier or descriptive name of the certificate, such as certificate A, and the certificate name is used to uniquely identify the certificate in the certificate index database; the certificate support algorithm refers to the encryption algorithm or key agreement used by the certificate, such as Rivest-Shamir-Adleman (RSA), Elliptic Curve Cryptography (ECC), and National Secret Algorithm (SM2 Public Key Cryptography Algorithm, SM2), etc.; the certificate location points to the location where the certificate is stored, which can be a file path or other identifier; the certificate key location points to the location of the private key of the certificate, which is used for pairing or signature verification with the certificate; the intermediate certificate location refers to the location of the intermediate certificate in the certificate chain if there is an intermediate certificate; the certificate status refers to the current status of the certificate, such as busy or free, busy means that the certificate is in use, and free means that the certificate is not in use.
[0052] It can be understood that the first risk status information of the initial certificate and the second risk status information of the backup certificate are obtained in real time from the certificate index database. For example, the certificate name of the initial certificate is Certificate A, and the first risk status information is revoked; the certificate name of one of the backup certificates is Certificate B, and the second risk status information is expired.
[0053] In some embodiments, the data in the certificate index database is updated in real time, and the data is updated according to the risk of the certificate perceived in real time. Figure 2 The risk status of the certificate is obtained by reading the plain text content related to the certificate and performing a legality check, a validity check, a vulnerability check, and a security check in sequence. Specifically, if any of the legality check, validity check, vulnerability check, and security check finds a problem, the subsequent checks can be terminated, and the risk status of the specific certificate can be output to the certificate index database, which performs real-time data updates on the risk status information of the certificate. If the legality check, validity check, vulnerability check, and security check pass in sequence, the risk status information of the certificate is updated to no risk; if the security check of the certificate fails, the risk status information of the certificate is updated to revoked in the certificate index database; if the validity period check fails in the validity check, the risk status information of the certificate is updated to expired in the certificate index database; if the intermediate certificate validity check fails, the risk status information of the certificate is updated to intermediate revocation in the certificate index database.
[0054] Exemplarily, the purpose of the legitimacy check is to ensure that the content of the certificate has not been tampered with. The validity check is to verify the validity period and determine that the certificate is not a revoked certificate. The purpose of the vulnerability check is to determine the stability of the encryption process of the corresponding server. The encryption stability is first related to the length of the server public key. A server public key that is too short can be easily cracked. Therefore, in the embodiment of the present application, the field length of the server public key is obtained. If the field length is greater than or equal to the preset length, for example, greater than 128 bits, it means that the length of the server public key is longer, and the first vulnerability check related to the public key length passes, otherwise the vulnerability check fails. The security check is to determine whether the issuing authority of the certificate is a trusted issuing authority.
[0055] Step 102: When the first risk status information indicates that the initial certificate needs to be replaced, a candidate certificate is selected from at least one standby certificate based on the second risk status information and the issuing authority information of the standby certificate.
[0056] The following is a detailed description of step 102.
[0057] Exemplarily, when the first risk status information indicates that the initial certificate needs to be replaced due to the revocation, expiration or other security issues of the initial certificate, the initial certificate is at risk, that is, a candidate certificate that meets the security requirements needs to be selected from the backup certificates as an alternative to the target certificate, and the second risk status information provides the security status of the backup certificate. By traversing the backup certificates in the certificate index database and making the following judgments for each backup certificate: verifying the second risk status information of the backup certificate to ensure that the risk status of the backup certificate meets the security requirements; checking the issuing authority information of the backup certificate to ensure that the backup certificate is issued by a trusted third-party certificate authority (CA), and then selecting a target certificate that meets the security and algorithm requirements based on a certain evaluation strategy (such as priority, availability, etc.).
[0058] Reference Figure 3 , based on the second risk status information and the issuing authority information of the standby certificate, selecting a candidate certificate from at least one standby certificate, including the following steps 201 to 203.
[0059] Step 201: Obtain certificate status information of a standby certificate.
[0060] The certificate status information includes idle or busy.
[0061] Step 202: If the certificate status information indicates that there is at least one standby certificate in an idle state, at least one risk-free standby certificate is selected as an initial candidate certificate based on the second risk status information.
[0062] Step 203: Select a candidate certificate from the initial candidate certificates according to the issuing authority information.
[0063] Steps 201 to 203 are described in detail below.
[0064] It is understandable that the certificate status information of the standby certificate can be obtained by querying the certificate status of each certificate in the certificate index database to determine the certificate status information of the standby certificate. The certificate status information includes idle or busy. If the standby certificate is in an idle state, it means that the certificate is not currently in use. If the certificate status information indicates that there is at least one standby certificate in an idle state, at least one risk-free standby certificate is selected as the initial candidate certificate based on the second risk status information.
[0065] Exemplarily, the initial candidate certificate refers to a risk-free certificate obtained according to the second risk status information. Referring to the certificate index database shown in Table 1, the certificate status information indicates that there are at least four standby certificates in an idle state, and the certificate names of the standby certificates are Certificate B, Certificate C, Certificate D, and Certificate E. Based on the second risk status information, indicating that the risk status information of Certificate B is revoked, the risk status information of Certificate C is expired, and the risk status information of Certificate D and Certificate E is risk-free, at least one risk-free standby certificate is selected as the initial candidate certificate, that is, Certificate D and Certificate E are selected as the initial candidate certificates.
[0066] In some embodiments, a candidate certificate refers to a certificate in a risk-free certificate that is issued by a trusted third-party certificate authority. The certificate's issuing authority information is used to indicate the third-party certificate authority that issued the certificate. A candidate certificate is selected from the initial candidate certificates based on the issuing authority information. For example, for each initial candidate certificate, its issuing authority information is checked to determine whether the initial candidate certificate is issued by a trusted third-party certificate authority. The system-predefined list of trusted issuing authorities or other security mechanisms can be used to verify the issuing authority of the initial candidate certificate, and only those initial candidate certificates issued by a trusted third-party certificate authority are selected as candidate certificates, and those certificates issued by untrusted issuing authorities are excluded.
[0067] Through the above steps 201 to 203, the candidate certificate is determined according to the issuing authority information of the standby certificate and the second risk status information. The security and credibility of the certificate largely depend on the credibility of the third-party certificate authority. Ensuring that the candidate certificate is issued by a trusted third-party certificate authority (CA) and is in a risk-free state helps maintain the security and reliability of communications.
[0068] Reference Figure 4, selecting a candidate certificate from the initial candidate certificates according to the issuing authority information, including the following steps 301 to 302.
[0069] Step 301, obtain the authorization issuance record of the website domain name. If there is no authorization issuance record, query upward level by level to obtain the authorization issuance record of at least one of the parent domain name to the top-level domain name of the website domain name, and determine the target issuing agency of the website domain name based on the authorization issuance record.
[0070] Step 302: If the issuing authority information indicates that the issuing authority of the initial candidate certificate is the target issuing authority, the initial candidate certificate is selected as the candidate certificate.
[0071] Steps 301 to 302 are described in detail below.
[0072] It is understood that a website domain name is a unique identifier of a website on the Internet, consisting of multiple parts separated by dots (.). The parent domain name refers to the domain name that is one level above the target domain name in a domain name. The top-level domain name is the highest level part of the domain name, and the top-level domain name represents a specific country, region or organization type.
[0073] Exemplarily, the authorization issuance record of the website domain name is obtained. If there is no authorization issuance record, query upward level by level to obtain the authorization issuance record of at least one of the parent domain names to the top-level domain name of the website domain name. The authorization issuance record (Certificate Authority Authorization, CAA record) allows the domain name owner to control which third-party certificate authorities can issue certificates for their domain names. It is a type of record in the Domain Name System (DNS). As long as the allowed third-party certificate authority is specified in the CAA record at any level of the domain name (including the domain name and its parent domain name), the domain name and all its subdomains can use the third-party certificate authority for certificate issuance. The target issuing authority refers to the allowed third-party certificate authority specified in the CAA record. The target issuing authority of the website domain name is determined based on the authorization issuance records of the website domain name and each domain name from the parent domain name to the top-level domain name of the website domain name.
[0074] It can be understood that if the issuing authority information indicates that the issuing authority of the initial candidate certificate is the target issuing authority, that is, the initial candidate certificate meets the requirements of the trusted third-party certificate authority designated by the domain name owner, the selection of these initial candidate certificates as candidate certificates indicates that these certificates are not only technically secure, but also meet the trust requirements of the organization.
[0075] In some embodiments, if none of the initial candidate certificates are issued by a trusted third-party certificate authority designated by the domain name owner, then all initial candidate certificates will be considered candidate certificates, in which case further evaluation or additional security measures are required to ensure the trustworthiness of the certificates.
[0076] Step 103: Perform a security assessment on the candidate certificates to obtain a certificate priority score, and determine a target certificate from the candidate certificates based on the certificate priority score.
[0077] The following is a detailed description of step 103.
[0078] It is understandable that the security assessment of each candidate certificate may take into account aspects such as the credibility and reputation of the third-party certificate authority, the validity period and expiration date of the certificate, the integrity and compliance of the certificate chain, the strength and security of the encryption algorithm, the scope and restrictions of the certificate, the length of the public key and the key strength of the certificate. Weights may be assigned to each aspect and each candidate certificate may be scored based on its performance in these aspects. Based on the results of the security assessment, a certificate priority score is generated for each candidate certificate. Based on the certificate priority score, the candidate certificate with the highest certificate priority score is selected as the target certificate.
[0079] See also Figure 5 , performing a security assessment on the candidate certificates to obtain a certificate priority score, and determining a target certificate from the candidate certificates based on the certificate priority score, including the following steps 401 to 402.
[0080] Step 401, obtaining an initial certificate score obtained by performing a security assessment on a candidate certificate.
[0081] Among them, the initial certificate score includes the digital signature score, cryptographic algorithm score, algorithm strength score and key strength score.
[0082] The following is a detailed description of step 401.
[0083] It is understandable that the initial certificate score refers to the initial score obtained by evaluating the candidate certificate in terms of security and other aspects, which may include a digital signature score, a cryptographic algorithm score, an algorithm strength score, and a key strength score.
[0084] See also Figure 6 , obtaining an initial certificate score obtained by performing a security assessment on a candidate certificate, including the following steps 501 to 504.
[0085] Step 501, obtain the digital signature of the candidate certificate, and obtain the digital signature score according to the number of fields in the digital signature.
[0086] Step 502: Determine a cryptographic algorithm score based on the cryptographic algorithm of the candidate certificate.
[0087] Among them, the cryptographic algorithms include elliptic curve cryptography algorithm, large number factorization algorithm and national secret algorithm. The cryptographic algorithm score of the elliptic curve cryptography algorithm is greater than the cryptographic algorithm score of the large number factorization algorithm, and the cryptographic algorithm score of the large number factorization algorithm is greater than the cryptographic algorithm score of the national secret algorithm.
[0088] Step 503: Determine an algorithm strength score based on the strength of the hash function of the candidate certificate.
[0089] Step 504: determine a key strength score based on the strength of the public key algorithm of the candidate certificate.
[0090] Steps 501 to 504 are described in detail below.
[0091] Exemplarily, a digital signature is a digital signature added to a certificate by a third-party certificate authority or certificate issuer, and the digital signature provides a verifiable proof that a specific certificate has been submitted to at least one certificate transparency log, that is, the security of the certificate is considered to be high. The digital signature of the candidate certificate is obtained, and the number of fields of the digital signature is determined as the digital signature score. The digital signature score is determined according to the number of fields of the digital certificate. For example, when the certificate has no digital signature, the digital signature score is zero.
[0092] It is understandable that for each candidate certificate, the cryptographic algorithm used is obtained. Elliptic Curve Cryptography (ECC) is a public key cryptography algorithm based on elliptic curve mathematical theory. It uses the operation characteristics on the elliptic curve to provide security comparable to that of traditional algorithms, but uses a shorter key length, thereby providing higher efficiency and performance. The algorithm has a high score, mainly because it uses a shorter key length while providing comparable security, has high efficiency in computing and network communication, and is widely used in resource-constrained devices and network environments. The Rivest-Shamir-Adleman (RSA) algorithm is based on the product of two large prime numbers, one of which is used for encryption and the other for decryption, which ensures security. It has been verified for a long time and widely used in terms of security. However, with the development of computing technology, the RSA algorithm has a longer key length than the elliptic curve cryptography algorithm, resulting in larger computing and communication overheads. In some scenarios with limited resources or high efficiency requirements, it may not be the best choice.
[0093] For example, the national cryptographic algorithm (National SM2 public key cryptography algorithm, SM2) provides security comparable to that of the elliptic curve cryptography algorithm, but uses the national cryptography algorithm to meet the security requirements of specific countries. The national cryptographic algorithm scores low, mainly because its application scope is relatively narrow, mainly targeting the domestic security needs of specific countries, and is less used internationally.
[0094] Exemplarily, for each candidate certificate, the value of its algorithm field (signature algorithm field) is obtained, and a cryptographic algorithm score is assigned to each candidate certificate according to the type of cryptographic algorithm. For example, the scoring can be performed in the following manner: Elliptic curve cryptography algorithm: a higher score, such as 3 points; Large number factorization algorithm: a lower score, such as 2 points; National secret algorithm: a lower score, such as 1 point.
[0095] Exemplarily, the algorithm strength score is determined according to the strength of the hash function of the candidate certificate. For each candidate certificate, the value of its algorithm field (signature algorithm field) is obtained. The field contains two parts of information: the signature algorithm identifier and the hash algorithm identifier. The signature algorithm identifier indicates the specific algorithm used to generate the signature, while the hash algorithm identifier indicates the hash algorithm used to calculate the certificate content summary. The hash function is an implementation of the hash algorithm. A hash function score is assigned to each candidate certificate according to the strength setting of the hash function. For example, the score of the 32-byte hash function (SecureHash Algorithm 256-bit, SHA256) or the national secret hash function (SM3) is set to 2, which provides strong anti-collision and anti-preimage security properties; other hash functions set the score to 1.
[0096] Exemplarily, the key strength score is determined according to the strength of the public key algorithm of the candidate certificate, and the public key field (Public Key Algorithm field) in the extended field of each candidate certificate is obtained. The key strength score is set according to the strength of the cryptographic algorithm therein. For example, when the key length of the Rivest-Shamir-Adleman (RSA) algorithm is 2048 or the key length of the elliptic curve algorithm (ESDSA) / national cryptographic algorithm (SM2 public key cryptographic algorithm) is 256, the key strength score is 2, and the key strength score of other calculated scores is 1.
[0097] Step 402, weighting the initial score of the certificate based on the first weight of the digital signature score, the second weight of the cryptographic algorithm score, the third weight of the algorithm strength score and the fourth weight of the key strength score to obtain a certificate priority score, and determining a target certificate from candidate certificates based on the certificate priority score.
[0098] The first weight is greater than the second weight, and the second weight is greater than the third weight or the fourth weight.
[0099] Step 402 is described in detail below.
[0100] Exemplarily, the initial certificate score is weighted to obtain a certificate priority score, which is used to measure the priority of the candidate certificates. The target certificate is determined from the candidate certificates based on the certificate priority score. For example, the initial certificate score includes a digital signature score, a cryptographic algorithm score, an algorithm strength score, and a key strength score. The certificate priority score is calculated as follows:
[0101]
[0102] Among them, the certificate priority score is score, The various aspects of the initial certificate scoring include digital signature scoring, cryptographic algorithm scoring, algorithm strength scoring, and key strength scoring. The weights of each item in the initial certificate score include the first weight of the digital signature score, the second weight of the cryptographic algorithm score, the third weight of the algorithm strength score and the fourth weight of the key strength score. n is the number of items in the initial certificate score.
[0103] For example, refer to Table 2, which is another example of the certificate index database provided in the embodiment of the present application. The certificate index database may also include data on the certificate priority scores of each certificate, where scoreA is the certificate priority score of certificate A, scoreB is the certificate priority score of certificate B, scoreC is the certificate priority score of certificate C, scoreD is the certificate priority score of certificate D, and scoreE is the certificate priority score of certificate E.
[0104]
[0105] Table 2 Another example of a certificate index database
[0106] It is understandable that the first weight of the digital signature score is greater than the second weight of the cryptographic algorithm score, and the second weight of the cryptographic algorithm score is greater than the third weight of the algorithm strength score or the fourth weight of the key strength score. , the cryptographic algorithm score is , the algorithm strength score is , the key strength score is , where the first weight of the digital signature score is Set to 0.5, the second weight of the cryptographic algorithm score Set to 0.3, the third weight of the algorithm strength score Set to 0.1, the fourth weight of the key strength score Set to 0.1.
[0107] Through the above steps 401 to 402, a security assessment is performed on the candidate certificates to obtain an initial certificate score, which includes a digital signature score, a cryptographic algorithm score, an algorithm strength score, and a key strength score. The initial certificate score is weighted to obtain a certificate priority score. Based on the certificate priority score, a target certificate is determined from the candidate certificates. The certificate with the highest priority score can be selected as the target certificate, which has better performance in terms of security and reliability.
[0108] In some embodiments, the certificate index database contains data on the certificate support algorithm of each certificate, and a backup certificate that uses the same certificate support algorithm as the initial certificate and has risk-free risk status information can be selected as the initial candidate certificate, and then a candidate certificate is selected from the initial candidate certificates based on the issuing authority information of the backup certificate, and a security assessment is performed on the candidate certificate to obtain a certificate priority score, and a target certificate is determined from the candidate certificates based on the certificate priority score. Using certificates with the same certificate support algorithm as the initial candidate certificate can ensure that the initial candidate certificate has the same encryption strength and security level as the initial certificate, and the same verification logic and processing flow can continue to be used without large-scale code modification or adjustment.
[0109] Step 104, determine the target configuration information of the target certificate, update the certificate file configuration item according to the target configuration information, replace the initial certificate with the target certificate, and continue the communication process according to the target certificate.
[0110] Step 104 is described in detail below.
[0111] It is understandable that the target configuration information refers to specific configuration parameters or attributes required by the target certificate, including the certificate location, certificate key location, and intermediate certificate location of the target certificate.
[0112] Exemplarily, referring to Table 1, when the initial certificate is certificate A, when a risk occurs to certificate A, certificate E is selected as the target certificate, and then the information contained in the certificate location, certificate key location, and intermediate certificate location of the target certificate, i.e., certificate E, is automatically updated in the Web server with information related to the certificate profile, and then the Web server is restarted. Subsequent client communications with the Web server will use certificate E instead of certificate A for service.
[0113] Reference Figure 7 , determining the target configuration information of the target certificate, including the following steps 601 to 603.
[0114] Step 601, obtaining the certificate location and certificate key location of the target certificate from the certificate index database.
[0115] Step 602, obtain the target certificate according to the certificate location, and obtain the server private key of the corresponding issuing authority according to the certificate key location.
[0116] Step 603: Store the target certificate and the server private key in the configuration directory, and generate target configuration information based on the configuration directory.
[0117] Steps 601 to 603 are described in detail below.
[0118] It is understandable that the certificate index database is queried to obtain the certificate location and certificate key location of the target certificate, the certificate location refers to the specific path or identifier of the target certificate in the storage device, and the certificate key location refers to the location or identifier of the server private key of the issuing authority in the storage device. According to the obtained certificate location and certificate key location, the target certificate and the corresponding server private key of the issuing authority are obtained from the storage device, wherein the target certificate is specifically a certificate file (.crt file), the server private key is specifically a private key file (.key file), and sometimes there are one or more intermediate certificate files (.chain or .pem files).
[0119] Exemplarily, the newly obtained certificate file and private key file are placed in the directory specified by the Web server configuration, overwriting the old files, ensuring that the file permissions are set correctly to prevent other users from illegally accessing the private key, and generating target configuration information based on the configuration directory to update the certificate file configuration items, replace the initial certificate with the target certificate, and continue the communication process based on the target certificate.
[0120] Through steps 601 to 603, the location of the target certificate and the location of the certificate key are obtained from the certificate index database and stored in the configuration directory, which can ensure the secure storage and management of the target certificate and the server private key, and provide the required configuration information for subsequent operations. The target configuration information is generated based on the configuration directory, ensuring that the certificate file configuration items are updated according to the correct target configuration information, and replacing the initial certificate with the target certificate.
[0121] Reference Figure 8 , determining the target configuration information of the target certificate also includes the following steps 701 to 702.
[0122] Step 701, obtaining the intermediate certificate location from the certificate index database, and obtaining the intermediate certificate according to the intermediate certificate location.
[0123] Step 702: Store the intermediate certificate in the configuration directory and update the target configuration information.
[0124] Steps 701 to 702 are described in detail below.
[0125] It is understood that the intermediate certificate is used to build a trust chain from the server certificate to the root certificate. If the root certificate of the certificate authority is not widely trusted, you also need to install the intermediate certificate to form a certificate chain to establish user trust. If there is an intermediate certificate, it also needs to be placed in the corresponding directory and pointed to the correct path in the configuration file. Get the intermediate certificate location from the certificate index database, and get the intermediate certificate according to the intermediate certificate location. Use the protocol to download the intermediate certificate from the intermediate certificate file. The intermediate certificate is specifically an intermediate certificate file (.chain or .pem file). Save the obtained intermediate certificate file (.chain or .pem file) to the configuration directory. The configuration directory refers to a specific directory or folder used to store application or system configuration files. Update the target configuration information. The target configuration information refers to the configuration items related to the intermediate certificate stored in the target application or system. If necessary, restart the web server after updating the target configuration information so that the new SSL / TLS configuration takes effect. Subsequent communications will use the newly configured target certificate for service. Before updating, make sure to back up the old certificate and private key files to a safe location in case problems occur during the update process and need to be rolled back.
[0126] For example, reload the web server configuration or restart the service to make the new SSL / TLS configuration take effect. For Nginx server, you can use the reload Nginx configuration command with administrator privileges to reload the configuration. Verify that the target certificate is correctly configured and used. You can use a browser or a dedicated SSL checking tool to verify that the new certificate is correctly installed and used by the web server.
[0127] Through steps 101 to 104, first risk status information of the initial certificate and second risk status information of the standby certificate are obtained in real time from the certificate index database, wherein the standby certificate is related to the initial certificate, data of the certificate index database is updated in real time, and the certificate index database at least includes risk status information corresponding to the initial certificate and the standby certificate; when the first risk status information indicates that the initial certificate needs to be replaced, a candidate certificate is selected from at least one standby certificate based on the second risk status information and the information of the issuing authority of the standby certificate; a security assessment is performed on the candidate certificate to obtain a certificate priority score, a target certificate is determined from the candidate certificate based on the certificate priority score, target configuration information of the target certificate is determined, and certificate file configuration items are updated according to the target configuration information, the initial certificate is replaced with the target certificate, and according to the continuous communication process of the target certificate, the risk status information of the initial certificate and the standby certificate is obtained in real time by maintaining the certificate index database, security issues are discovered and responded to in a timely manner, a safe, effective and correctly authorized target certificate is determined based on the second risk status information, the issuing authority information of the standby certificate and the certificate priority score of the candidate certificate, and no manual intervention is required, and the initial certificate is quickly and adaptively switched to the target certificate, and the target certificate is used to replace the initial certificate for continuous communication, which can shorten the time of the encrypted communication interruption period.
[0128] See also Fig. 9 In some embodiments, step 101 may further include steps 801 to 803.
[0129] Step 801: During the initial certificate communication process, a certificate application file is generated according to configuration information.
[0130] Step 802: Send the certificate application document to at least one issuing authority different from the initial certificate.
[0131] Step 803: After receiving the signature of the issuing authority on the certificate application file based on the server private key, a backup certificate is obtained.
[0132] Steps 801 to 803 are described in detail below.
[0133] Exemplarily, during the initial certificate communication process, when the communication status is detected to be unstable, for example, the validity period of the initial certificate is checked regularly and it is checked that the validity period is close to expiration, or the certificate's validity is verified by regularly performing the certificate's heartbeat detection. Use the certificate to perform encryption, decryption or signing operations to ensure that the certificate can still be used normally. If the operation using the certificate fails or returns an error, it can be determined that the certificate status is unstable; regularly check the certificate revocation list or certificate transparency log to obtain information about whether the target certificate has been revoked or there are abnormal conditions. Monitor abnormal events related to the target certificate in real time, such as certificate expiration reminders, certificate chain error reminders, etc. Through the alarm mechanism or log records of the monitoring system, abnormal conditions in the certificate status can be discovered in a timely manner. When the communication status is detected to be unstable, a certificate application file is generated according to the configuration information. During the application process, the use of the initial certificate for communication is not affected.
[0134] It is understandable that the configuration information includes information such as the organization name, unit name, country / region, state / province, city, public key, etc. The Web server administrator runs a program on the server to generate a pair of public and private keys. The public and private key pairs are used for asymmetric encryption, where the public key is used to encrypt information and the private key is used to decrypt. The public key, private key, and related information of an entity (such as an individual, company, organizational unit, etc.) are used to create a certificate application file, namely a Certificate Signing Request (CSR), which contains the public key and some identification information, such as the organization name, department name, geographic location, domain name, and email address. The CSR file is submitted to at least one certificate authority that is different from the initial certificate authority. The certificate application file is sent to each of the at least one certificate authority that issues the initial certificate.
[0135] Exemplarily, after the receiving authority signs the certificate application file based on the server private key, a backup certificate is obtained. The signature is a digital signature generated by encrypting the certificate application file using the private key, which can verify the integrity and source of the file. The backup certificate is generated after the certificate application file is signed. The certificate application file and the digital signature form a backup certificate as a whole, which can be used as a replacement certificate when the original certificate expires or the communication status is unstable, for continuing secure communication.
[0136] Through steps 801 to 803, during the initial certificate communication process, a certificate application file is generated according to the configuration information, and the certificate application file is sent to at least one issuing authority different from the initial certificate, ensuring that the backup certificate can be used in time to update the certificate when the certificate expires or communication problems occur.
[0137] See also Fig.10The embodiment of the present application also provides a certificate adaptive switching system, which can implement the above-mentioned certificate adaptive switching method. The certificate adaptive switching system includes: a risk status information acquisition module, which is used to acquire the first risk status information of the initial certificate and the second risk status information of the standby certificate from the certificate index database in real time, wherein the standby certificate is related to the initial certificate, and the data of the certificate index database is updated in real time, and the certificate index database at least includes the risk status information corresponding to the initial certificate and the standby certificate; a candidate certificate module, which is used to select a candidate certificate from at least one standby certificate based on the second risk status information and the issuing authority information of the standby certificate when the first risk status information indicates that the initial certificate needs to be replaced; a target certificate module, which is used to perform a security assessment on the candidate certificate to obtain a certificate priority score, and determine a target certificate from the candidate certificate based on the certificate priority score; a configuration module, which is used to determine the target configuration information of the target certificate, and update the certificate file configuration item according to the target configuration information, replace the initial certificate with the target certificate, and continue the communication process according to the target certificate.
[0138] The specific implementation of the certificate adaptive switching system is basically the same as the specific implementation of the certificate adaptive switching method described above, and will not be repeated here. On the premise of meeting the requirements of the embodiment of the present application, the certificate adaptive switching system can also be provided with other functional modules to implement the certificate adaptive switching method in the above embodiment.
[0139] See also Fig.11, the embodiment of the present application also provides a certificate adaptive switching system. When the Web server uses the original certificate for communication, it applies for multiple backup certificates from a certificate authority different from the original certificate. The backup certificate application process is initiated by the Web server, a public-private key pair is generated locally, and the domain name and public key and other information are used to generate a certificate application request file, and the certificate authority is applied for. After the certificate authority reviews, it issues the certificate with its own private key and deploys the certificate to the Web server. In the figure, two backup certificates are applied to two certificate authorities different from the original certificate, so that three certificates, the original certificate and the two backup certificates, are installed on the Web server at the same time. The certificate adaptive service module contains the specific location index of the three certificates, as well as the specific status of the certificates and other information. The certificate monitoring service module promptly notifies the certificate adaptive service module of the risk status of the certificate. After perceiving the certificate risk, the risk status information of the corresponding certificate is promptly sent to the certificate adaptive module. After the certificate adaptive service module learns that the certificate in use has a risk, it selects a candidate certificate according to the issuing authority information of the backup certificate, selects a risk-free backup certificate as the target certificate according to the certificate priority score of the candidate certificate, updates the location of the backup certificate to the corresponding certificate configuration file of the Web server, and restarts the Web service. In subsequent communications with the Web client, the TLS handshake protocol will send the new certificate in the Web server to the Web client, thereby replacing the original certificate for service. The certificate adaptive service module receives the certificate risk notification from the certificate monitoring service module, updates the relevant location information of the backup certificate to the configuration items of the relevant certificates in the Web server to replace the risky original certificate configuration items. At the same time, the certificate adaptive service module also maintains a key database, which stores the relevant data information of the original certificate and the backup certificate.
[0140] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned certificate adaptive switching method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0141] See also Fig.12 , Fig.12 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0142] The processor 1201 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0143] The memory 1202 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1202 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1202, and the processor 1201 calls and executes the certificate adaptive switching method of the embodiment of this application;
[0144] Input / output interface 1203, used to implement information input and output;
[0145] The communication interface 1204 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0146] A bus 1205 that transmits information between various components of the device (e.g., the processor 1201, the memory 1202, the input / output interface 1203, and the communication interface 1204);
[0147] The processor 1201 , the memory 1202 , the input / output interface 1203 and the communication interface 1204 are connected to each other in communication within the device via the bus 1205 .
[0148] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned certificate adaptive switching method is implemented.
[0149] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0150] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0151] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0152] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0153] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0154] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0155] It should be understood that in the present application, "at least one (item)" and "several" refer to one or more, and "plurality" refers to two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0156] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0157] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0158] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0159] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0160] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A certificate adaptive switching method, characterized in that: include: Acquire in real time first risk status information of the initial certificate and second risk status information of the standby certificate from a certificate index database, wherein the standby certificate is related to the initial certificate, data of the certificate index database is updated in real time, and the certificate index database at least includes risk status information corresponding to the initial certificate and the standby certificate; When the first risk status information indicates that the initial certificate needs to be replaced, selecting a candidate certificate from at least one of the standby certificates based on the second risk status information and the issuing authority information of the standby certificate; Performing a security assessment on the candidate certificates to obtain a certificate priority score, and determining a target certificate from the candidate certificates based on the certificate priority score; Determine target configuration information of the target certificate, update certificate file configuration items according to the target configuration information, replace the initial certificate with the target certificate, and continue the communication process according to the target certificate.
2. The certificate adaptive switching method according to claim 1, characterized in that: The selecting a candidate certificate from at least one of the standby certificates based on the second risk status information and the issuing authority information of the standby certificate comprises: Acquire certificate status information of the standby certificate, the certificate status information including idle or busy; If the certificate status information indicates that there is at least one of the standby certificates in an idle state, based on the second risk status information, selecting at least one of the standby certificates without risk as an initial candidate certificate; The candidate certificate is selected from the initial candidate certificates according to the issuing authority information.
3. The certificate adaptive switching method according to claim 2, characterized in that: The selecting the candidate certificate from the initial candidate certificates according to the issuing authority information includes: Obtain the authorization issuance record of the website domain name. If the authorization issuance record does not exist, query upward level by level to obtain the authorization issuance record of at least one of the upper domain name to the top-level domain name of the website domain name, and determine the target issuing authority of the website domain name according to the authorization issuance record; If the issuing authority information indicates that the issuing authority of the initial candidate certificate is the target issuing authority, the initial candidate certificate is selected as the candidate certificate.
4. The certificate adaptive switching method according to claim 1, characterized in that: The step of performing security assessment on the candidate certificates to obtain a certificate priority score, and determining a target certificate from the candidate certificates based on the certificate priority score, comprises: Obtaining an initial certificate score obtained by performing a security assessment on the candidate certificate, the initial certificate score including a digital signature score, a cryptographic algorithm score, an algorithm strength score, and a key strength score; The initial score of the certificate is weighted based on the first weight of the digital signature score, the second weight of the cryptographic algorithm score, the third weight of the algorithm strength score, and the fourth weight of the key strength score to obtain a certificate priority score, and a target certificate is determined from the candidate certificates based on the certificate priority score, wherein the first weight is greater than the second weight, and the second weight is greater than the third weight or the fourth weight.
5. The certificate adaptive switching method according to claim 4, characterized in that: The initial certificate score obtained by performing security assessment on the candidate certificate includes: Obtaining a digital signature of the candidate certificate, and obtaining a score of the digital signature according to the number of fields in the digital signature; Determining the cryptographic algorithm score according to the cryptographic algorithm of the candidate certificate, wherein the cryptographic algorithm includes an elliptic curve cryptography algorithm, a large number factorization algorithm, and a national secret algorithm, the cryptographic algorithm score of the elliptic curve cryptography algorithm is greater than the cryptographic algorithm score of the large number factorization algorithm, and the cryptographic algorithm score of the large number factorization algorithm is greater than the cryptographic algorithm score of the national secret algorithm; determining the algorithm strength score based on the strength of the hash function of the candidate certificate; The key strength score is determined according to the strength of the public key algorithm of the candidate certificate.
6. The certificate adaptive switching method according to claim 1, characterized in that: The determining of the target configuration information of the target certificate includes: Acquire the certificate location and certificate key location of the target certificate from the certificate index database; Acquire the target certificate according to the certificate location, and acquire the server private key of the corresponding issuing authority according to the certificate key location; The target certificate and the server private key are stored in a configuration directory, and the target configuration information is generated based on the configuration directory.
7. The certificate adaptive switching method according to claim 6, characterized in that: The determining of the target configuration information of the target certificate further includes: Obtaining the intermediate certificate location from the certificate index database, and obtaining the intermediate certificate according to the intermediate certificate location; The intermediate certificate is stored in the configuration directory, and the target configuration information is updated.
8. The certificate adaptive switching method according to claim 1, characterized in that: Before acquiring the first risk status information of the initial certificate and the second risk status information of the backup certificate in real time, the method further includes: In the initial certificate communication process, generating a certificate application file according to the configuration information; Sending the certificate application document to at least one issuing authority different from the initial certificate; After receiving the signature of the certificate application file from the issuing authority based on the server private key, the standby certificate is obtained.
9. A certificate adaptive switching system, characterized in that: include: A risk status information acquisition module, used to acquire in real time the first risk status information of the initial certificate and the second risk status information of the standby certificate from a certificate index database, wherein the standby certificate is related to the initial certificate, the data of the certificate index database is updated in real time, and the certificate index database at least includes the risk status information corresponding to the initial certificate and the standby certificate; a candidate certificate module, configured to select a candidate certificate from at least one of the standby certificates based on the second risk status information and the issuing authority information of the standby certificate when the first risk status information indicates that the initial certificate needs to be replaced; A target certificate module, configured to perform a security assessment on the candidate certificates to obtain a certificate priority score, and determine a target certificate from the candidate certificates based on the certificate priority score; The configuration module is used to determine the target configuration information of the target certificate, update the certificate file configuration item according to the target configuration information, replace the initial certificate with the target certificate, and continue the communication process according to the target certificate.
10. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the certificate adaptive switching method described in any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the certificate adaptive switching method described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Controlling operation of computing devices
CN111183661A
V2X anonymous certificate management method and device in Internet of Vehicles, storage medium and equipment
CN113038417A
Certificate updating method and device, electronic equipment and storage medium
CN116647346A
Server certificate application risk detection method and device, equipment and storage medium
CN118153024A
System and method for executing consumer transactions based on credential information relating to the consumer
US10726440B1
