Reference documentation and code samples for the Cloud KMS V1 Client class KeyHandle.
Resource-oriented representation of a request to Cloud KMS Autokey and the
resulting provisioning of aCryptoKey.
Generated from protobuf messagegoogle.cloud.kms.v1.KeyHandle
Namespace
Google \ Cloud \ Kms \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Identifier. Name of theKeyHandleresource, e.g.projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}.
↳ kms_key
string
Output only. Name of aCryptoKeythat has been provisioned for Customer Managed Encryption Key (CMEK) use in theKeyHandleproject and location for the requested resource type. TheCryptoKeyproject will reflect the value configured in theAutokeyConfigon the resource project's ancestor folder at the time of theKeyHandlecreation. If more than one ancestor folder has a configuredAutokeyConfig, the nearest of these configurations is used.
↳ resource_type_selector
string
Required. Indicates the resource type that the resultingCryptoKeyis meant to protect, e.g.{SERVICE}.googleapis.com/{TYPE}. See documentation for supported resource types.
Output only. Name of aCryptoKeythat has
been provisioned for Customer Managed Encryption Key (CMEK) use in theKeyHandleproject and location for the
requested resource type. TheCryptoKeyproject will reflect the value configured in theAutokeyConfigon the resource
project's ancestor folder at the time of theKeyHandlecreation. If more than one
ancestor folder has a configuredAutokeyConfig, the nearest of these
configurations is used.
Returns
Type
Description
string
setKmsKey
Output only. Name of aCryptoKeythat has
been provisioned for Customer Managed Encryption Key (CMEK) use in theKeyHandleproject and location for the
requested resource type. TheCryptoKeyproject will reflect the value configured in theAutokeyConfigon the resource
project's ancestor folder at the time of theKeyHandlecreation. If more than one
ancestor folder has a configuredAutokeyConfig, the nearest of these
configurations is used.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getResourceTypeSelector
Required. Indicates the resource type that the resultingCryptoKeyis meant to protect, e.g.
{SERVICE}.googleapis.com/{TYPE}. See documentation for supported resource
types.
Returns
Type
Description
string
setResourceTypeSelector
Required. Indicates the resource type that the resultingCryptoKeyis meant to protect, e.g.
{SERVICE}.googleapis.com/{TYPE}. See documentation for supported resource
types.
[[["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-09-04 UTC."],[],[],null,["# Cloud KMS V1 Client - Class KeyHandle (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-kms/latest/V1.KeyHandle)\n- [2.3.0](/php/docs/reference/cloud-kms/2.3.0/V1.KeyHandle)\n- [2.2.0](/php/docs/reference/cloud-kms/2.2.0/V1.KeyHandle)\n- [2.1.6](/php/docs/reference/cloud-kms/2.1.6/V1.KeyHandle)\n- [2.0.0](/php/docs/reference/cloud-kms/2.0.0/V1.KeyHandle)\n- [1.23.0](/php/docs/reference/cloud-kms/1.23.0/V1.KeyHandle)\n- [1.22.1](/php/docs/reference/cloud-kms/1.22.1/V1.KeyHandle)\n- [1.21.4](/php/docs/reference/cloud-kms/1.21.4/V1.KeyHandle)\n- [1.20.3](/php/docs/reference/cloud-kms/1.20.3/V1.KeyHandle)\n- [1.19.0](/php/docs/reference/cloud-kms/1.19.0/V1.KeyHandle)\n- [1.18.1](/php/docs/reference/cloud-kms/1.18.1/V1.KeyHandle)\n- [1.17.0](/php/docs/reference/cloud-kms/1.17.0/V1.KeyHandle)\n- [1.16.4](/php/docs/reference/cloud-kms/1.16.4/V1.KeyHandle)\n- [1.15.3](/php/docs/reference/cloud-kms/1.15.3/V1.KeyHandle) \nReference documentation and code samples for the Cloud KMS V1 Client class KeyHandle.\n\nResource-oriented representation of a request to Cloud KMS Autokey and the\nresulting provisioning of a [CryptoKey](/php/docs/reference/cloud-kms/latest/V1.CryptoKey).\n\nGenerated from protobuf message `google.cloud.kms.v1.KeyHandle`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Kms \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nIdentifier. Name of the [KeyHandle](/php/docs/reference/cloud-kms/latest/V1.KeyHandle)\nresource, e.g.\n\n`projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`.\n\n### setName\n\nIdentifier. Name of the [KeyHandle](/php/docs/reference/cloud-kms/latest/V1.KeyHandle)\nresource, e.g.\n\n`projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`.\n\n### getKmsKey\n\nOutput only. Name of a [CryptoKey](/php/docs/reference/cloud-kms/latest/V1.CryptoKey) that has\nbeen provisioned for Customer Managed Encryption Key (CMEK) use in the\n[KeyHandle](/php/docs/reference/cloud-kms/latest/V1.KeyHandle) project and location for the\nrequested resource type. The [CryptoKey](/php/docs/reference/cloud-kms/latest/V1.CryptoKey)\nproject will reflect the value configured in the\n[AutokeyConfig](/php/docs/reference/cloud-kms/latest/V1.AutokeyConfig) on the resource\nproject's ancestor folder at the time of the\n[KeyHandle](/php/docs/reference/cloud-kms/latest/V1.KeyHandle) creation. If more than one\nancestor folder has a configured\n[AutokeyConfig](/php/docs/reference/cloud-kms/latest/V1.AutokeyConfig), the nearest of these\nconfigurations is used.\n\n### setKmsKey\n\nOutput only. Name of a [CryptoKey](/php/docs/reference/cloud-kms/latest/V1.CryptoKey) that has\nbeen provisioned for Customer Managed Encryption Key (CMEK) use in the\n[KeyHandle](/php/docs/reference/cloud-kms/latest/V1.KeyHandle) project and location for the\nrequested resource type. The [CryptoKey](/php/docs/reference/cloud-kms/latest/V1.CryptoKey)\nproject will reflect the value configured in the\n[AutokeyConfig](/php/docs/reference/cloud-kms/latest/V1.AutokeyConfig) on the resource\nproject's ancestor folder at the time of the\n[KeyHandle](/php/docs/reference/cloud-kms/latest/V1.KeyHandle) creation. If more than one\nancestor folder has a configured\n[AutokeyConfig](/php/docs/reference/cloud-kms/latest/V1.AutokeyConfig), the nearest of these\nconfigurations is used.\n\n### getResourceTypeSelector\n\nRequired. Indicates the resource type that the resulting\n[CryptoKey](/php/docs/reference/cloud-kms/latest/V1.CryptoKey) is meant to protect, e.g.\n\n`{SERVICE}.googleapis.com/{TYPE}`. See documentation for supported resource\ntypes.\n\n### setResourceTypeSelector\n\nRequired. Indicates the resource type that the resulting\n[CryptoKey](/php/docs/reference/cloud-kms/latest/V1.CryptoKey) is meant to protect, e.g.\n\n`{SERVICE}.googleapis.com/{TYPE}`. See documentation for supported resource\ntypes."]]