certd/docs/guide/open/index.md

30 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 开放接口
被动方式对第三方提供证书, 支持根据域名或证书id获取证书。
## 获取keyId和KeySecret
![](./images/1.png)
## 接口文档
https://apifox.com/apidoc/shared-2e76f8c4-7c58-413b-a32d-a1316529af44/254949529e0
## Token生成方法
header中传入x-certd-token即可调用开放接口
1、首先从OpenKey页面生成keyIdkeySecret
2、准备一个content( json字符串) content={"keyId":keyId, t:时间戳秒数, encrypt:false, signType:"md5"} `// encrypt返回结果是否加密`
3、将content加上keySecret进行签名 sign = md5(content + keySecret)
4、然后将content和sign分别base64后用.号连接: x-certd-token = base64(content) +"."+base64(sign)
## SDK
待开发
## 客户端工具
### SSL-Assistant
`SSL Assistant` 是一个基于 Go 语言开发的跨平台证书部署管理助手。
支持自动扫描主机`Nginx`配置然后从Certd拉取证书并部署。
在不想暴露ssh主机密码情况下该工具非常好用。
开源地址: https://github.com/Youngxj/SSL-Assistant