A certificate private key secure storage method based on a national secret SM4 algorithm

By using a two-layer constrained Markov logic encapsulation structure and ciphertext mixing control based on the national cryptographic SM4 algorithm, the fragmented encrypted storage and call verification of certificate private keys are realized, which solves the problem of the separation between private key storage and call control in the existing technology and improves the security and binding strength of private keys.

CN122348827APending Publication Date: 2026-07-07BEIJING ZHONGYU YONGXIN NETWORK TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING ZHONGYU YONGXIN NETWORK TECH CO LTD
Filing Date
2026-05-26
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing certificate private key storage methods pose risks such as exposure of keys in plaintext, copying and migration of ciphertext, unauthorized unsealing, and abnormal calls. Furthermore, storage protection and call control are disconnected, making it difficult to achieve fine-grained binding and dynamic key protection.

Method used

A two-layer constrained Markov logic encapsulation structure based on the national cryptographic SM4 algorithm is adopted to store the certificate private key in segments with encryption. The secure storage and retrieval of the private key are achieved by controlling the ciphertext mixing rules and encapsulation verification tags, combined with dynamic key derivation and call matching verification.

Benefits of technology

It improves the ability of certificate private keys to prevent plaintext leakage, copying and migration, and tampering and invocation, and strengthens the binding strength between the private key and the calling subject, operating environment and purpose, ensuring the security of the storage and invocation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122348827A_ABST
    Figure CN122348827A_ABST
Patent Text Reader

Abstract

The application discloses a certificate private key secure storage method based on a national secret SM4 algorithm, and comprises the following steps: obtaining a certificate private key, analyzing a private key object to be generated and extracting private key basic associated information; dividing a private key semantic segment set, configuring segment associated attributes, and forming private key encapsulation associated data; generating a secure predicate set, configuring a double-layer constraint Markov logic encapsulation structure; forming a key encapsulation control vector; deriving an SM4 segment working key, performing segment-level encryption on a private key semantic segment, and forming a private key ciphertext segment set; rearranging and decoy mixing according to a ciphertext mixing control rule, and forming a private key secure storage body; and calling a stage to obtain a private key operation data structure after matching and verification. The application improves the anti-copying migration, anti-tampering calling and controlled unsealing capabilities of the certificate private key.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information security technology, and in particular to a method for securely storing certificate private keys based on the Chinese national cryptographic algorithm SM4. Background Technology

[0002] In the field of information security technology, digital certificate private keys are core sensitive data in the processes of identity authentication, electronic signatures, business decryption, and access authorization. Existing certificate private key storage methods typically employ file storage, database storage, key container storage, or ordinary encrypted storage. Some solutions use the Chinese national cryptographic algorithm SM4 to encrypt the entire private key file, decrypting it only after password, device authentication, or authorization verification. While these methods can prevent the plaintext private key from being directly stored on disk to some extent, most solutions still treat the complete private key as a single encryption object. The ciphertext lacks fine-grained binding relationships between the private key and the certificate, the calling entity, the operating environment, and usage constraints. Even after the ciphertext is copied or migrated, there is still a risk of offline cracking and unauthorized access.

[0003] Existing solutions also suffer from a disconnect between storage protection and invocation control. After the private key is encrypted during the storage phase, the invocation phase often only performs simple identity verification or password verification, lacking joint verification of the private key encapsulation structure, fragment relationships, invocation environment, and integrity status. If the private key ciphertext, encapsulation parameters, or storage order are replaced, rearranged, or tampered with, existing methods struggle to identify abnormal states in a timely manner.

[0004] Ordinary SM4 encryption methods often use fixed keys, uniform derived parameters, or overall ciphertext structure, making it difficult to form dynamic key protection and mixed storage control for different private key fragments. This makes it impossible to fully suppress problems such as plaintext exposure of private keys, ciphertext copying and migration, unauthorized unsealing, and abnormal calls.

[0005] Therefore, how to provide a secure storage method for certificate private keys based on the national cryptographic SM4 algorithm is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] One objective of this invention is to propose a secure storage method for certificate private keys based on the national cryptographic algorithm SM4. This invention combines a two-layer constrained Markov logic encapsulation structure, dynamic key derivation, and ciphertext mixing control to achieve fragmented encrypted storage of certificate private keys, call matching verification, and controlled decryption. It has the advantages of preventing plaintext leakage, preventing copying and migration, preventing tampering and invocation, and high compliance with national cryptographic standards.

[0007] A method for securely storing certificate private keys based on the Chinese national cryptographic algorithm SM4, according to an embodiment of the present invention, includes the following steps: Obtain the certificate private key, parse it to generate a private key object, and extract the basic association information of the private key; The private key semantic fragments are divided into sets according to the private key object, fragment association attributes are configured, and the basic association information of the private key is merged to form private key encapsulated association data. A set of security predicates is generated based on the associated data encapsulated in the private key. A two-layer constraint Markov logic encapsulation structure is configured. The set of security predicates is mapped to the forced locking clause layer and the risk adjustment clause layer according to the private key unsealing constraint attribute and the private key encapsulation perturbation attribute. The coupling connection relationship between the private key fragment factor node and the SM4 derived factor node is established. The set of security predicates is input into a two-layer constrained Markov logic encapsulation structure, and the output is the deblocking determination result, risk perturbation result and fragment connection state. The key encapsulation control vector is formed through SM4 derived factor nodes. Extract key control data from the key encapsulation control vector, derive the SM4 fragment working key from the private key encapsulation associated data, and call the national cryptographic SM4 algorithm to perform fragment-level encryption on the private key semantic fragment set to form a private key ciphertext fragment set; Based on the key encapsulation control vector, the ciphertext mixing control rules are determined, the private key ciphertext fragment set is rearranged and baited, encapsulated to form a private key secure storage body, and encapsulation verification tags are configured. Upon receiving a certificate private key invocation request, a set of invocation security predicates is generated, forming an invocation key encapsulated control vector. After successful matching and verification, the private key secure storage is decrypted to obtain the private key operation data structure, thus completing the certificate private key invocation.

[0008] Optionally, the formation of the private key encapsulated associated data includes the following steps: Perform format parsing on the certificate's private key to generate a private key object; Obtain the certificate attribute data, calling subject attribute data, runtime environment attribute data, and key usage attribute data corresponding to the certificate private key, and perform standardized encoding to form the basic association information of the private key; The private key semantic fragment set is divided according to the data structure boundary of the private key object, and fragment sequence, fragment category, fragment dependency identifier and fragment verification identifier are configured to form fragment association attributes; Establish an index binding relationship between the basic association information of the private key and the association attributes of the fragment to form the private key encapsulated association data.

