使用 OpenAPI 授权码 下载证书和加密私钥

使用 cmcli 进行证书和私钥下载。

下载证书示例:

macOS|Linux:

# 查看证书
$ cmcli pickup -u http://api.certcloud.cn -t  {secret_key} -a {account_id} --certid  21JfKZEE

# 下载PKCS12格式证书,需要指定加解密口令
$ cmcli pickup -u https://api.certcloud.cn -t {secret_key} -a {account_id} --format pfx --file ./test.pfx --certid 2OQqZ7vt --encrypt-pwd 1 --decrypt-pwd 1234

参数基本介绍

名称 描述 示例
cert-file 用于为证书文件的存放位置指定文件名和路径 --cert-file /path-to/example.crt
chain-file 用于指定输出证书链的名称和位置,该文件将只包含与证书相关联的根证书和中间证书 --chain-file /path-to/chain.pem
file 用于指定将包含私钥和证书的输出文件的名称和位置, 不能与 --key-file, --cert-file, --chain-file 共同使用 --file /path-to/example.pfx
format 用于指定输出格式, 支持 pem, jks, pfx, 默认pem。使用PKCS#12格式必须以’--file’选项来指定密钥存储库路径 --format pfx
key-file 用于为仅包含私钥文件的存放位置指定名称和路径 --key-file /path-to/key.pem
certid 用于指定要取回证书的ID --certid ANDJWsd8
t, token 证书管理云服务器的访问令牌, 在 CertCloud 管理平台上, 由管理员创建 -t Ab01Cd23Ef45Uv67Wx89Yz==
a, account 用于指定使用证书自动化的身份标识,在 CertCloud 管理平台上进行绑定,具体详情 -a vWEfco21
u, url 证书自动化 OpenAPI 服务 -u https://api.certcloud.cn
October 22, 2020