此頁面描述有 code_signing_certificate
群組名稱的產品 (請參閱詞彙 – 產品識別碼)。
使用此端點提交使用 code_signing
或 code_signing_ev
作為 code_signing_certificate_id 的代碼簽章憑證要求訂單。
curl -X POST \
'https://www.digicert.com/services/v2/order/certificate/{{code_signing_certificate_id}}' \
-H 'Content-Type: application/json' \
-H 'X-DC-DEVKEY: {{api_key}}' \
-d '{
"certificate": {
"organization_units": [
"Engineering"
],
"server_platform": {
"id": 52
},
"signature_hash": "sha256"
},
"cs_provisioning_method": "ship_token",
"validity_years": 1,
"comments": "Message for the approver",
"skip_approval": true,
"organization": {
"id": 123456
},
"ship_info": {
"name": "Erin Guerra",
"addr1": "360 Taylor Street",
"addr2": "Floor 74",
"city": "Richmond",
"state": "va",
"zip": "69662",
"country": "us",
"method": "EXPEDITED"
},
"auto_renew": 1,
"custom_renewal_message": "Renew this please.",
"custom_fields": [
{
"metadata_id": 12,
"value": "123456"
}
],
"payment_method": "balance"
}'
import requests
url = "https://www.digicert.com/services/v2/order/certificate/{{code_signing_certificate_id}}"
payload = "{\n \"certificate\": {\n \"organization_units\": [\n \"Engineering\"\n ],\n \"server_platform\": {\n \"id\": 52\n },\n \"signature_hash\": \"sha256\"\n },\n \"cs_provisioning_method\": \"ship_token\",\n \"validity_years\": 1,\n \"comments\": \"Message for the approver\",\n \"skip_approval\": true,\n \"organization\": {\n \"id\": 123456\n },\n \"container\": {\n \"id\": 654321\n },\n \"ship_info\": {\n \"name\": \"Erin Guerra\",\n \"addr1\": \"360 Taylor Street\",\n \"addr2\": \"Floor 74\",\n \"city\": \"Richmond\",\n \"state\": \"va\",\n \"zip\": \"69662\",\n \"country\": \"us\",\n \"method\": \"EXPEDITED\"\n },\n \"auto_renew\": 1,\n \"custom_renewal_message\": \"Renew this please.\",\n \"custom_fields\": [\n {\n \"metadata_id\": 12,\n \"value\": \"123456\"\n }\n ],\n \"payment_method\": \"balance\"\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://www.digicert.com/services/v2/order/certificate/{{code_signing_certificate_id}}"
payload := strings.NewReader("{\n \"certificate\": {\n \"organization_units\": [\n \"Engineering\"\n ],\n \"server_platform\": {\n \"id\": 52\n },\n \"signature_hash\": \"sha256\"\n },\n \"cs_provisioning_method\": \"ship_token\",\n \"validity_years\": 1,\n \"comments\": \"Message for the approver\",\n \"skip_approval\": true,\n \"organization\": {\n \"id\": 123456\n },\n \"container\": {\n \"id\": 654321\n },\n \"ship_info\": {\n \"name\": \"Erin Guerra\",\n \"addr1\": \"360 Taylor Street\",\n \"addr2\": \"Floor 74\",\n \"city\": \"Richmond\",\n \"state\": \"va\",\n \"zip\": \"69662\",\n \"country\": \"us\",\n \"method\": \"EXPEDITED\"\n },\n \"auto_renew\": 1,\n \"custom_renewal_message\": \"Renew this please.\",\n \"custom_fields\": [\n {\n \"metadata_id\": 12,\n \"value\": \"123456\"\n }\n ],\n \"payment_method\": \"balance\"\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://www.digicert.com/services/v2/order/certificate/{{code_signing_certificate_id}}',
headers:
{ 'Content-Type': 'application/json',
'X-DC-DEVKEY': '{{api_key}}' },
body:
{ certificate:
{ organization_units: [ 'Engineering' ],
server_platform: { id: 52 },
signature_hash: 'sha256' },
cs_provisioning_method: 'ship_token',
validity_years: 1,
comments: 'Message for the approver',
skip_approval: true,
organization: { id: 123456 },
container: { id: 654321 },
ship_info:
{ name: 'Erin Guerra',
addr1: '360 Taylor Street',
addr2: 'Floor 74',
city: 'Richmond',
state: 'va',
zip: '69662',
country: 'us',
method: 'EXPEDITED' },
auto_renew: 1,
custom_renewal_message: 'Renew this please.',
custom_fields: [ { metadata_id: 12, value: '123456' } ],
payment_method: 'balance' },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
{
"id": 112233,
"requests": [
{
"id": 113,
"status": "pending"
}
]
}
{
"id": 112233,
"requests": [
{
"id": 113,
"status": "submitted"
}
]
}
{
"id": 112233,
"requests": [
{
"id": 113,
"status": "approved"
}
],
"certificate_id": 113
}
含有星號 (*) 的參數僅可用於 EV 代碼簽章訂單。
名稱 | 必填/選填 | 類型 | 說明 |
---|---|---|---|
certificate | 必填 | object | 憑證詳細資料。 |
.. csr | 選填 | string |
憑證簽章要求 (CSR)。 不需要任何 EV 代碼簽章憑證。 如果 server_platform.id 值是 55 (Sun Java) 時必填
|
.. signature_hash | 必填 | string |
用於簽署憑證的雜湊演算法。 允許的值: sha256
|
.. server_platform | 選填 | object |
伺服器平台類型。 預設: -1 (其他)
|
.. .. id | 必填 | int |
伺服器平台 ID。 請參閱詞彙 — 伺服器平台 |
.. organization_units | 選填 | array | 您的組織中與憑證關聯的部門。 |
auto_renew | 選填 | int | 應自動續訂憑證的次數。 |
additional_emails | 選填 | array | 接收憑證通知電郵的其他電郵地址 (例如憑證發行、重複憑證、憑證續訂等)。 |
renewal_of_order_id | 選填 | int | 如果訂單是續訂的,請輸入之前訂單的 ID。 |
skip_approval | 選填 | bool |
說明訂單是否應跳過核准步驟,並在完成時立刻提交進行驗證和發行。 預設: false
|
organization | 必填 | object | 與訂單關聯的組織。 |
.. id | 必填 | int | 組織 ID。 |
container | 選填 | object | 視需要說明在其之下下訂單的容器。 |
.. id | 必填 | int | 容器 ID。 |
validity_years | 必填 | int |
憑證有效的年數。 允許的值: 1 ,2 ,3
|
cs_provisioning_method* | 必填 | string |
關於 EV 代碼簽章憑證,請指定您要接收權杖的方法。 請參閱詞彙 — CS 建置方法 |
ship_info* | 選填 | object | 關於 EV 代碼簽章憑證,請指定權杖的傳送地址。 |
.. name | 必填 | string | |
.. addr1 | 必填 | string | |
.. addr2 | 選填 | string | |
.. city | 必填 | string | |
.. state | 必填 | string | |
.. zip | 必填 | string | |
.. country | 必填 | string | |
.. method | 必填 | string |
權杖的傳送優先順序。 允許的值: STANDARD ,EXPEDITED (產生額外的費用)
|
custom_fields | 選填* | object |
特定帳戶自訂欄位。 *是否需要這些欄位視您的自訂欄位設定而定。 |
.. metadata_id | 必填 | int | 自訂欄位 ID。 |
.. value | 必填 | string |
自訂欄位的值。 資料驗證類型視您的自訂欄位設定而定。 |
payment_method | 選填 | string |
說明要使用的付款方法。 允許的值: balance ,card ,profile 預設: balance
|
名稱 | 類型 | 說明 |
---|---|---|
id | int | 訂單 ID。 |
organization | object |
適用於新組織詳細資料的容器。 僅在建立有訂單的新組織時傳回。 |
.. id | int | 適用於新組織的組織 ID。 |
requests | array | 包含與要求有關的資訊。 |
.. id | int | 要求 ID。 |
.. status | string |
要求狀態。 可能的值: pending ,submitted ,approved ,rejected
|
certificate_id | int |
憑證 ID。 要求狀態是 approved 時傳回。
|