[0009] Optionally, the generation of the security predicate set includes the following steps: Based on the index binding relationship in the associated data encapsulated by the private key, extract the basic association items, fragment association items, and verification association items; Convert basic association terms into unsealing constraint predicates, convert fragment association terms into fragment connection predicates, and convert validation association terms into encapsulated perturbation predicates; Perform predicate merging on unsealing constraint predicates, fragment connection predicates, and encapsulation perturbation predicates to form a set of safe predicates.

[0010] Optionally, the construction of the forced locking clause layer includes the following steps: Based on the private key unsealing constraint attributes, unsealing constraint predicates are filtered from the security predicate set, and unsealing constraint predicates are assigned to the forced locking clauses according to the fragment index; Configure locking weights and constraint status bits for the forced locking clause. The locking weights are determined by the number of hits and constraint priority of certificate association, subject association, environment association, and purpose association corresponding to the unsealed constraint predicate. Perform consistency matching on the forced locking clause, generate a locking failure flag when the constraint status bit is in the miss state, and generate a locking valid flag when the constraint status bit is in the hit state; The locking constraint structure of the forced locking clause layer is formed by aggregating locking failure markers, locking validity markers, and corresponding locking weights according to the fragment index.

[0011] Optionally, the construction of the risk adjustment clause layer includes the following steps: Based on the perturbation attributes encapsulated in the private key, perturbation predicates are selected from the set of security predicates, and risk adjustment clauses are generated by mapping the fragment index and predicate source category. Based on the fragment verification identifier corresponding to the encapsulated perturbation predicate, a perturbation trigger state is generated and written into the risk adjustment clause to form a risk perturbation path; Read the fragment connection predicate from the security predicate set, and build the private key fragment factor node according to the fragment index, fragment order and fragment dependency identifier; By connecting the risk disturbance path and the private key fragment factor node to the SM4 derived factor node, a coupled connection relationship is formed where risk disturbance and fragment connection work together.

[0012] Optionally, the formation of the key encapsulation control vector includes the following steps: Read the locking constraint structure of the forced locking clause layer, and collect the locking failure flags, locking validity flags, and locking weights according to the fragment index to form the unlocking and locking results; Read the risk disturbance path in the risk adjustment clause layer, and collect the disturbance triggered state and non-triggered state according to the fragment index to form the risk disturbance result; Read the private key fragment factor nodes and fragment connection edges, and form the fragment connection state according to the fragment order and fragment dependency identifier; Input the deblocking result, risk disturbance result, and fragment connection status into the SM4 derived factor node, configure the key derivation control component, ciphertext mixing control component, and encapsulation verification control component, and combine them to form the key encapsulation control vector.

[0013] Optionally, the derivation of the SM4 segment working key includes the following steps: Read the key derivation control component from the key encapsulation control vector and filter the fragment index with the allowed derivation flag; Based on the fragment index, the corresponding private key basic association information and fragment association attributes are read from the private key encapsulated association data to form fragment derived input; The fragment-derived input and the key-derived control component are combined and encoded to form SM4 fragment-derived material; Perform key derivation processing on the SM4 fragment derived material to obtain the SM4 fragment working key for the corresponding private key semantic fragment.

[0014] Optionally, the determination of the ciphertext mixing control rules includes the following steps: Read the ciphertext mixed control components from the key-encapsulated control vector, and extract the perturbation trigger state, non-trigger state, and predicate source category according to the fragment index; An initial ciphertext fragment sequence is generated based on the fragment sequence position and fragment dependency identifier. The initial ciphertext fragment sequence is then subjected to sequence offset processing according to the perturbation trigger state to form a ciphertext fragment rearrangement sequence. The decoy fragment insertion position is determined based on the predicate source category and fragment verification identifier. The private key ciphertext fragment set is rearranged according to the ciphertext fragment rearrangement sequence, and the decoy fragment is written at the decoy fragment insertion position. Record the ciphertext fragment rearrangement sequence, the decoy fragment insertion position, the fragment index and fragment order involved in the rearrangement, and form ciphertext mixing control rules.

[0015] Optionally, the configuration of the encapsulation verification label includes the following steps: Based on the encrypted mixing control rules, the insertion position and segment verification identifier of the bait segment are read, and a bait segment verification field is generated. Write the decoy fragment verification field into the corresponding decoy fragment, perform encapsulation format verification on the set of decoy fragments and private key ciphertext fragments, and form a mixed format verification result; Generate encapsulated verification input based on the ciphertext fragment rearrangement sequence, the decoy fragment insertion position, the fragment index, the fragment sequence, and the mixed format verification result; Write the encapsulation verification input into the verification field of the private key secure storage, configure the binding relationship between the verification field and the sequence of ciphertext fragments after mixing, and form an encapsulation verification label.

[0016] Optionally, the unblocking call includes the following steps: Receive certificate private key invocation request, extract invocation subject information, invocation environment information and invocation purpose information, and generate invocation security predicate set; The set of security predicates is input into a two-layer constrained Markov logic encapsulation structure to form a call key encapsulation control vector. The key encapsulation control vector will be matched with the key encapsulation control vector, and the encapsulation verification tag will be matched with the private key secure storage body for tag verification. After the matching verification is successful, the unsealing process will begin. The private key secure storage is decrypted according to the ciphertext mixing control rules to obtain the private key operation data structure, and the certificate private key is invoked based on the private key operation data structure.

[0017] The beneficial effects of this invention are: (1) This invention divides the certificate private key into a set of private key semantic fragments and combines them with the SM4 fragment working key for fragment-level encryption, thereby avoiding the storage of the complete private key as a single ciphertext object and reducing the risk of the private key being exposed in plaintext and the entire ciphertext being copied and cracked.

[0018] (2) The present invention generates a key encapsulation control vector through a two-layer constrained Markov logic encapsulation structure. The basic association information of the private key, the fragment association attributes and the decapsulation constraints jointly participate in the key derivation, thereby improving the binding strength between the certificate private key and the calling subject, the operating environment and the usage conditions.

[0019] (3) This invention rearranges and mixes decoys in the set of private key ciphertext fragments by using ciphertext mixing control rules, configures encapsulation verification tags, and identifies abnormal fragment order, abnormal decoy position and abnormal encapsulation format during the calling stage, thereby improving the anti-tampering capability of the private key calling process. Attached Figure Description

[0020] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Fig. 1 This is an overall flowchart of a certificate private key secure storage method based on the national cryptographic SM4 algorithm proposed in this invention; Fig. 2 This is a model architecture diagram of the double-layer constrained Markov logic encapsulation structure in this invention; Fig. 3 This is a schematic diagram of the encrypted text mixing control process in this invention. Detailed Implementation

