# 云证书同步授权公钥
同步云证书拥有人(或被授权人)的公钥列表
# 一、请求说明
- 请求地址:http://IP:PORT/openapi/kms/v1/cloud-cert/sync-auth
- 服务接口名称(即公共参数method的值): cloud-cert/sync-auth
- 请求方式:POST
# 二、请求参数
| 名称 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| certId | String | 是 | 证书id |
| authPublicKeys | Set<String> | 是 | 被授权对象公钥列表(BASE64格式) |
| authId | String | 是 | 被授权对象ID |
# 三、响应参数
| data 结果信息 | 类型 | 描述 |
|---|---|---|
| result | Integer | 同步结果(0 代表成功) |
# 四、成功示例
JSON示例
{
"code":0,
"message":"success",
"requestId":"xxx"
}
# 五、失败示例
JSON示例
{
"code": 10100,
"message": "证书id为空",
"requestId":"xxx",
}
# 六、SDK请求示例
// 提供的URL
String url = "http://localhost:9200";
// 您的appKey
String appKey = "CLxUIrYIO0";
// 您的appSecret
String appSecret = "Rsl7kjMrqHrxhDk9uou23IYRnCVjRKJC";
// 1.原客户端
PkiClient pkiClient = new PkiOkhttpClient(url, appKey, appSecret);
AuthCertRequest request = new AuthCertRequest();
//证书id
request.setCertId("63512d8a00c7887adcc6da5a");
Set<String> set = new HashSet<>();
set.add("BKH4KjNJRpHO3mL7tk9/+v0O+QJZJb0xlOxlODHICPF+s9DHESicyAVqQbpYZRS+2MTf1Pru+cYC2psQrxetxAo=");
//被授权对象公钥列表
request.setAuthPublicKeys(set);
//被授权对象ID
request.setAuthId("123456");
try {
AuthCertResponse response = pkiClient.execute(request);
// 后续业务
if (response.isSuccess()) {
System.out.println("成功响应:" + response.getResult());
} else {
System.out.println("失败响应:" + response.getBody());
}
} catch (ApiException e) {
e.printStackTrace();
}