使用此端点获取关于 API 密钥的详细信息。
不会返回 API 密钥本身。
curl -X GET \
'https://www.digicert.com/services/v2/services/v2/key/{{key_id}}' \
-H 'Content-Type: application/xml' \
-H 'X-DC-DEVKEY: {{api_key}}'
import requests
url = "https://www.digicert.com/services/v2/key/{{key_id}}"
headers = {
'X-DC-DEVKEY': "{{api_key}}",
'Content-Type': "application/xml"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://www.digicert.com/services/v2/key/{{key_id}}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
req.Header.Add("Content-Type", "application/xml")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var request = require("request");
var options = { method: 'GET',
url: 'https://www.digicert.com/services/v2/key/{{key_id}}',
headers:
{ 'Content-Type': 'application/xml',
'X-DC-DEVKEY': '{{api_key}}' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
{
"id": 184,
"user": {
"id": 125039,
"first_name": "John",
"last_name": "Smith"
},
"status": "active",
"create_date": "2018-08-07T23:27:58+00:00",
"last_used_date": "2018-08-18T19:08:19+00:00",
"name": "Key Name",
"is_legacy": false,
"restricted_to_role_id": 0
}
{
"id": 15,
"user": {
"id": 10,
"first_name": "Jill",
"last_name": "Valentine"
},
"status": "active",
"create_date": "2018-11-20T22:27:47+00:00",
"name": "ACME URL Name",
"is_legacy": false,
"restricted_to_role_id": 0,
"acme_directory_url": "******nnAA",
"product_name_id": "ssl_plus",
"product_name": "Standard SSL",
"organization_id": 123456,
"organization_name": "STARS",
"validity_days": "0",
"validity_years": "2"
}
名称 | 类型 | 描述 |
---|---|---|
id | int | 密钥 ID。 |
user | object | 关于与该密钥关联的用户的详细信息。 |
.. id | int | 用户 ID。 |
.. first_name | string | 用户的名字。 |
.. last_name | string | 用户的姓氏。 |
status | string |
密钥状态。 可能的值: active ,revoked
|
create_date | string |
创建密钥的时间戳。 格式:UTC 时区和 ISO 8601 日期 |
last_used_date | string |
上次使用密钥的时间戳。 格式:UTC 时区和 ISO 8601 日期 |
name | string | 密钥名称。 |
is_legacy | bool | 密钥的旧状态。 |
restricted_to_role_id | int |
指定是否将 API 密钥权限限制为一组确定的操作。 请参阅词汇表 - API 密钥角色 |
acme_directory_url | string |
模糊处理的 ACME 目录 URL。 仅对 ACME 密钥返回。 |
product_name_id | string |
通过 ACME 订购的产品的名称 ID。 仅对 ACME 密钥返回。 请参阅词汇表 - 产品标识符 |
product_name | string |
通过 ACME 订购的产品的友好名称。 仅对 ACME 密钥返回。 请参阅词汇表 - 产品标识符 |
organization_id | string |
与通过 ACME 订购的证书关联的组织名称。 仅对 ACME 密钥返回。 |
organizatin_name | string |
与通过 ACME 订购的证书关联的组织名称。 仅对 ACME 密钥返回。 |
validity_days | string |
证书的有效天数。 仅对 ACME 密钥返回。 |
validity_years | string |
证书的有效年限。 仅对 ACME 密钥返回。 |