[0021] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0022] refer to Figs. 1-3 A method for securely storing certificate private keys based on the Chinese national cryptographic algorithm SM4 includes the following steps: Obtain the certificate private key, parse it to generate a private key object, and extract the basic association information of the private key; The private key semantic fragments are divided into sets according to the private key object, fragment association attributes are configured, and the basic association information of the private key is merged to form private key encapsulated association data. A set of security predicates is generated based on the associated data encapsulated in the private key. A two-layer constraint Markov logic encapsulation structure is configured. The set of security predicates is mapped to the forced locking clause layer and the risk adjustment clause layer according to the private key unsealing constraint attribute and the private key encapsulation perturbation attribute. The coupling connection relationship between the private key fragment factor node and the SM4 derived factor node is established. The set of security predicates is input into a two-layer constrained Markov logic encapsulation structure, and the output is the deblocking determination result, risk perturbation result and fragment connection state. The key encapsulation control vector is formed through SM4 derived factor nodes. Extract key control data from the key encapsulation control vector, derive the SM4 fragment working key from the private key encapsulation associated data, and call the national cryptographic SM4 algorithm to perform fragment-level encryption on the private key semantic fragment set to form a private key ciphertext fragment set; Based on the key encapsulation control vector, the ciphertext mixing control rules are determined, the private key ciphertext fragment set is rearranged and baited, encapsulated to form a private key secure storage body, and encapsulation verification tags are configured. Upon receiving a certificate private key invocation request, a set of invocation security predicates is generated, forming an invocation key encapsulated control vector. After successful matching and verification, the private key secure storage is decrypted to obtain the private key operation data structure, thus completing the certificate private key invocation.

[0023] In this embodiment, the formation of the private key encapsulated associated data includes the following steps: Perform format parsing on the certificate's private key to generate a private key object; During the formation of the private key object, the acquired certificate private key undergoes format parsing processing. This process identifies the format header, algorithm identifier field, key body field, parameter field, extended fields, and verification field within the certificate private key. Each identified field is then written into a structured record according to its type and position, forming the private key object. The private key object retains the original data structure boundaries of the certificate private key and records the sequential and hierarchical relationships between the fields, which are used for subsequent partitioning of the private key semantic fragment set.

[0024] Obtain the certificate attribute data, calling subject attribute data, runtime environment attribute data, and key usage attribute data corresponding to the certificate private key, and perform standardized encoding to form the basic association information of the private key; Certificate attribute data originates from certificate files, certificate request records, and certificate management records; calling entity attribute data originates from authentication results and authorization records; runtime environment attribute data originates from device identification collection results, storage location records, and runtime instance status; key usage attribute data originates from certificate extension fields, key usage policies, and business invocation policies. The above data undergoes standardized field naming, fixed field order, format normalization, and digest encoding to form the basic private key association information.

[0025] The private key semantic fragment set is divided according to the data structure boundary of the private key object, and fragment sequence, fragment category, fragment dependency identifier and fragment verification identifier are configured to form fragment association attributes; Private key semantic fragments are divided according to the data structure boundaries between the algorithm identifier field, key body field, parameter field, extension field, and verification field in the private key object. The division is based on field functionality and field dependencies. Each private key semantic fragment is configured with a fragment sequence number, fragment category, fragment dependency identifier, and fragment verification identifier. The fragment sequence number records the fragment recovery order, the fragment category identifies the corresponding data function, the fragment dependency identifier records the combination relationship between fragments, and the fragment verification identifier is used for subsequent fragment integrity verification.

[0026] Establish an index binding relationship between the basic association information of the private key and the association attributes of the fragment to form the private key encapsulated association data.

[0027] An index is created based on fragment sequence and fragment category. Basic private key association information is bound to fragment association attributes. Each private key semantic fragment has corresponding certificate association, subject association, environment association, and purpose association. Fragment sequence, fragment category, fragment dependency identifier, and fragment verification identifier are written into the private key encapsulation association data along with the fragment index. After the index binding is complete, private key encapsulation association data is generated. This data serves as input for subsequently generating the security predicate set and derived SM4 fragment working keys.

[0028] In this embodiment, the generation of the security predicate set includes the following steps: Based on the index binding relationship in the associated data encapsulated by the private key, extract the basic association items, fragment association items, and verification association items; The system reads the index binding relationships from the private key encapsulation association data and locates the certificate association, subject association, environment association, purpose association, and fragment association attributes corresponding to each private key semantic fragment according to the index binding relationships. The basic association items are formed by certificate association, subject association, environment association, and purpose association, which are used to characterize the binding conditions corresponding to the certificate private key when it is unsealed and invoked; the fragment association items are formed by fragment sequence, fragment category, and fragment dependency identifier, which are used to characterize the arrangement order, functional category, and dependency connection of private key semantic fragments; the verification association items are formed by fragment verification identifiers, which are used to characterize the verification basis for the private key semantic fragment to participate in the subsequent encapsulation perturbation judgment.

[0029] Convert basic association terms into unsealing constraint predicates, convert fragment association terms into fragment connection predicates, and convert validation association terms into encapsulated perturbation predicates; Logical expression processing is performed on basic associations, fragment associations, and validation associations respectively. This logical expression processing organizes the object identifiers, relation types, and relation states in the associations into predicate forms recognizable by a two-level constraint Markov logic encapsulation structure. Basic associations are converted into unencapsulated constraint predicates, fragment associations into fragment join predicates, and validation associations into encapsulated perturbation predicates.

[0030] Perform predicate merging on unsealing constraint predicates, fragment connection predicates, and encapsulation perturbation predicates to form a set of safe predicates.

[0031] During predicate merging, unsealed constraint predicates, fragment join predicates, and encapsulated perturbation predicates are categorized according to their source, type, fragment index, and constraint purpose. Duplicate predicate records are merged, and object identifiers, relation types, relation states, and fragment indexes are retained to form a secure predicate set. After the secure predicate set is formed, the private key for unsealed constraint predicates is used to unseal constraint attributes for the forced locking clause layer; the private key for encapsulated perturbation predicates is used to encapsulate perturbation attributes for the risk adjustment clause layer; and the fragment join predicates are used to record fragment join attributes as routing identifiers for subsequent clause layer and factor node mappings.

