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

Source: [https://docs.qualcomm.com/doc/80-70014-11Y/topic/generate-local-insecure-root-key-and-certificates.html](https://docs.qualcomm.com/doc/80-70014-11Y/topic/generate-local-insecure-root-key-and-certificates.html)

版本 3（v3 和 v3\_attest）扩展用于定义证书格式和创建 CA。

1. 创建 `opensslroot.cfg`，请参见[示例 OpenSSL 配置](https://docs.qualcomm.com/doc/80-70014-11Y/topic/appendix-openssl-configuration.html)。
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)

**Parent Topic:** [启用安全启动](https://docs.qualcomm.com/doc/80-70014-11Y/topic/enable-secure-boot.html)

Last Published: Aug 27, 2024

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