Universal Keystore Kit (referred to as HUKS) provides applications and services with unified secure key operations, including key management (key generation/destruction, key import, key attestation, key agreement, and key derivation) and key use (encryption/decryption, signing/signature verification, and access control).
Keys managed by HUKS can be imported by services/apps or generated by calling HUKS APIs. In addition, HUKS provides key access control to ensure that keys stored in HUKS are accessed legally and correctly.
The HUKS module consists of the following:
SDK: provides key management APIs. You can use ArkTS or C APIs based on your services.
HUKS service layer: implements key session management and storage management.
HUKS core layer: implements core functionalities, including cryptographic operations, encryption and decryption, and key access control.
For systems and devices that have a secure environment (for example, TEE), the HUKS core layer must run within the secure environment.

HUKS provides the following key management functionalities throughout their lifecycle.
| Functionality | Description |
|---|---|
| Key generation | Generates a key randomly. During the lifecycle of the key, the plaintext of the key can be accessed only in the secure environment and cannot be exposed out of the secure environment. |
| Key import | Imports an externally generated key to HUKS for management. |
| Function | Description |
|---|---|
| Encryption/Decryption | Uses a key to encrypt data into ciphertext that attackers cannot understand, or uses a key to decrypt data into plaintext available to services. |
| Signing/Signature Verification | Used to authenticate the authenticity of message content and the identity of the message sender. |
| Key Agreement | Two or more entities establish a session key through negotiation. |
| Key Encapsulation | Securely establishes a shared key between two parties through asymmetric keys, supporting post-quantum cryptographic algorithms. |
| Key Derivation | Derives one or more new keys from an existing key. |
| Access Control | Ensures that keys stored in HUKS are not accessed without authorization. |
| Functionality | Description |
|---|---|
| Key attestation | Issues a certificate for the public key in an asymmetric key pair stored in HUKS to prove the validity of the key (the key is generated in a secure environment). |
This kit supports the Emulator, but there are some differences in feature support between real devices and the Emulator: