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

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

1. 要创建 `opensslroot.cfg` 文件，请参阅[示例 OpenSSL 配置](https://docs.qualcomm.com/doc/80-70017-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
    - 关于 Windows，将 `opensslroot.cfg`、`v3.ext` 和 `v3_attest.ext` 复制至 OEM-KEYS 目录。

支持的算法包括：

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

Last Published: Apr 27, 2025

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