获取通过 CertCentral Discovery 扫描发现的所有证书的总数和列表。选择性地按证书属性筛选结果。
curl -X POST \
https://daas.digicert.com/apicontroller/v1/certificate/list \
-H 'Content-Type: application/json' \
-H 'X-DC-DEVKEY: {{api_key}}' \
-d '{
"searchCriteriaList": [
{
"key":"cn",
"operation": "EQUALS",
"value": [
"www.digicert.com","www.cert.com","docs.digicert.com"
]
},
{
"key":"org",
"operation": "EQUALS",
"value": [
"DigiCert Inc"
]
},
{
"key":"status",
"operation": "EQUALS",
"value": [
"VALID"
]
},
{
"key":"serialNum",
"operation": "EQUALS",
"value": [
"0eb6eab418c873d8f3c031dcdddf18b0"
]
},
{
"key":"securityRating",
"operation": "EQUALS",
"value": [
"Not secure","At risk"
]
},
{
"key":"ca",
"operation": "EQUALS",
"value": [
"DigiCert SHA2 Secure Server CA"
]
},
{
"key":"daysToExpire",
"operation": "EQUALS",
"value": [
"90"
]
},
{
"key":"tags",
"operation": "EQUALS",
"value": [
"internal","devbox"
]
}
],
"accountId": "126993",
"divisionIds": [],
"startIndex": 1,
"pageSize": 50,
"sortedColumnId": "cn",
"sortOrder": "ASC"
}'
import requests
url = "https://daas.digicert.com/apicontroller/v1/certificate/list"
payload = "{\n \"searchCriteriaList\": [\n {\n \"key\": \"cn\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"www.digicert.com\",\"www.cert.com\",\"docs.digicert.com\"\n ]\n },\n {\n \"key\": \"org\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"DigiCert Inc\"\n ]\n },\n {\n \"key\": \"status\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"VALID\"\n ]\n },\n {\n \"key\": \"serialNum\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"0eb6eab418c873d8f3c031dcdddf18b0\"\n ]\n },\n {\n \"key\": \"securityRating\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"Not secure\",\"At risk\"\n ]\n },\n {\n \"key\": \"ca\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"DigiCert SHA2 Secure Server CA\"\n ]\n },\n {\n \"key\": \"daysToExpire\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"90\"\n ]\n },\n {\n \"key\": \"tags\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"internal\",\"devbox\"\n ]\n }\n ],\n \"accountId\": \"126993\",\n \"divisionIds\": [],\n \"startIndex\": 1,\n \"pageSize\": 50,\n \"sortedColumnId\": \"cn\",\n \"sortOrder\": \"ASC\"\n}"
headers = {
'X-DC-DEVKEY': "{{api_key}}",
'Content-Type': "application/json",
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://daas.digicert.com/apicontroller/v1/certificate/list"
payload := strings.NewReader("{\n \"searchCriteriaList\": [\n {\n \"key\": \"cn\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"www.digicert.com\",\"www.cert.com\",\"docs.digicert.com\"\n ]\n },\n {\n \"key\": \"org\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"DigiCert Inc\"\n ]\n },\n {\n \"key\": \"status\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"VALID\"\n ]\n },\n {\n \"key\": \"serialNum\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"0eb6eab418c873d8f3c031dcdddf18b0\"\n ]\n },\n {\n \"key\": \"securityRating\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"Not secure\",\"At risk\"\n ]\n },\n {\n \"key\": \"ca\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"DigiCert SHA2 Secure Server CA\"\n ]\n },\n {\n \"key\": \"daysToExpire\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"90\"\n ]\n },\n {\n \"key\": \"tags\",\n \"operation\": \"EQUALS\",\n \"value\": [\n \"internal\",\"devbox\"\n ]\n }\n ],\n \"accountId\": \"126993\",\n \"divisionIds\": [],\n \"startIndex\": 1,\n \"pageSize\": 50,\n \"sortedColumnId\": \"cn\",\n \"sortOrder\": \"ASC\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
req.Header.Add("Content-Type", "application/json")
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: 'POST',
url: 'https://daas.digicert.com/apicontroller/v1/certificate/list',
headers:
{ 'Content-Type': 'application/json',
'X-DC-DEVKEY': '{{api_key}}' },
body:
{ searchCriteriaList:
[ { key: 'cn', operation: 'EQUALS', value: [ 'www.digicert.com','www.cert.com','docs.digicert.com' ] },
{ key: 'org', operation: 'EQUALS', value: [ 'DigiCert Inc' ] },
{ key: 'status', operation: 'EQUALS', value: [ 'VALID' ] },
{ key: 'serialNum', operation: 'EQUALS', value: [ '0eb6eab418c873d8f3c031dcdddf18b0' ] },
{ key: 'securityRating', operation: 'EQUALS', value: [ 'Not secure','At risk' ] },
{ key: 'ca', operation: 'EQUALS', value: [ 'DigiCert SHA2 Secure Server CA' ] },
{ key: 'daysToExpire', operation: 'EQUALS', value: [ '90' ] },
{ key: 'tags', operation: 'EQUALS', value: [ 'internal','devbox' ] } ],
accountId: '126993',
divisionIds: [],
startIndex: 1,
pageSize: 50,
sortedColumnId: 'cn',
sortOrder: 'ASC' },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
{
"data": {
"totalCount": 81,
"currentCount": 50,
"certificateDetailsDTOList": [
{
"certId": "fb92ee3a2fd0cb6549e58c252f8787f467bfbeff",
"serialNum": "2bf1c0d8a20fef721f67011d6231c16e",
"validFrom": 1523318400000,
"expiryDate": 1591660799000,
"subject": "CN=*.aparat.com,OU=EssentialSSL Wildcard,OU=Domain Control Validated",
"issuedBy": "CN=COMODO RSA Domain Validation Secure Server CA, O=COMODO CA Limited, L=Salford, ST=Greater Manchester, C=GB",
"cn": "*.aparat.com",
"ca": "Comodo",
"firstDiscoveredDate": 1561409074447,
"keyLength": 2048,
"algoType": "SHA256withRSA",
"accountId": null,
"certStatusString": "VALID",
"owner": "",
"org": null,
"orgUnit": "Domain Control Validated",
"city": "",
"state": "",
"country": "",
"sanCount": 2,
"publicKeyAlgo": "RSA",
"san": "isBlobUTF8=true;[2, *.aparat.com];[2, aparat.com]",
"certRating": "Secure",
"tags": "",
"certStatusError": null,
"certIssues": "CRLDistributionPoints"
},
{
"certId": "4c5d6a9813d3c858ac1ba279a3dd318460bc9ad7",
"serialNum": "040b914d32914ffc2474a3fdfd892c99",
"validFrom": 1539734400000,
"expiryDate": 1573992000000,
"subject": "CN=espn.com",
"issuedBy": "CN=Amazon, OU=Server CA 1B, O=Amazon, C=US",
"cn": "espn.com",
"ca": "Amazon",
"firstDiscoveredDate": 1563917838074,
"keyLength": 2048,
"algoType": "SHA256withRSA",
"accountId": null,
"certStatusString": "VALID",
"owner": "",
"org": null,
"orgUnit": "",
"city": "",
"state": "",
"country": "",
"sanCount": 6,
"publicKeyAlgo": "RSA",
"san": "isBlobUTF8=true;[2, espn.com];[2, *.espn.com];[2, *.geo.hosted.espn.com];[2, *.us-west-2.aws.hosted.espn.com];[2, *.core.api.espn.com];[2, *.api.espn.com]",
"certRating": "Secure",
"tags": "internal",
"certStatusError": null,
"certIssues": "IsAliasMatchSAN,CRLDistributionPoints"
}
]
}
}
名称 | 请求/选项 | 类型 | 描述 |
---|---|---|---|
searchCriteriaList | 可选 | array | 获取指定条件的记录。 |
.. key | 可选 | string |
搜索参数。 允许的值: cn ,org ,状态 ,serialNum ,securityRating ,ca ,daysToExpire ,tags
|
.. operation | 可选 | string |
搜索操作。 允许的值: EQUALS
|
.. value | 可选 | array | 搜索值。 |
accountId | 必填 | string | 帐号。 |
divisionIds | 可选 | array | 分区 ID。 |
startIndex | 可选 | int |
从指定索引开始。 默认值: 1
|
pageSize | 可选 | int |
每页的记录数。 默认值: 50
|
sortedColumnId | 可选 | string |
结果按指定参数排序。 允许的值: cn ,org ,status ,serialNum ,securityRating ,ca ,daysToExpire 默认值: cn
|
sortOrder | 可选 | string |
按方向排序。 允许的值: ASC (升序:0-9,A-Z),DESC (降序:9-0,Z-A)默认值: ASC
|
名称 | 类型 | 描述 |
---|---|---|
data | object | 容器。 |
.. totalCount | int | 与搜索条件匹配的总记录数。 |
.. currentCount | int | 当前页的记录数。 |
.. certificateDetailsDTOList | array | 证书详细信息的容器。 |
.. .. certId | string | 为证书生成的唯一 DigiCert ID。需要它的 API 请求的用途。 |
.. .. serialNum | string | 在颁发时分配给证书的序列号。 |
.. .. validFrom | string | 有效期开始日期。 |
.. .. expiryDate | string | 有效期结束日期。 |
.. .. subject | bool | 完整的证书可分辨名称。 |
.. .. issuedBy | string | 从中颁发证书的根证书。 |
.. .. cn | string | 证书上的公用名。 |
.. .. ca | string | 颁发证书的证书颁发机构。 |
.. .. firstDiscoveredDate | string | 日期证书被 CertCentral Discovery 扫描首次找到。 |
.. .. keyLength | string | 证书的加密密钥大小。 |
.. .. algoType | string | 证书使用的加密算法。 |
.. .. accountId | string | 帐号。 |
.. .. certStatusString | string |
状态证书的 。
|
.. .. owner | string | CertCentral Discovery 中定义的所有者。 |
.. .. org | string | 证书上的组织名称。 |
.. .. orgunit | string | 证书上的组织单位。 |
.. .. city | string | 证书上的城市。 |
.. .. state | string | 证书上的州。 |
.. .. country | string | 证书上的国家/地区。 |
.. .. sanCount | string | 证书上的使用者可选名称的数量。 |
.. .. publicKeyAlgo | string | 证书公钥的加密算法。 |
.. .. san | string | 证书上的使用者可选名称。 |
.. .. certRating | string |
证书安全性评级 ,基于行业标准和证书设置。
|
.. .. tags | string | 证书所有者、订户或其他管理员添加的自定义标签。 |
.. .. certStatusError | string | 检索证书状态时出现错误。 |
.. .. certIssues | string | 证书颁发的图表数据。 |