[0032] In this embodiment, the construction of the forced locking clause layer includes the following steps: Based on the private key unsealing constraint attributes, unsealing constraint predicates are filtered from the security predicate set, and unsealing constraint predicates are assigned to the forced locking clauses according to the fragment index; During the construction of the mandatory locking clause layer, unsealing constraint predicates are read from the security predicate set, and unsealing constraint predicates belonging to the same private key semantic fragment are grouped into the same clause unit according to the fragment index. Each clause unit records the fragment index, predicate source category, predicate relationship state, and locking requirement type, forming a mandatory locking clause. The locking requirement type is derived from the certificate association, subject association, environment association, and purpose association corresponding to the unsealing constraint predicate, forming certificate binding requirements, subject authorization requirements, environment consistency requirements, and purpose permission requirements, respectively.

[0033] Configure locking weights and constraint status bits for the forced locking clause. The locking weights are determined by the number of hits and constraint priority of certificate association, subject association, environment association, and purpose association corresponding to the unsealed constraint predicate. The forced locking clause determines the satisfaction of certificate binding requirements, subject authorization requirements, environment consistency requirements, and usage permission requirements based on the relational state of the unsealing constraint predicate. The number of locking requirements deemed satisfied is counted to obtain the hit count. When configuring locking weights, the hit counts for each type of locking requirement are counted separately. The hit count for each type of locking requirement is normalized relative to the total hit count to obtain the basic locking weight. The basic locking weights are then adjusted according to constraint priority. Certificate binding requirements and subject authorization requirements are admission requirements, while environment consistency requirements and usage permission requirements are scenario requirements. When the hit counts are the same, the locking weight for admission requirements is higher than that for scenario requirements.

[0034] Perform consistency matching on the forced locking clause, generate a locking failure flag when the constraint status bit is in the miss state, and generate a locking valid flag when the constraint status bit is in the hit state; The locking requirements in the mandatory locking clause are matched against the conditions for fulfillment. If any locking requirement is not met, the constraint status bit is set to a miss state, generating a locking failure flag; if all locking requirements are met, the constraint status bit is set to a hit state, generating a locking validity flag. The locking failure flag indicates that the corresponding private key semantic fragment does not meet the unlocking admission conditions, while the locking validity flag indicates that the corresponding private key semantic fragment meets the unlocking admission conditions.

[0035] The locking constraint structure of the forced locking clause layer is formed by aggregating locking failure markers, locking validity markers, and corresponding locking weights according to the fragment index.

[0036] The locking constraint structure records the mandatory locking clause, locking weight, constraint status bits, locking requirement satisfaction status, and locking flag results, which are used to generate unlocking and locking results later.

[0037] In this embodiment, the construction of the risk adjustment clause layer includes the following steps: Based on the perturbation attributes encapsulated in the private key, perturbation predicates are selected from the set of security predicates, and risk adjustment clauses are generated by mapping the fragment index and predicate source category. Read the fragment index and predicate source category corresponding to the encapsulated perturbation predicate, and write encapsulated perturbation predicates with the same fragment index and the same predicate source category into the same risk adjustment clause. The risk adjustment clause uses the fragment index as the clause number, the predicate source category as the clause branch identifier, and the fragment verification identifier as the trigger judgment field, forming a risk adjustment clause record that can be called by subsequent path connections.

[0038] Based on the fragment verification identifier corresponding to the encapsulated perturbation predicate, a perturbation trigger state is generated and written into the risk adjustment clause to form a risk perturbation path; Read the fragment verification identifier from the risk adjustment clause and perform a correspondence check between the fragment verification identifier and the fragment sequence number and fragment dependency identifier under the same fragment index. If the correspondence check fails, write a disturbance trigger state to the risk adjustment clause; if the correspondence check passes, write a non-triggered state to the risk adjustment clause. Using the fragment index of the risk adjustment clause as the path start identifier, the disturbance trigger state as the path state, and the SM4 derived factor node as the path target, generate a risk disturbance path from the risk adjustment clause to the SM4 derived factor node.

[0039] Read the fragment connection predicate from the security predicate set, and build the private key fragment factor node according to the fragment index, fragment order and fragment dependency identifier; Private key fragment factor nodes are created based on fragment indexes. The fragment sequence number is written into the order field of the private key fragment factor node, and the fragment dependency identifier is written into the connection field of the private key fragment factor node. Fragment connection edges are created for private key fragment factor nodes with dependencies. The direction of the fragment connection edges is determined by the fragment dependency identifier, and the arrangement order of the fragment connection edges is determined by the fragment sequence number. Private key fragment factor nodes can represent the order and dependency relationships between private key semantic fragments.

[0040] By connecting the risk disturbance path and the private key fragment factor node to the SM4 derived factor node, a coupled connection relationship is formed where risk disturbance and fragment connection work together.

[0041] During the formation of the coupling connection, the fragment index is used as the connection key to pair the risk perturbation path with the corresponding private key fragment factor node. The risk perturbation path is connected to the perturbation input of the SM4 derived factor node, and the private key fragment factor node and fragment connection edge are connected to the fragment input of the SM4 derived factor node. The SM4 derived factor node establishes a correspondence between the perturbation input and the fragment input for the same fragment index, forming a coupling connection in which the risk perturbation path and the private key fragment factor node are jointly connected to the SM4 derived factor node.

[0042] In this embodiment, the formation of the key encapsulation control vector includes the following steps: Read the locking constraint structure of the forced locking clause layer, and collect the locking failure flags, locking validity flags, and locking weights according to the fragment index to form the unlocking and locking results; For the same segment index, if a locking failure flag exists, the corresponding unlocking and locking result will be recorded as a locking failure state; if all locking flags are valid, the corresponding unlocking and locking result will be recorded as a valid locking state. The unlocking and locking result retains the segment index, locking flag result, and locking weight.

[0043] Read the risk disturbance path in the risk adjustment clause layer, and collect the disturbance triggered state and non-triggered state according to the fragment index to form the risk disturbance result; For the same segment index, if a disturbance trigger state exists, the corresponding risk disturbance result is recorded as a disturbance trigger result; if all disturbance states are non-triggered states, the corresponding risk disturbance result is recorded as a non-triggered result. The risk disturbance result retains both the segment index and the disturbance state result.

[0044] Read the private key fragment factor nodes and fragment connection edges, and form the fragment connection state according to the fragment order and fragment dependency identifier; The arrangement of private key semantic fragments is determined based on the fragment sequence number, and the completeness of dependency connections between private key semantic fragments is determined based on the fragment dependency identifier. When the fragment sequence number is complete and the fragment dependency identifiers are consecutive, the fragment connection status is recorded as a valid connection status; when there are missing fragment sequence numbers, fragment sequence number conflicts, or broken fragment dependency identifiers, the fragment connection status is recorded as an abnormal connection status.

[0045] Input the deblocking result, risk disturbance result, and fragment connection status into the SM4 derived factor node, configure the key derivation control component, ciphertext mixing control component, and encapsulation verification control component, and combine them to form the key encapsulation control vector.

