列出憑證

POST
https://daas.digicert.com/apicontroller/v1/certificate/list

取得透過 CertCentral Discovery 掃描找到所有憑證的總數和清單。依憑證屬性選擇性的篩選結果。

cURL
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"
}'
Python
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)
Go
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))

}
NodeJS
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);
});
200 OK
{
    "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 帳戶 ID。
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 帳戶 ID。
.. .. 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 憑證狀態的圖表資料。