Required. The Cloud KMS resource identifier of the customer managed
encryption key used to protect a resource. Has the form:
projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key.
The key needs to be in the same region as where the compute resource is
created.
Required. The Cloud KMS resource identifier of the customer managed
encryption key used to protect a resource. Has the form:
projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key.
The key needs to be in the same region as where the compute resource is
created.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-18 UTC."],[],[],null,["# Interface EncryptionSpecOrBuilder (3.73.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.73.0 (latest)](/java/docs/reference/google-cloud-aiplatform/latest/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.71.0](/java/docs/reference/google-cloud-aiplatform/3.71.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.69.0](/java/docs/reference/google-cloud-aiplatform/3.69.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.68.0](/java/docs/reference/google-cloud-aiplatform/3.68.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.65.0](/java/docs/reference/google-cloud-aiplatform/3.65.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.64.0](/java/docs/reference/google-cloud-aiplatform/3.64.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.63.0](/java/docs/reference/google-cloud-aiplatform/3.63.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.61.0](/java/docs/reference/google-cloud-aiplatform/3.61.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.60.0](/java/docs/reference/google-cloud-aiplatform/3.60.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.59.0](/java/docs/reference/google-cloud-aiplatform/3.59.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.58.0](/java/docs/reference/google-cloud-aiplatform/3.58.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.57.0](/java/docs/reference/google-cloud-aiplatform/3.57.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.56.0](/java/docs/reference/google-cloud-aiplatform/3.56.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.55.0](/java/docs/reference/google-cloud-aiplatform/3.55.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.54.0](/java/docs/reference/google-cloud-aiplatform/3.54.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.53.0](/java/docs/reference/google-cloud-aiplatform/3.53.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.52.0](/java/docs/reference/google-cloud-aiplatform/3.52.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.50.0](/java/docs/reference/google-cloud-aiplatform/3.50.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.49.0](/java/docs/reference/google-cloud-aiplatform/3.49.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.48.0](/java/docs/reference/google-cloud-aiplatform/3.48.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.47.0](/java/docs/reference/google-cloud-aiplatform/3.47.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.46.0](/java/docs/reference/google-cloud-aiplatform/3.46.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.45.0](/java/docs/reference/google-cloud-aiplatform/3.45.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.44.0](/java/docs/reference/google-cloud-aiplatform/3.44.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.43.0](/java/docs/reference/google-cloud-aiplatform/3.43.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.42.0](/java/docs/reference/google-cloud-aiplatform/3.42.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.41.0](/java/docs/reference/google-cloud-aiplatform/3.41.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.40.0](/java/docs/reference/google-cloud-aiplatform/3.40.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.38.0](/java/docs/reference/google-cloud-aiplatform/3.38.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.37.0](/java/docs/reference/google-cloud-aiplatform/3.37.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.36.0](/java/docs/reference/google-cloud-aiplatform/3.36.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.35.0](/java/docs/reference/google-cloud-aiplatform/3.35.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.34.0](/java/docs/reference/google-cloud-aiplatform/3.34.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.33.0](/java/docs/reference/google-cloud-aiplatform/3.33.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.32.0](/java/docs/reference/google-cloud-aiplatform/3.32.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.31.0](/java/docs/reference/google-cloud-aiplatform/3.31.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.30.0](/java/docs/reference/google-cloud-aiplatform/3.30.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.29.0](/java/docs/reference/google-cloud-aiplatform/3.29.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.28.0](/java/docs/reference/google-cloud-aiplatform/3.28.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.25.0](/java/docs/reference/google-cloud-aiplatform/3.25.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.24.0](/java/docs/reference/google-cloud-aiplatform/3.24.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.23.0](/java/docs/reference/google-cloud-aiplatform/3.23.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.22.0](/java/docs/reference/google-cloud-aiplatform/3.22.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.21.0](/java/docs/reference/google-cloud-aiplatform/3.21.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.20.0](/java/docs/reference/google-cloud-aiplatform/3.20.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.19.0](/java/docs/reference/google-cloud-aiplatform/3.19.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.18.0](/java/docs/reference/google-cloud-aiplatform/3.18.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.17.0](/java/docs/reference/google-cloud-aiplatform/3.17.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.16.0](/java/docs/reference/google-cloud-aiplatform/3.16.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.15.0](/java/docs/reference/google-cloud-aiplatform/3.15.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.14.0](/java/docs/reference/google-cloud-aiplatform/3.14.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.13.0](/java/docs/reference/google-cloud-aiplatform/3.13.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.12.0](/java/docs/reference/google-cloud-aiplatform/3.12.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.11.0](/java/docs/reference/google-cloud-aiplatform/3.11.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.10.0](/java/docs/reference/google-cloud-aiplatform/3.10.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.9.0](/java/docs/reference/google-cloud-aiplatform/3.9.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.8.0](/java/docs/reference/google-cloud-aiplatform/3.8.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.7.0](/java/docs/reference/google-cloud-aiplatform/3.7.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.6.0](/java/docs/reference/google-cloud-aiplatform/3.6.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.5.0](/java/docs/reference/google-cloud-aiplatform/3.5.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.4.2](/java/docs/reference/google-cloud-aiplatform/3.4.2/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.3.0](/java/docs/reference/google-cloud-aiplatform/3.3.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.2.0](/java/docs/reference/google-cloud-aiplatform/3.2.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [3.0.0](/java/docs/reference/google-cloud-aiplatform/3.0.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [2.9.8](/java/docs/reference/google-cloud-aiplatform/2.9.8/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [2.8.9](/java/docs/reference/google-cloud-aiplatform/2.8.9/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [2.7.4](/java/docs/reference/google-cloud-aiplatform/2.7.4/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [2.5.3](/java/docs/reference/google-cloud-aiplatform/2.5.3/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder)\n- [2.4.0](/java/docs/reference/google-cloud-aiplatform/2.4.0/com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder) \n\n public interface EncryptionSpecOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getKmsKeyName()\n\n public abstract String getKmsKeyName()\n\nRequired. The Cloud KMS resource identifier of the customer managed\nencryption key used to protect a resource. Has the form:\n`projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.\nThe key needs to be in the same region as where the compute resource is\ncreated.\n\n`string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED];`\n\n### getKmsKeyNameBytes()\n\n public abstract ByteString getKmsKeyNameBytes()\n\nRequired. The Cloud KMS resource identifier of the customer managed\nencryption key used to protect a resource. Has the form:\n`projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.\nThe key needs to be in the same region as where the compute resource is\ncreated.\n\n`string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED];`"]]