Method: vdc.provisionCredential

用於佈建憑證的端點。

HTTP 要求

POST https://example.issuer.com/api/v1/vdc/provisionCredential

要求主體

要求主體會包含結構如下的資料:

JSON 表示法
{
  "requestMetadata": {
    object (RequestMetadata)
  },
  "deviceReferenceId": string,
  "credentialId": string,
  "proofingId": string,
  "deviceEncryptionKey": {
    object (DeviceEncryptionKey)
  }
}
欄位
requestMetadata

object (RequestMetadata)

所有要求都必須提供的要求中繼資料。

deviceReferenceId

string

與裝置和裝置相關聯的身分識別金鑰相應的 ID。這並非裝置 ID,也就是說,如果使用者在同一部裝置上擁有兩組不同的憑證,這兩個憑證的 ID 就會不同。

所有要求都會提供這個 ID,可用於建立要求之間的關聯。

credentialId

string

不透明 ID,代表提供給裝置的特定憑證。

如果 credentialId 已存在,這個方法應傳回現有憑證,而非建立新憑證。

例如:UUID

proofingId

string

不透明的 ID,代表特定裝置的特定證據組合驗證。

校對必須處於「已核准」狀態。否則應傳回無效的 ID ErrorResponse。

deviceEncryptionKey

object (DeviceEncryptionKey)

這個物件包含裝置的暫時性加密金鑰和相關聯的中繼資料。這個金鑰用於將值加密回裝置。在導入期間,沙箱環境可能不會提供這個物件,表示發卡機構應傳回純文字資料。實際工作環境中一律應設定這個值。

回應主體

包含已佈建憑證的回應。

如果成功,回應主體會含有以下結構的資料:

JSON 表示法
{
  "responseMetadata": {
    object (ResponseMetadata)
  },
  "credential": {
    object (Credential)
  },
  "credentialVersionId": string
}
欄位
responseMetadata

object (ResponseMetadata)

回應的中繼資料,所有回應都必須提供。

credential

object (Credential)

佈建的憑證。

credentialVersionId

string

已佈建的憑證目前版本。

憑證

根據相關 ISO 標準為憑證類型定義的 mdoc 憑證。

舉例來說,如果是行動駕照,這會是 ISO/IEC 18013-5。如需 mDL mDoc 格式,請參閱這篇文章

JSON 表示法
{

  // Union field presencetype can be only one of the following:
  "encryptedData": {
    object (EncryptedData)
  },
  "unencryptedValue": string
  // End of list of possible types for union field presencetype.
}
欄位
聯集欄位 presencetype。這個 oneof 會指出憑證的呈現方式。presencetype 只能是下列其中一項:
encryptedData

object (EncryptedData)

解密值所需的加密值和加密中繼資料。

unencryptedValue

string

憑證的 Base64 編碼值。