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

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

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

1. 要创建 `opensslroot.cfg` 文件，参见[示例 OpenSSL 配置](https://docs.qualcomm.com/doc/80-70015-11SC/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-70015-11SC/topic/enable-secure-boot.html)

Last Published: Dec 03, 2024

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