[0046] The SM4 derived factor node receives the deblocking determination result, risk perturbation result, and fragment connection status according to the fragment index. For fragment indices with a deblocking determination result indicating a valid lock, the fragment index, lock weight, and allow-derivation flag are written into the key derivation control component; for fragment indices with a deblocking determination result indicating a lock failure, the fragment index and lock failure flag are written into the key derivation control component. For fragment indices with a risk perturbation result indicating a perturbation trigger result, the fragment index, perturbation trigger status, and predicate source category are written into the ciphertext mixing control component; for fragment indices with a risk perturbation result indicating a non-triggered result, the fragment index and non-triggered status are written into the ciphertext mixing control component. For fragment indices with a fragment connection status indicating a valid connection, the fragment index, fragment sequence, and fragment dependency identifier are written into the encapsulation verification control component; for fragment indices with a fragment connection status indicating a connection error, the fragment index and connection error flag are written into the encapsulation verification control component. The key derivation control component, ciphertext mixing control component, and encapsulation verification control component under the same fragment index are combined to form the key encapsulation control vector.

[0047] In this embodiment, the derivation of the SM4 segment working key includes the following steps: Read the key derivation control component from the key encapsulation control vector and filter the fragment index with the allowed derivation flag; Fragment indexes with a "Derivation Allowed" flag are used to enter the SM4 fragment working key derivation process, while fragment indexes with a "Lock Failed" flag are not used to enter the SM4 fragment working key derivation process.

[0048] Based on the fragment index, the corresponding private key basic association information and fragment association attributes are read from the private key encapsulated association data to form fragment derived input; Based on the fragment index with the allowed derivation flag, the corresponding private key basic association information and fragment association attributes are read from the index binding relationship of the private key encapsulated associated data. The private key basic association information is used to limit the binding source of the certificate private key, and the fragment association attributes are used to limit the fragment sequence, fragment category, fragment dependency identifier, and fragment verification identifier of the corresponding private key semantic fragment. After reading, the private key basic association information and fragment association attributes under the same fragment index are aggregated into fragment derivation input.

[0049] The fragment-derived input and the key-derived control component are combined and encoded to form SM4 fragment-derived material; The combined encoding is written into the fragment index, private key basic association information, fragment association attributes, lock weight, and allowed derivation flag in a fixed field order to form SM4 fragment derivation material. Different fragment indices correspond to different field contents, forming different SM4 fragment derivation materials.

[0050] Perform key derivation processing on the SM4 fragment derived material to obtain the SM4 fragment working key for the corresponding private key semantic fragment.

[0051] The SM4 fragment derived material is input into the key derivation function, which outputs a fixed-length key material. Key bytes of the corresponding length are extracted from the fixed-length key material according to the SM4 algorithm's key length requirements to form the SM4 fragment working key. Each SM4 fragment working key is bound to a corresponding fragment index and is only invoked during the encryption of the corresponding private key semantic fragment. After encryption, it is cleared from the temporary storage space.

[0052] In this embodiment, the determination of the ciphertext mixing control rules includes the following steps: Read the ciphertext mixed control components from the key-encapsulated control vector, and extract the perturbation trigger state, non-trigger state, and predicate source category according to the fragment index; The perturbation-triggered state is used to mark private key ciphertext fragments that need to participate in the sequence offset processing, while the non-triggered state is used to mark private key ciphertext fragments that maintain their original sequence. The predicate source category is used to determine the selection criteria for the subsequent decoy fragment insertion position.

[0053] An initial ciphertext fragment sequence is generated based on the fragment sequence position and fragment dependency identifier. The initial ciphertext fragment sequence is then subjected to sequence offset processing according to the perturbation trigger state to form a ciphertext fragment rearrangement sequence. First, the set of private key ciphertext fragments is sorted according to the fragment order to form an initial ciphertext fragment sequence. Then, the fragment dependency identifier is read, and the dependency order is set to maintain the relationship for private key ciphertext fragments with dependencies. Subsequently, the initial ciphertext fragment sequence is processed by order offset according to the perturbation trigger state. The fragment index that triggers the perturbation is moved to the new storage order, while maintaining the connection order corresponding to the fragment dependency identifier, thus forming a ciphertext fragment rearrangement sequence.

[0054] The decoy fragment insertion position is determined based on the predicate source category and fragment verification identifier. The private key ciphertext fragment set is rearranged according to the ciphertext fragment rearrangement sequence, and the decoy fragment is written at the decoy fragment insertion position. The decoy fragment insertion region is determined based on the predicate source category, and the specific insertion position within the decoy fragment insertion region is determined based on the fragment verification identifier, thus forming the decoy fragment insertion position. The decoy fragment is generated according to the same encapsulation field format as the private key ciphertext fragment, and carries an independent verification field, not corresponding to a private key semantic fragment. After rearranging the private key ciphertext fragment set according to the ciphertext fragment rearrangement sequence, the decoy fragment is written at the decoy fragment insertion position, forming the mixed ciphertext fragment sequence.

[0055] Record the ciphertext fragment rearrangement sequence, the decoy fragment insertion position, the fragment index and fragment order involved in the rearrangement, and form ciphertext mixing control rules.

[0056] The ciphertext fragment rearrangement sequence, decoy fragment insertion position, fragment index and fragment order involved in the rearrangement are recorded to form ciphertext mixing control rules. These rules control the storage order of the private key ciphertext fragment set in the private key secure storage and the write position of the decoy fragments, serving as the basis for identifying the mixing structure when the private key secure storage is subsequently decrypted.

[0057] In this embodiment, the configuration of the encapsulation verification label includes the following steps: Based on the encrypted mixing control rules, the insertion position and segment verification identifier of the bait segment are read, and a bait segment verification field is generated. The decoy fragment insertion position, fragment verification identifier, and the order of the decoy fragment in the hybrid ciphertext fragment sequence are combined to generate the decoy fragment verification field. The decoy fragment verification field is used for the decoy fragment to participate in subsequent encapsulation format verification, preventing the decoy fragment from being written to the private key secure storage as filler data without verification relationship.

[0058] Write the decoy fragment verification field into the corresponding decoy fragment, perform encapsulation format verification on the set of decoy fragments and private key ciphertext fragments, and form a mixed format verification result; A unified encapsulation format verification is performed on the written set of decoy fragments and private key ciphertext fragments. Encapsulation format verification includes fragment field length verification, fragment field position verification, fragment sequence continuity verification, decoy fragment insertion position verification, and fragment verification field existence verification. After verification, a mixed-format verification result is generated, which records whether the mixed-format ciphertext fragment sequence meets the encapsulation format requirements of the private key secure storage.

