证书管理
获取单个CSR
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
id | String | 是 | CSR ID |
参数名称 | 类型 | 描述 |
---|---|---|
code | String | 请求结果状态码 |
message | String | 请求结果信息 |
data | QueryCsrServiceResponseData | 请求结果数据 |
id | String | CSR ID |
name | String | csr名称,不能重复 |
algorithm | String | 密钥算法:RSA/EC 二选一 |
csr-file | String | CSR内容 |
domain | String | 主域名 |
sans | List | 备份域名列表 |
comment | String | 备注 |
country | String | 国家地区 |
state | String | 州 |
city | String | 城市 |
company | String | 公司 |
department | String | 部门 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
0 | success | 202 | 请求成功 |
26939999 | We encountered an internal error. Please try again. | 500 | 系统发生错误 |
26938018 | The accept header specified in your request is not acceptable. | 406 | Accept请求头不支持,接口仅支持json和xml格式,默认为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" } }