> ## Documentation Index
> Fetch the complete documentation index at: https://docs.molesignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 加密密钥

> 读取并轮换组织字段加密密钥。

组织加密密钥使用 AES-256-GCM。密钥材料必须解码为准确的 32 字节，并且读取 API 永远不会返回原文。

| 方法与路径                                    | 权限                    | 用途                            |
| ---------------------------------------- | --------------------- | ----------------------------- |
| `GET /api/v1/cipher_keys`                | `org.settings.read`   | 列出密钥元数据。                      |
| `GET /api/v1/cipher_keys/{name}`         | `org.settings.read`   | 读取最新版本元数据。                    |
| `POST /api/v1/cipher_keys`               | `org.settings.manage` | 使用 `key_material_b64` 创建具名密钥。 |
| `POST /api/v1/cipher_keys/{name}/rotate` | `org.settings.manage` | 增加新版本并保留历史解密能力。               |
| `DELETE /api/v1/cipher_keys/{name}`      | `org.settings.manage` | 删除具名密钥。                       |
| `POST /api/v1/field_encryption/rotate`   | `org.settings.manage` | 生成并轮换默认字段加密 DEK。              |

<Warning>
  删除密钥前请检查加密字段依赖。详见[安全 → 字段级加密](/zh-Hans/security#字段级加密)。
</Warning>
