证书管理
修改客户证书,可重新上传证书。
单用户调用频率:300/5min
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
certificateId | Integer | 是 | 需要修改的证书id |
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
name | String | 是 | 证书名称 |
certificate | String | 是 | 证书内容,PEM格式,包含CRT文件、CA文件。例如: -----BEGIN CERTIFICATE----- …… -----END CERTIFICATE----- |
privateKey | String | 是 | 证书密钥,PEM格式。例如: -----BEGIN RSA PRIVATE KEY----- …… -----BEGIN RSA PRIVATE KEY----- |
csrId | Integer | 否 | csrId,证书申请文件的id |
comment | String | 否 | 备注信息 |
参数名称 | 类型 | 描述 |
---|---|---|
code | String | 接口响应code,0代表成功。 |
message | String | 接口响应信息,success代表成功,失败则提供失败信息。 |
data | String | 接口响应数据 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
0 | success | 200 | 调用成功 |
26938005 | Parameter name is required | 400 | 证书名称不允许为空 |
26938005 | Parameter name max size is 512 | 400 | 证书名称不允许超过512个字符 |
26938005 | Parameter certificate is required | 400 | 证书文件内容必传 |
26938005 | Parameter comment max size is 1024 | 400 | 备注不允许超过1024个字符 |
26939999 | The certificate you provided is invalid. | 400 | certificateId不是整数型 |
36540130 | certContent is empty. | 400 | 请求参数的sslCertificate为空 |
36540131 | bad request.certificateId and fileName are both empty. | 400 | certificateId和fileName均为空 |
36540132 | Certificate entity not found. certificateId="", fileName="" | 400 | 找不到要修改的证书 |
36540000 | The certificate is not found or deleted. | 400 | 证书存在,但是已标记删除 |
36540134 | The certificate is not belong to this given customer. | 400 | 入参客户与证书客户不一致 |
36540138 | invalid algorithm.algorithm= | 400 | 算法的值为【des、aes】以外的数据 |
36540139 | certificate content decrypt error. invalid crtFile or key. | 400 | crt证书解密失败 |
36540140 | certificate content decrypt error. invalid caFile or key. | 400 | ca证书解密失败 |
36540141 | certificate content decrypt error. invalid keyFile or key. | 400 | key证书解密失败 |
36540072 | The {0} content can not contain blank line and must be 64 characters except for the last line. | 400 | {0}文件不能包含空行且除了最后一行以外都必须64位字符 |
36540142 | invalid sslCertificate. no found crtCnDomain in crtFile. | 400 | crt证书解析失败或crt证书无授权域名 |
36540105 | No CRT certificate be found in .crt and .crt file. | 400 | crt与ca文件中均未找到CRT证书 |
36540144 | The crt file's algorithm is forbidden. | 400 | crt文件的签名算法非法:不支持的加密算法 |
36540145 | Updating with expired certificates is not allowed. | 400 | 证书过期,入参isAllowUseExpiredCert为false |
36540146 | invalid sslKey. | 400 | 秘钥解析失败 |
36540147 | private key is not match with public key. | 400 | 公私钥不匹配 |
36540101 | The uploaded Crt certificate is invalid! | 400 | crt证书解析失败 |
36540098 | The number of BEGIN is not match the END statement in .crt file. | 400 | 证书文件内容格式错误:BEGIN和END数量不匹配 |
36540100 | More than one CRT certificate be found in uploaded file. | 400 | crt和ca证书文件中包含多份CRT证书(多份crt证书相同,则不报错,并只保留一份) |
36540099 | The number of BEGIN is not match the END statement in .ca file. | 400 | ca文件内容有误,BEGIN/END数量不匹配 |
36540102 | The uploaded Ca files is invalid! | 400 | ca证书解析失败 |
36540104 | The CA certificate chain in uploaded files is invalid. | 400 | crt和ca证书文件中的CA证书链有误(不完整或冗余) |
36540106 | Certificate's CA file is not match with CRT file. | 400 | CA证书与CRT证书不匹配 |
36540103 | No CA certificate be found in .crt and .crt file. | 400 | crt与ca文件中均未找到CA证书 |
36540149 | dnsDomainBelongToCustomerId is empty. | 400 | 网宿合用证书场景:授权域名归属客户id为空 |
36540150 | dnsDomainBelongToCustomerId=" " not exist | 400 | 网宿合用证书场景:1.值非数值;2.授权域名归属客户id不存在 |
36540151 | dnsDomainRelateServiceCode is empty. | 400 | 网宿合用证书场景:授权域名关联服务编码为空 |
36540152 | dnsDomainRelateServiceCode=" " not exist | 400 | 网宿合用证书场景:授权域名关联服务编码不存在 |
36540129 | No csr was found according to csr id. | 400 | 当未入参的证书key时, 如果有入参csrId, 则取 csrId 对应的 csr 私钥作为证书的私钥 取不到则报错 |
36540026 | Certificate is in deploying. | 400 | 证书部署中,不允许修改 |
36540027 | Certificate is in deleting deployment. | 400 | 证书删除中,不允许修改 |
36542024 | domainName1,domainName2 | 400 | 修改证书({}),校验不通过,以下加速域名({})不在证书授权域名范围内. |
36540154 | The SSL name you provided is already in our system. certificateId: {0}, certificateName: {1} | 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/{certificateId}" \ -X "PUT" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -H "Content-Type:application/json" \ -d ' { "name":"mycertificate", "certificate":"-----BEGIN CERTIFICATE-----……-----END CERTIFICATE-----", "privateKey":"-----BEGIN RSA PRIVATE KEY-----……-----BEGIN RSA PRIVATE KEY-----" }'
HTTP/1.1 200 OK Date: Sun, 05 May 2019 09:08:53 GMT Content-Type: application/json;charset=utf-8 x-cnc-request-id: 83bbebc7-2c95-47d7 {"code":"0", "message":"success", "data":"" }