获取单个CSR

更新时间:2022-12-05 16:56:33

适用产品

证书管理

接口描述

获取单个CSR

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Path 参数

参数名称描述
*idString
CSR ID

返回参数

Body 参数

参数名称描述
codeString
请求结果状态码
messageString
请求结果信息
dataQueryCsrServiceResponseData
请求结果数据
idString
CSR ID
nameString
csr名称,不能重复
algorithmString
密钥算法:RSA/EC 二选一
csr-fileString
CSR内容
domainString
主域名
sansList
备份域名列表
commentString
备注
countryString
国家地区
stateString
cityString
城市
companyString
公司
departmentString
部门

错误码

错误代码(code)描述(message)HTTP状态码语义
0success202请求成功
26939999We encountered an internal error. Please try again.500系统发生错误
26938018The accept header specified in your request is not acceptable.406Accept请求头不支持,接口仅支持json和xml格式,默认为json格式

示例

JSON
JSON
请求示例
复制代码 复制成功
#!/bin/bash
username="example_username"
apiKey="example_apiKey"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://open.chinanetcenter.com/api/csr-manage/csr/13" \
-X "GET" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-H "Content-Type:application/json"
返回示例
复制代码 复制成功
HTTP/1.1 202 OK
Date: Fri, 17 May 2017 06:33:26 GMT
Content-Type: application/json;charset=utf-8
x-cnc-request-id:c54cbbb4-19fe-407a-930c-3988b62ed2fd
{
  "code": "0",
  "message": "success",
  "data":
    {"name":"csr test1",
     "id":"13",
     "comment":"aaaa",
     "algorithm":"RSA",
     "csr-file":"csr text",
     "domain":"www.123.com",
     "sans":["aaa.com","bbb.com"],
	 "country":"cn",
	 "state":"fj",
	 "city":"xm",
	 "company":"ws",
	 "department":"cdn"
    }  
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!