[0059] Generate encapsulated verification input based on the ciphertext fragment rearrangement sequence, the decoy fragment insertion position, the fragment index, the fragment sequence, and the mixed format verification result; The encrypted fragment rearrangement sequence, decoy fragment insertion position, fragment index participating in the rearrangement, fragment order, and mixed format verification result are written according to a fixed field order to form the encapsulation verification input. The encapsulation verification input is used to characterize the fragment rearrangement structure, decoy fragment writing position, and mixed format status in the private key secure storage.

[0060] Write the encapsulation verification input into the verification field of the private key secure storage, configure the binding relationship between the verification field and the sequence of ciphertext fragments after mixing, and form an encapsulation verification label.

[0061] The verification field and the mixed ciphertext fragment sequence reside within the same private key secure storage. Based on the fragment index, fragment sequence, decoy fragment insertion position, and ciphertext fragment rearrangement sequence in the encapsulation verification input, a binding relationship is established between the verification field and the mixed ciphertext fragment sequence. After the verification field and the mixed ciphertext fragment sequence are bound, an encapsulation verification tag is formed. This tag is used during the certificate private key retrieval phase to verify whether the fragment order, decoy fragment position, and fragment encapsulation format within the private key secure storage remain consistent.

[0062] In this embodiment, the unblocking call includes the following steps: Receive certificate private key invocation request, extract invocation subject information, invocation environment information and invocation purpose information, and generate invocation security predicate set; The calling entity information includes the entity identifier, permission flag, and session identifier that initiate the call; the calling environment information includes the device identifier, storage location identifier, and runtime environment summary at the time of initiating the call; and the calling purpose information includes the signature purpose identifier, authentication purpose identifier, and decryption purpose identifier corresponding to this call.

[0063] Following the predicate organization method of the security predicate set, the calling entity information, calling environment information, and calling purpose information are organized into unsealing constraint predicates corresponding to the calling phase. The fragment index and fragment verification identifier corresponding to the certificate private key calling request are organized into fragment connection predicates and encapsulation perturbation predicates corresponding to the calling phase. These unsealing constraint predicates, fragment connection predicates, and encapsulation perturbation predicates corresponding to the calling phase are then merged to form the calling security predicate set. The calling security predicate set has the same predicate type structure as the security predicate set and is used to subsequently form the calling key encapsulation control vector.

[0064] The set of security predicates is input into a two-layer constrained Markov logic encapsulation structure to form a call key encapsulation control vector. The invocation key encapsulation control vector is formed following the same processing path as the key encapsulation control vector. The invocation key encapsulation control vector includes the key derivation control component, the ciphertext mixing control component, and the encapsulation verification control component corresponding to the invocation phase, and is used to match the key encapsulation control vector formed during the storage encapsulation phase.

[0065] The key encapsulation control vector will be matched with the key encapsulation control vector, and the encapsulation verification tag will be matched with the private key secure storage body for tag verification. After the matching verification is successful, the unsealing process will begin. The key encapsulation control vector is matched against the key encapsulation control vector. This matching includes the correspondence between fragment indices, key derivation control components, ciphertext mixing control components, and encapsulation verification control components. The encapsulation verification tag is then used to verify the private key secure storage, confirming that the fragment order, decoy fragment position, and fragment encapsulation format in the private key secure storage match the binding relationships recorded in the encapsulation verification tag. If both vector matching and tag verification pass, the unsealing process begins; if either verification fails, the certificate private key access is blocked.

[0066] The private key secure storage is decrypted according to the ciphertext mixing control rules to obtain the private key operation data structure, and the certificate private key is invoked based on the private key operation data structure.

[0067] Based on the ciphertext mixing control rules, the rearranged sequence of ciphertext fragments, the insertion position of decoy fragments, fragment indices, and fragment sequence numbers are read. The mixed structure in the secure private key storage is then restored to obtain fragment data that can participate in private key operations. The fragment data is combined according to the fragment sequence number and fragment dependency identifier to form the private key operation data structure. Certificate private key invocation performs signature, authentication, and decryption operations based on the private key operation data structure, outputting the corresponding operation results.

[0068] Example 1: To verify the feasibility of this invention in practice, it was applied to a certificate private key storage and retrieval scenario in a certificate management platform. This platform provides identity authentication, electronic signature, and data decryption services for business applications. The original approach was as follows: after the certificate private key was generated, it was stored as a complete private key file in a key container and encrypted using a unified SM4 key. When a business application retrieved the certificate private key, the platform verified the identity and password of the calling entity, then decrypted the private key ciphertext to complete the signature or decryption operation. This method avoids the private key being stored in plaintext for a long time, but the complete private key ciphertext still exists as a single object. The binding strength between the ciphertext and the calling entity, operating environment, and purpose of the call is insufficient. When the ciphertext is copied and migrated, the calling entity's permissions change, the purpose conditions change, or the stored content is modified, the original method mainly relies on the outer password and basic verification, making it difficult to perform fine-grained control over the private key encapsulation structure.

[0069] In this scenario, the present invention first parses the imported certificate private key to form a private key object. Then, it divides the private key semantic fragment set according to the data structure boundaries between the algorithm identifier field, key subject field, parameter field, and verification field in the private key object. Each private key semantic fragment is configured with fragment sequence, fragment category, fragment dependency identifier, and fragment verification identifier. The certificate private key is no longer encrypted as a complete file, but enters the subsequent encapsulation process as a fragmented structure. Subsequently, the certificate association, subject association, environment association, purpose association, and fragment association attributes are written into the private key encapsulation association data, and a set of security predicates is generated based on the private key encapsulation association data. The two-layer constraint Markov logic encapsulation structure forms a forced locking clause layer based on the unsealing constraint predicates and a risk adjustment clause layer based on the encapsulation perturbation predicates. At the same time, fragment connection predicates are used to establish private key fragment factor nodes. The certificate private key is simultaneously constrained by the subject, environment, purpose, fragment dependency, and verification relationships during encapsulation.

[0070] The private key storage process involves the SM4 derivation factor node reading the decryption and locking results, risk perturbation results, and fragment connection status to form a key encapsulation control vector. The platform filters allowed fragment indices for derivation based on this control vector, combines the key derivation control component with the private key encapsulation association data to form fragment derivation input, and then derives the SM4 fragment working keys corresponding to different private key semantic fragments. Each private key semantic fragment is encrypted using its corresponding SM4 fragment working key, forming a set of private key ciphertext fragments. Subsequently, the platform rearranges the private key ciphertext fragment set according to ciphertext mixing control rules, writing decoy fragments at positions determined by the predicate source category and fragment verification identifier. The decoy fragments use the same encapsulation field format as the private key ciphertext fragments and are written into the decoy fragment verification field. Therefore, the private key secure storage not only includes ciphertext protection but also fragment rearrangement, decoy mixing, and encapsulation verification relationships. Finally, the platform writes the ciphertext fragment rearrangement sequence, the decoy fragment insertion position, the fragment index, the fragment sequence, and the mixed format verification result into the verification field to form an encapsulated verification label, which together with the mixed ciphertext fragment sequence constitutes the private key secure storage body.

