1e41f4b71Sopenharmony_ci# Universal Keystore Kit简介 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciUniversal Keystore Kit(密钥管理服务,下述简称为HUKS)向业务/应用提供各类密钥的统一安全操作能力,包括密钥管理(密钥生成/销毁、密钥导入、密钥证明、密钥协商、密钥派生)及密钥使用(加密/解密、签名/验签、访问控制)等功能。 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ciHUKS管理的密钥可以由业务/应用导入或调用HUKS的接口生成。同时,HUKS提供了密钥访问控制能力,确保存储在HUKS中的密钥被合法正确的访问。 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ci## 整体架构 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci如图所示,HUKS模块可以分为如下三大部分: 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci- SDK:提供密钥管理的接口供开发者调用,开发者可以根据实际业务,选择ArkTS或C API。 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci- HUKS服务层:实现密钥会话管理及存储管理。 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci- HUKS核心层:承载HUKS的核心功能,包括密钥的密码学运算、明文密钥的加解密、密钥访问控制等。 16e41f4b71Sopenharmony_ci > **说明:** 17e41f4b71Sopenharmony_ci > 对于具备安全环境(如[TEE](huks-concepts.md)、安全芯片)的系统/设备,HUKS核心层必须运行在安全环境内。由于安全环境依赖硬件支持,在开源仓中仅为模拟实现,需OEM厂商适配。 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci 22e41f4b71Sopenharmony_ci## 核心功能 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ciHUKS为开发者提供了密钥全生命周期的管理能力,其核心功能按照密钥生命周期划分如下: 25e41f4b71Sopenharmony_ci 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci### 密钥生成 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci| 功能 | 说明 | 30e41f4b71Sopenharmony_ci| -------- | -------- | 31e41f4b71Sopenharmony_ci| **[密钥生成](huks-key-generation-overview.md)** | 随机生成密钥,且在密钥的全生命周期内,其明文仅在安全环境中进行访问操作,不会将明文传递出安全环境。 | 32e41f4b71Sopenharmony_ci| **[密钥导入](huks-key-import-overview.md)** | 业务可以将外部生成的密钥导入到HUKS进行管理。 | 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci### 密钥使用 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci| 功能 | 说明 | 38e41f4b71Sopenharmony_ci| -------- | -------- | 39e41f4b71Sopenharmony_ci| **[加密/解密](huks-encryption-decryption-overview.md)** | 使用密钥将数据加密为攻击者无法理解的密文,或使用密钥将数据解密为业务可用的明文。 | 40e41f4b71Sopenharmony_ci| **[签名/验签](huks-signing-signature-verification-overview.md)** | 用于认证消息内容以及消息发送者身份的真实性。 | 41e41f4b71Sopenharmony_ci| **[密钥协商](huks-key-agreement-overview.md)** | 两个或多个实体通过协商,共同建立会话密钥。 | 42e41f4b71Sopenharmony_ci| **[密钥派生](huks-key-derivation-overview.md)** | 从一个现有密钥派生出一个或多个新密钥。 | 43e41f4b71Sopenharmony_ci| **[访问控制](huks-identity-authentication-overview.md)** | 确保存储在HUKS中的密钥,不会被越权访问。 | 44e41f4b71Sopenharmony_ci 45e41f4b71Sopenharmony_ci 46e41f4b71Sopenharmony_ci### 密钥删除 47e41f4b71Sopenharmony_ci 48e41f4b71Sopenharmony_ci| 功能 | 说明 | 49e41f4b71Sopenharmony_ci| -------- | -------- | 50e41f4b71Sopenharmony_ci| **[密钥删除](huks-delete-key-arkts.md)** | 安全地删除存储在HUKS中的密钥数据。 | 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci### 密钥证明 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci| 功能 | 说明 | 56e41f4b71Sopenharmony_ci| -------- | -------- | 57e41f4b71Sopenharmony_ci| **[密钥证明](huks-key-attestation-overview.md)** | 为存储在HUKS中的非对称密钥对中的公钥签发证书,从而证明密钥的合法性(如密钥在安全环境中生成)。 | 58e41f4b71Sopenharmony_ci 59e41f4b71Sopenharmony_ci 60e41f4b71Sopenharmony_ci## 与相关Kit的关系 61e41f4b71Sopenharmony_ci 62e41f4b71Sopenharmony_ci[基于用户身份认证的密钥访问控制](huks-identity-authentication-overview.md),依赖于[User Authentication Kit(用户身份认证)](../UserAuthenticationKit/user-authentication-overview.md)。