diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index a91b54fb..ba2b0676 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -78,15 +78,16 @@ export default defineConfig({ ] }, { text: "演示教程", link: "/guide/tutorial.md" }, - { text: "版本升级", link: "/guide/install/upgrade.md" }, - { text: "切换数据库", link: "/guide/install/database.md" } + { text: "版本升级", link: "/guide/install/upgrade.md" } ] }, { text: "特性", items: [ { text: "CNAME代理校验", link: "/guide/feature/cname/index.md" }, - { text: "插件列表", link: "/guide/plugins.md" } + { text: "插件列表", link: "/guide/plugins.md" }, + { text: "多数据库支持", link: "/guide/install/database.md" }, + { text: "开放接口", link: "/guide/open/index.md" } ] }, { diff --git a/docs/guide/open/images/1.png b/docs/guide/open/images/1.png new file mode 100644 index 00000000..3f89ee5e Binary files /dev/null and b/docs/guide/open/images/1.png differ diff --git a/docs/guide/open/index.md b/docs/guide/open/index.md new file mode 100644 index 00000000..356876ab --- /dev/null +++ b/docs/guide/open/index.md @@ -0,0 +1,19 @@ +# 开放接口 +被动方式对第三方提供证书, 支持根据域名或证书id获取证书。 + +## 获取keyId和KeySecret + +![](./images/1.png) + +## 接口文档 + +https://apifox.com/apidoc/shared-2e76f8c4-7c58-413b-a32d-a1316529af44/254949529e0 + +## Token生成方法 + +header中传入x-certd-token即可调用开放接口 +1、首先从OpenKey页面生成keyId,keySecret; +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) +