[0071] During the certificate private key invocation process, after the business application initiates a call request, the platform extracts the call subject information, call environment information, and call purpose information from the call request, generates a set of call security predicates, and inputs a two-layer constrained Markov logic encapsulation structure to form a call key encapsulation control vector. The platform matches the call key encapsulation control vector with the key encapsulation control vector formed during the storage phase, and uses encapsulation verification tags to verify whether the fragment order, decoy fragment position, and fragment encapsulation format in the private key secure storage are consistent. Only when the call subject, operating environment, call purpose, and encapsulation verification all meet the matching conditions, does the platform restore the hybrid structure according to the ciphertext hybridization control rules, perform fragment-level decryption on the allowed decapsulated ciphertext fragments, and combine them into a private key operation data structure according to the fragment sequence and fragment dependency identifier. The business application can only obtain the signature result, authentication result, or decryption result, and cannot obtain the plaintext certificate private key.

[0072] The verification process selected the same number of certificate private key samples and the same scale of call requests for testing. The ordinary SM4 overall encryption storage method uses complete private key encryption, password verification, and basic integrity verification; this invention uses private key semantic fragment encryption, key encapsulation control vector, ciphertext mixing control rules, and encapsulation verification tags. The tests covered normal calls, ciphertext migration, authorization control, usage consistency, storage integrity, and continuous call stability. The results show that this invention improves ciphertext migration protection, authorization call control, usage consistency verification, and storage integrity verification capabilities while maintaining a relatively stable normal call success rate. For the copied and migrated private key secure storage, the platform will not enter the effective decapsulation process because the call key encapsulation control vector cannot be consistent with the key encapsulation control vector formed during the storage stage; for the private key secure storage with a modified storage structure, the platform can identify the encapsulation structure change because the encapsulation verification tag cannot maintain a correspondence with the mixed ciphertext fragment sequence. As shown in Table 1, this invention outperforms the ordinary SM4 overall encryption storage method in all security control indicators, while maintaining a similar normal call success rate, indicating that this invention can meet the certificate private key call requirements while enhancing private key security.

[0073] Table 1. Comparison of Certificate Private Key Security Storage and Access Control Effects

[0074] As shown in Table 1, regarding ciphertext migration protection, the protection rate of the ordinary SM4 overall encryption storage method is 78.4%, while the method of this invention improves it to 98.2%. This result indicates that although the ordinary method encrypts the complete private key, the ciphertext exists as a single object. Once copied to another operating environment and given the corresponding calling conditions, it can still be decrypted and used. This invention matches the calling key encapsulation control vector with the storage stage key encapsulation control vector, forming a stronger binding between the private key ciphertext and the calling subject, operating environment, and usage conditions. The copied and migrated storage is difficult to pass the calling stage verification.

[0075] In terms of authorized call control and usage consistency verification, this invention achieves 98.8% and 97.9% respectively, representing improvements of 12.5 and 14.3 percentage points compared to conventional methods. This result demonstrates the effectiveness of the two-layer constraint Markov logic encapsulation structure: the unsealing constraint predicate, the forced locking clause layer, and the call security predicate set all participate in the call phase judgment. Changes in the caller, inconsistent call permissions, and calls deviating from their original purpose can be identified, eliminating the need to rely solely on passwords or basic identity verification to unseal the private key.

[0076] The method of this invention achieves a storage integrity verification rate of 98.3%, higher than the 78.9% of ordinary SM4 overall encryption storage methods. Ordinary methods typically only identify overall file corruption or basic verification failures, and struggle to perform fine-grained verification based on fragment order, decoy fragment positions, and changes in the mixed structure. This invention, through ciphertext fragment rearrangement, decoy fragment mixing, and encapsulation verification tags, brings the structural state of the private key secure storage body into the verification scope, improving the ability to identify instances where stored content has been replaced, rearranged, or corrupted.

[0077] Regarding the continuous call stability rate, this invention achieves 97.4%, higher than the 96.8% of the ordinary method, indicating that the fragmented encryption, control vector matching, and encapsulation verification mechanisms introduced in this invention do not cause instability in the call process. The data in the table shows that the main advantage of this invention is not simply increasing encryption strength, but rather improving the overall security of the certificate private key in both the storage and call states through a combination of "encapsulation structure control, dynamic key derivation, ciphertext mixing, and call matching verification."

[0078] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for securely storing certificate private keys based on the Chinese national cryptographic algorithm SM4, characterized in that, Includes the following steps: Obtain the certificate private key, parse it to generate a private key object, and extract the basic association information of the private key; The private key semantic fragments are divided into sets according to the private key object, fragment association attributes are configured, and the basic association information of the private key is merged to form private key encapsulated association data. A set of security predicates is generated based on the associated data encapsulated in the private key. A two-layer constraint Markov logic encapsulation structure is configured. The set of security predicates is mapped to the forced locking clause layer and the risk adjustment clause layer according to the private key unsealing constraint attribute and the private key encapsulation perturbation attribute. The coupling connection relationship between the private key fragment factor node and the SM4 derived factor node is established. The set of security predicates is input into a two-layer constrained Markov logic encapsulation structure, and the output is the deblocking determination result, risk perturbation result and fragment connection state. The key encapsulation control vector is formed through SM4 derived factor nodes. Extract key control data from the key encapsulation control vector, derive the SM4 fragment working key from the private key encapsulation associated data, and call the national cryptographic SM4 algorithm to perform fragment-level encryption on the private key semantic fragment set to form a private key ciphertext fragment set; Based on the key encapsulation control vector, the ciphertext mixing control rules are determined, the private key ciphertext fragment set is rearranged and baited, encapsulated to form a private key secure storage body, and encapsulation verification tags are configured. Upon receiving a certificate private key invocation request, a set of invocation security predicates is generated, forming an invocation key encapsulated control vector. After successful matching and verification, the private key secure storage is decrypted to obtain the private key operation data structure, thus completing the certificate private key invocation.

