Method: appsigning.rotateAppSigningKey

將應用程式的簽署金鑰輪替為新的自代管 Google Cloud KMS 金鑰。

警告:這個方法僅適用於使用自架主機 Cloud KMS 金鑰註冊的應用程式。如果應用程式使用 Google 管理的標準 Play 應用程式簽署功能,必須透過 Google Play 管理中心 UI 啟動金鑰輪替要求。

請參閱說明中心:https://support.google.com/googleplay/android-developer/answer/9842756

HTTP 要求

POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{name}/appSigning:rotateAppSigningKey

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
name

string

必填。變更簽署金鑰的應用程式套件名稱或應用程式 ID。

要求主體

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

JSON 表示法
{
  "rotatedCloudKmsKey": {
    object (RotatedCloudKmsKey)
  },
  "keyRotationReason": enum (KeyRotationReason)
}
欄位
rotatedCloudKmsKey

object (RotatedCloudKmsKey)

必填。自行代管的 Cloud KMS 金鑰。

keyRotationReason

enum (KeyRotationReason)

必填。變更應用程式金鑰的原因。

回應主體

變更應用程式簽署金鑰的回應。

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

JSON 表示法
{
  "rotatedKeyCertificate": {
    object (CertificateHashes)
  }
}
欄位
rotatedKeyCertificate

object (CertificateHashes)

應用程式的輪替金鑰憑證雜湊。一律要設定。

授權範圍

需要下列 OAuth 範圍:

  • https://www.googleapis.com/auth/androidpublisher

KeyRotationReason

金鑰輪替原因。

列舉
KEY_ROTATION_REASON_UNSPECIFIED 未指定金鑰輪替原因。無法使用。
COMPROMISED_KEY 金鑰遭盜用。
USE_STRONGER_KEY 必須使用更強大的金鑰。
USE_SAME_KEY_FOR_MULTIPLE_APPS 多個應用程式使用同一個金鑰。
ROUTINE_KEY_UPGRADE 例行金鑰升級。
OTHER 其他原因。

RotatedCloudKmsKey

代表輪替 Cloud KMS 金鑰的訊息。包含 Cloud KMS 金鑰和相關聯的輪替證明。

JSON 表示法
{
  "cloudKmsKeyAndCert": {
    object (CloudKmsKeyAndCert)
  },
  "signingCertificateLineage": string
}
欄位
cloudKmsKeyAndCert

object (CloudKmsKeyAndCert)

必填。Cloud KMS 金鑰和與該金鑰相關聯的憑證。

signingCertificateLineage

string (bytes format)

必填。輪替證明。請參閱「建立簽署憑證的沿襲」。

Base64 編碼字串。