Method: vdc.provisionMobileSecurityObjects

用于预配凭据的端点。

HTTP 请求

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

请求正文

请求正文中包含结构如下的数据:

JSON 表示法
{
  "requestMetadata": {
    object (RequestMetadata)
  },
  "deviceReferenceId": string,
  "credentialId": string,
  "authKeys": [
    {
      object (AuthKey)
    }
  ],
  "proofOfProvisioning": {
    object (ProofOfProvisioning)
  },
  "deviceEncryptionKey": {
    object (DeviceEncryptionKey)
  },
  "credentialVersionId": string
}
字段
requestMetadata

object (RequestMetadata)

必需。有关请求的元数据,所有请求中都必须提供。

deviceReferenceId

string

必需。与设备和与设备关联的身份密钥对应的 ID。这不是设备 ID,这意味着,如果用户在同一设备上拥有两个单独的凭据,则此 ID 在这两个凭据之间会有所不同。

此 ID 在所有请求中都会提供,可用于关联请求。

credentialId

string

必需。表示预配给设备的特定凭据的不透明标识符。

示例:UUID

authKeys[]

object (AuthKey)

必需。需要认证的 x509 证书列表,以便它们可以用作移动安全对象。每个证书都由设备凭据密钥签名。

proofOfProvisioning

object (ProofOfProvisioning)

必需。来自设备的证明凭据已正确预配的对象。如需详细了解此对象的结构,请参阅对象定义。

注意:此对象仅在凭据预配后首次预配移动安全对象时提供。当此方法用于 MSO 刷新时,系统不会提供此对象。

deviceEncryptionKey

object (DeviceEncryptionKey)

必需。包含设备的临时加密密钥和关联元数据的对象。此密钥用于将值加密回设备。在 onboarding 期间,沙盒环境中可能不会提供此对象,这表示发布方应返回纯文本数据。应始终在生产环境中设置此对象。

credentialVersionId

string

必需。设备当前拥有的凭据版本 ID。不应使用此 ID 为旧版凭据预配移动安全对象。如果此 ID 与发布方记录中预配的最新版本不匹配,则应返回包含 InvalidState 的 ErrorResponse。

响应正文

包含预配移动安全对象的结果的响应。

如果成功,响应正文将包含结构如下的数据:

JSON 表示法
{
  "responseMetadata": {
    object (ResponseMetadata)
  },
  "mobileSecurityObjects": [
    {
      object (MobileSecurityObject)
    }
  ]
}
字段
responseMetadata

object (ResponseMetadata)

必需。有关响应的元数据,所有响应中都必须提供。

mobileSecurityObjects[]

object (MobileSecurityObject)

必需。已就绪的 MobileSecurityObject 列表。如果目前没有 MobileSecurityObject 就绪,此列表可能为空。

AuthKey

由设备凭据密钥签名的 x509 证书,将由发布方进行认证。

这些证书由钱包从 Android Identity Credential API 中检索,如需了解详情,请参阅 https://developer.android.com/reference/android/security/identity/IdentityCredential#getAuthKeysNeedingCertification()

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,用于指明 AuthKey 的呈现方式。presencetype 只能是下列其中一项:
encryptedData

object (EncryptedData)

解密该值所需的加密值和加密元数据。

unencryptedValue

string

AuthKey 的 base64 编码值。

ProofOfProvisioning

由设备凭据密钥签名的 COSE_Sign1 结构,用于证明相关凭据已正确预配到设备上的安全存储空间。

此结构由 Android Identity Credential API 定义,如需了解详情,请参阅 https://developer.android.com/reference/android/security/identity/WritableIdentityCredential#personalize(android.security.identity.PersonalizationData)

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,用于指明 ProofOfProvisioning 的呈现方式。presencetype 只能是下列其中一项:
encryptedData

object (EncryptedData)

解密该值所需的加密值和加密元数据。

unencryptedValue

string

ProofOfProvisioning 的 base64 编码值。

MobileSecurityObject

封装根据凭据中包含的每个数据元素计算出的摘要的对象。此对象表示为静态身份验证数据,这是 Android Identity Credential 库所需的格式。如需详细了解如何构建静态身份验证数据,请参阅此处

JSON 表示法
{
  "expirationTimeMillis": string,

  // 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.
}
字段
expirationTimeMillis

string (int64 format)

表示移动安全对象过期时间的时间戳。该时间戳表示自 Unix 纪元以来经过的毫秒数。

联合字段 presencetype。必需。一个 oneof,用于指明凭据的呈现方式。presencetype 只能是下列其中一项:
encryptedData

object (EncryptedData)

解密该值所需的加密值和加密元数据。

unencryptedValue

string

凭据的 base64 编码值。