2. The method for securely storing certificate private keys based on the Chinese national cryptographic SM4 algorithm according to claim 1, characterized in that, The formation of the associated data encapsulated in the private key includes the following steps: Perform format parsing on the certificate's private key to generate a private key object; Obtain the certificate attribute data, calling subject attribute data, runtime environment attribute data, and key usage attribute data corresponding to the certificate private key, and perform standardized encoding to form the basic association information of the private key; The private key semantic fragment set is divided according to the data structure boundary of the private key object, and fragment sequence, fragment category, fragment dependency identifier and fragment verification identifier are configured to form fragment association attributes; Establish an index binding relationship between the basic association information of the private key and the association attributes of the fragment to form the private key encapsulated association data.

3. The method for securely storing certificate private keys based on the Chinese national cryptographic SM4 algorithm according to claim 1, characterized in that, The generation of the security predicate set includes the following steps: Based on the index binding relationship in the associated data encapsulated by the private key, extract the basic association items, fragment association items, and verification association items; Convert basic association terms into unsealing constraint predicates, convert fragment association terms into fragment connection predicates, and convert validation association terms into encapsulated perturbation predicates; Perform predicate merging on unsealing constraint predicates, fragment connection predicates, and encapsulation perturbation predicates to form a set of safe predicates.

4. The method for securely storing certificate private keys based on the Chinese national cryptographic SM4 algorithm according to claim 3, characterized in that, The construction of the forced locking clause layer includes the following steps: Based on the private key unsealing constraint attributes, unsealing constraint predicates are filtered from the security predicate set, and unsealing constraint predicates are assigned to the forced locking clauses according to the fragment index; Configure locking weights and constraint status bits for the forced locking clause. The locking weights are determined by the number of hits and constraint priority of certificate association, subject association, environment association, and purpose association corresponding to the unsealed constraint predicate. Perform consistency matching on the forced locking clause, generate a locking failure flag when the constraint status bit is in the miss state, and generate a locking valid flag when the constraint status bit is in the hit state; The locking constraint structure of the forced locking clause layer is formed by aggregating locking failure markers, locking validity markers, and corresponding locking weights according to the fragment index.

5. A method for securely storing certificate private keys based on the Chinese national cryptographic SM4 algorithm according to claim 4, characterized in that, The construction of the risk adjustment clause layer includes the following steps: Based on the perturbation attributes encapsulated in the private key, perturbation predicates are selected from the set of security predicates, and risk adjustment clauses are generated by mapping the fragment index and predicate source category. Based on the fragment verification identifier corresponding to the encapsulated perturbation predicate, a perturbation trigger state is generated and written into the risk adjustment clause to form a risk perturbation path; Read the fragment connection predicate from the security predicate set, and build the private key fragment factor node according to the fragment index, fragment order and fragment dependency identifier; By connecting the risk disturbance path and the private key fragment factor node to the SM4 derived factor node, a coupled connection relationship is formed where risk disturbance and fragment connection work together.

6. A method for securely storing certificate private keys based on the Chinese national cryptographic SM4 algorithm according to claim 1, characterized in that, The formation of the key encapsulation control vector includes the following steps: Read the locking constraint structure of the forced locking clause layer, and collect the locking failure flags, locking validity flags, and locking weights according to the fragment index to form the unlocking and locking results; Read the risk disturbance path in the risk adjustment clause layer, and collect the disturbance triggered state and non-triggered state according to the fragment index to form the risk disturbance result; Read the private key fragment factor nodes and fragment connection edges, and form the fragment connection state according to the fragment order and fragment dependency identifier; Input the deblocking result, risk disturbance result, and fragment connection status into the SM4 derived factor node, configure the key derivation control component, ciphertext mixing control component, and encapsulation verification control component, and combine them to form the key encapsulation control vector.

7. A method for securely storing certificate private keys based on the Chinese national cryptographic SM4 algorithm according to claim 1, characterized in that, The derivation of the SM4 segment working key includes the following steps: Read the key derivation control component from the key encapsulation control vector and filter the fragment index with the allowed derivation flag; Based on the fragment index, the corresponding private key basic association information and fragment association attributes are read from the private key encapsulated association data to form fragment derived input; The fragment-derived input and the key-derived control component are combined and encoded to form SM4 fragment-derived material; Perform key derivation processing on the SM4 fragment derived material to obtain the SM4 fragment working key for the corresponding private key semantic fragment.

8. A method for securely storing certificate private keys based on the Chinese national cryptographic SM4 algorithm according to claim 1, characterized in that, The determination of the ciphertext mixing control rules includes the following steps: Read the ciphertext mixed control components from the key-encapsulated control vector, and extract the perturbation trigger state, non-trigger state, and predicate source category according to the fragment index; An initial ciphertext fragment sequence is generated based on the fragment sequence position and fragment dependency identifier. The initial ciphertext fragment sequence is then subjected to sequence offset processing according to the perturbation trigger state to form a ciphertext fragment rearrangement sequence. The decoy fragment insertion position is determined based on the predicate source category and fragment verification identifier. The private key ciphertext fragment set is rearranged according to the ciphertext fragment rearrangement sequence, and the decoy fragment is written at the decoy fragment insertion position. Record the ciphertext fragment rearrangement sequence, the decoy fragment insertion position, the fragment index and fragment order involved in the rearrangement, and form ciphertext mixing control rules.

9. A method for securely storing certificate private keys based on the Chinese national cryptographic SM4 algorithm according to claim 8, characterized in that, The configuration of the encapsulation verification label includes the following steps: Based on the encrypted mixing control rules, the insertion position and segment verification identifier of the bait segment are read, and a bait segment verification field is generated. Write the decoy fragment verification field into the corresponding decoy fragment, perform encapsulation format verification on the set of decoy fragments and private key ciphertext fragments, and form a mixed format verification result; Generate encapsulated verification input based on the ciphertext fragment rearrangement sequence, the decoy fragment insertion position, the fragment index, the fragment sequence, and the mixed format verification result; Write the encapsulation verification input into the verification field of the private key secure storage, configure the binding relationship between the verification field and the sequence of ciphertext fragments after mixing, and form an encapsulation verification label.

10. A method for securely storing certificate private keys based on the Chinese national cryptographic SM4 algorithm according to claim 1, characterized in that, The unblocking process includes the following steps: Receive certificate private key invocation request, extract invocation subject information, invocation environment information and invocation purpose information, and generate invocation security predicate set; The set of security predicates is input into a two-layer constrained Markov logic encapsulation structure to form a call key encapsulation control vector. The key encapsulation control vector will be matched with the key encapsulation control vector, and the encapsulation verification tag will be matched with the private key secure storage body for tag verification. After the matching verification is successful, the unsealing process will begin. The private key secure storage is decrypted according to the ciphertext mixing control rules to obtain the private key operation data structure, and the certificate private key is invoked based on the private key operation data structure.