Appearance
acme convert —— 转换证书格式
在本机转换证书文件格式,支持 pem / der / pfx / jks。输入可以是 CertiMan 托管的 ACME 证书(-d / -c),也可以是任意本地证书文件(位置参数)。该命令不请求 CA。
用法
bash
certiman acme convert [cert-file] [flags]参数
输入(两种方式互斥):
| 参数 / flag | 类型 | 说明 |
|---|---|---|
cert-file(位置参数) | string | 源证书文件路径;与 -d / -c 互斥 |
--domain / -d | []string | 选择器:按主域名指定托管证书 |
--conf / -c | string | 选择器:证书配置文件路径 |
--from | string | 源格式:pem / pfx / jks;省略时按源文件扩展名推断 |
--private-key | string | 配套私钥路径;仅在源文件不含私钥时需要 |
输出:
| flag | 类型 | 默认 | 说明 |
|---|---|---|---|
--to | string | 目标格式:pem / der / pfx / jks,必填 | |
--out-file | string | 单产物输出路径;与 --out-dir 互斥,两者必须提供其一 | |
--out-dir | string | 多产物输出目录;转换产生多个文件时必须使用本项 | |
--password-file | string | 源密钥库(PFX / JKS)的口令文件 | |
--target-password-file | string | 目标密钥库(PFX / JKS)的口令文件;TTY 下未提供时交互询问,非交互环境缺少口令时报错 | |
--jks-alias | string | JKS 别名 | |
--pfx-encoding | string | modern | PFX 编码:modern / legacy |
目标文件已存在时拒绝覆盖,提供 -f 强制覆盖。包含私钥的产物权限为 0600,其余为 0644。
示例
bash
# 将托管证书导出为 PFX
certiman acme convert -d example.com --to pfx \
--target-password-file /etc/certiman/pfx-password.txt \
--out-file ./example.com.pfx
# 将本地 PEM 证书与私钥打包为 PFX
certiman acme convert ./fullchain.pem --private-key ./privkey.pem \
--to pfx --target-password-file ./password.txt --out-file ./server.pfx
# 将 PFX 解包为 PEM(口令从文件读取)
certiman acme convert ./server.pfx --from pfx \
--password-file ./password.txt --to pem --out-dir ./pem-out
# 覆盖已有产物
certiman acme convert -d example.com --to der --out-file ./example.com.der -f输出
相关命令
acme issue—— 申请时通过--output.formats自动生成其它格式acme status—— 查看证书的转换记录
