Reference documentation and code samples for the Secret Manager V1 Client class CustomerManagedEncryption.
Configuration for encrypting secret payloads using customer-managed
encryption keys (CMEK).
Generated from protobuf message google.cloud.secretmanager.v1.CustomerManagedEncryption
Namespace
Google \ Cloud \ SecretManager \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ kms_key_name
string
Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads. For secrets using the UserManaged replication policy type, Cloud KMS CryptoKeys must reside in the same location as the replica location. For secrets using the Automatic replication policy type, Cloud KMS CryptoKeys must reside in global. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*.
getKmsKeyName
Required. The resource name of the Cloud KMS CryptoKey used to encrypt
secret payloads.
For secrets using the
UserManaged
replication policy type, Cloud KMS CryptoKeys must reside in the same
location as the replica location.
For secrets using the
Automatic
replication policy type, Cloud KMS CryptoKeys must reside in global.
The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*.
Returns
Type
Description
string
setKmsKeyName
Required. The resource name of the Cloud KMS CryptoKey used to encrypt
secret payloads.
For secrets using the
UserManaged
replication policy type, Cloud KMS CryptoKeys must reside in the same
location as the replica location.
For secrets using the
Automatic
replication policy type, Cloud KMS CryptoKeys must reside in global.
The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*.
[[["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,["# Secret Manager V1 Client - Class CustomerManagedEncryption (2.1.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.1 (latest)](/php/docs/reference/cloud-secret-manager/latest/V1.CustomerManagedEncryption)\n- [2.1.0](/php/docs/reference/cloud-secret-manager/2.1.0/V1.CustomerManagedEncryption)\n- [2.0.2](/php/docs/reference/cloud-secret-manager/2.0.2/V1.CustomerManagedEncryption)\n- [1.15.4](/php/docs/reference/cloud-secret-manager/1.15.4/V1.CustomerManagedEncryption)\n- [1.13.0](/php/docs/reference/cloud-secret-manager/1.13.0/V1.CustomerManagedEncryption)\n- [1.12.3](/php/docs/reference/cloud-secret-manager/1.12.3/V1.CustomerManagedEncryption)\n- [1.11.0](/php/docs/reference/cloud-secret-manager/1.11.0/V1.CustomerManagedEncryption)\n- [1.10.4](/php/docs/reference/cloud-secret-manager/1.10.4/V1.CustomerManagedEncryption)\n- [1.9.7](/php/docs/reference/cloud-secret-manager/1.9.7/V1.CustomerManagedEncryption) \nReference documentation and code samples for the Secret Manager V1 Client class CustomerManagedEncryption.\n\nConfiguration for encrypting secret payloads using customer-managed\nencryption keys (CMEK).\n\nGenerated from protobuf message `google.cloud.secretmanager.v1.CustomerManagedEncryption`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ SecretManager \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getKmsKeyName\n\nRequired. The resource name of the Cloud KMS CryptoKey used to encrypt\nsecret payloads.\n\nFor secrets using the\n[UserManaged](/php/docs/reference/cloud-secret-manager/latest/V1.Replication.UserManaged)\nreplication policy type, Cloud KMS CryptoKeys must reside in the same\nlocation as the replica location.\nFor secrets using the\n[Automatic](/php/docs/reference/cloud-secret-manager/latest/V1.Replication.Automatic)\nreplication policy type, Cloud KMS CryptoKeys must reside in `global`.\nThe expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.\n\n### setKmsKeyName\n\nRequired. The resource name of the Cloud KMS CryptoKey used to encrypt\nsecret payloads.\n\nFor secrets using the\n[UserManaged](/php/docs/reference/cloud-secret-manager/latest/V1.Replication.UserManaged)\nreplication policy type, Cloud KMS CryptoKeys must reside in the same\nlocation as the replica location.\nFor secrets using the\n[Automatic](/php/docs/reference/cloud-secret-manager/latest/V1.Replication.Automatic)\nreplication policy type, Cloud KMS CryptoKeys must reside in `global`.\nThe expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`."]]