证书管理
根据证书ID查看证书详情。
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
certificateId | Integer | 是 | 指定要查询的证书ID,在URI上 |
参数名称 | 类型 | 描述 |
---|---|---|
code | Integer | 接口响应code,0代表成功。 |
message | String | 接口响应信息,success代表成功,失败则提供失败信息。 |
data | Object | 接口响应数据 |
certificateId | Integer | 证书ID。 |
name | String | 证书名称。 |
comment | String | 备注信息。 |
serial | String | 证书序列号。 |
notBefore | String | 签发时间。 |
notAfter | String | 到期时间。 |
commonName | String | 证书绑定的主域名。 |
subjectAlternativeNames | List | 证书绑定的附加域名列表。 |
subjectAlternativeName | String | 证书绑定的附加域名 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
19638021 | NO_SUCH_SSL | 400 | 证书不存在或已删除。 |
0 | success | 200 | 请求成功 |
26939999 | InternalError | 400 | 内部系统异常 |
26938005 | PARAM_INVALID | 400 | 入参证书id为空或非法 |
26939999 | NO_SUCH_SSL | 400 | 证书不存在或已删除 |
26939999 | NO_SUCH_SSL | 400 | 证书不归属当前客户 |
#!/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/certificate/{id}" \ -X "GET" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/xml" \ -H "Content-Type:application/xml"
HTTP/1.1 200 OK Date: Sun, 05 May 2019 09:08:53 GMT Content-Type: application/xml;charset=utf-8 x-cnc-request-id: 83bbebc7-2c95-47d7 <?xml version="1.0" encoding="UTF-8"?> <response> <code>0</code> <message>success</message> <data></data> </response>