# 生成本地（不安全）根密钥和证书

版本 3（v3 和 v3\_attest）扩展定义证书格式并建立证书颁发机构 (CA)。此过程允许您创建具有 v3 扩展设置的特定属性和约束的本地 CA，从而允许您颁发用于测试和开发目的的证书。

按照以下步骤生成本地根密钥和证书。

1. 要创建 `opensslroot.cfg` 文件，请参阅[示例 OpenSSL 配置](https://docs.qualcomm.com/doc/80-70018-11SC/topic/appendix-openssl-configuration.html#appendix-openssl-configuration)。
2. 要创建 `v3.ext` 和 `v3_attest.ext` 扩展，请使用以下方法：

    - `v3.ext`：此扩展可在 [/docs/manmaster/man5/x509v3_config.html (OpenSSL.org)](https://www.openssl.org/docs/manmaster/man5/x509v3_config.html) 中找到，并包含以下设置：

authorityKeyIdentifier=keyid,issuer
            subjectKeyIdentifier=hash
            basicConstraints=CA:true,pathlen:0
            keyUsage=keyCertSign
            Copy to clipboard
    - `v3_attest.ext`：此扩展可在 [/docs/manmaster/man5/x509v3_config.html (OpenSSL.org)](https://www.openssl.org/docs/manmaster/man5/x509v3_config.html) 中找到，并包含以下设置：

authorityKeyIdentifier=keyid,issuer
            basicConstraints=CA:FALSE,pathlen:0
            keyUsage=digitalSignature
            extendedKeyUsage=codeSigning
            Copy to clipboard
3. 准备环境，创建一个名为 OEM-KEYS 的目录，以便在一个位置生成所有证书和密钥。

    - 对于 Linux，请使用以下命令：

cd /path/to/sectools/$ mkdir ./OEM-KEYS &&
            cp /download/opensslroot.cfg ./OEM-KEYS &&
            cp /download/v3.ext ./OEM-KEYS &&
            cp /download/v3_attest.ext ./OEM-KEYS
            Copy to clipboard
    - 对于 Windows，将 `opensslroot.cfg`、`v3.ext` 和 `v3_attest.ext` 复制至 OEM-KEYS 目录。

支持的算法包括：

- Rivest-Shamir-Adleman (RSA) 签名算法
- 椭圆曲线数字签名算法 (ECDSA)

## 后续步骤

- 为通过提供更强大的加密保护和更好的性能来增强设备安全性，您必须生成 ECDSA 根密钥和证书。有关更多信息，请参阅[生成 ECDSA 根密钥和证书](https://docs.qualcomm.com/doc/80-70018-11SC/topic/generate-ecdsa-root-key-and-certificate.html#generate-ecdsa-root-key-and-certificate)。
- 要允许客户端应用程序安全地进行身份验证并启用加密通信，请参阅[生成 RSA CA 密钥对和证书](https://docs.qualcomm.com/doc/80-70018-11SC/topic/generate-rsa-root-ca-key-pair-and-certificate.html#generate-rsa-root-ca-key-pair-and-certificate)。

Last Published: Apr 29, 2025

[Previous Topic
QFPROM 熔丝](https://docs.qualcomm.com/bundle/publicresource/80-70018-11SC/topics/appendix-fuse-configurations.md) [Next Topic
生成 ECDSA 根密钥和证书](https://docs.qualcomm.com/bundle/publicresource/80-70018-11SC/topics/generate-ecdsa-root-key-and-certificate.md)