Reference documentation and code samples for the Cloud KMS V1 Client class CryptoKeyPurpose.
CryptoKeyPurpose
describes the cryptographic capabilities of a
CryptoKey. A given key can only be used
for the operations allowed by its purpose. For more information, see Key
purposes.
Protobuf type google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose
Namespace
Google \ Cloud \ Kms \ V1 \ CryptoKey
Methods
static::name
Parameter
Name
Description
value
mixed
static::value
Parameter
Name
Description
name
mixed
Constants
CRYPTO_KEY_PURPOSE_UNSPECIFIED
Value: 0
Not specified.
Generated from protobuf enum CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0;
[[["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 CryptoKeyPurpose (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-kms/latest/V1.CryptoKey.CryptoKeyPurpose)\n- [2.3.0](/php/docs/reference/cloud-kms/2.3.0/V1.CryptoKey.CryptoKeyPurpose)\n- [2.2.0](/php/docs/reference/cloud-kms/2.2.0/V1.CryptoKey.CryptoKeyPurpose)\n- [2.1.6](/php/docs/reference/cloud-kms/2.1.6/V1.CryptoKey.CryptoKeyPurpose)\n- [2.0.0](/php/docs/reference/cloud-kms/2.0.0/V1.CryptoKey.CryptoKeyPurpose)\n- [1.23.0](/php/docs/reference/cloud-kms/1.23.0/V1.CryptoKey.CryptoKeyPurpose)\n- [1.22.1](/php/docs/reference/cloud-kms/1.22.1/V1.CryptoKey.CryptoKeyPurpose)\n- [1.21.4](/php/docs/reference/cloud-kms/1.21.4/V1.CryptoKey.CryptoKeyPurpose)\n- [1.20.3](/php/docs/reference/cloud-kms/1.20.3/V1.CryptoKey.CryptoKeyPurpose)\n- [1.19.0](/php/docs/reference/cloud-kms/1.19.0/V1.CryptoKey.CryptoKeyPurpose)\n- [1.18.1](/php/docs/reference/cloud-kms/1.18.1/V1.CryptoKey.CryptoKeyPurpose)\n- [1.17.0](/php/docs/reference/cloud-kms/1.17.0/V1.CryptoKey.CryptoKeyPurpose)\n- [1.16.4](/php/docs/reference/cloud-kms/1.16.4/V1.CryptoKey.CryptoKeyPurpose)\n- [1.15.3](/php/docs/reference/cloud-kms/1.15.3/V1.CryptoKey.CryptoKeyPurpose) \nReference documentation and code samples for the Cloud KMS V1 Client class CryptoKeyPurpose.\n\n[CryptoKeyPurpose](/php/docs/reference/cloud-kms/latest/V1.CryptoKey.CryptoKeyPurpose)\ndescribes the cryptographic capabilities of a\n[CryptoKey](/php/docs/reference/cloud-kms/latest/V1.CryptoKey). A given key can only be used\nfor the operations allowed by its purpose. For more information, see [Key\npurposes](https://cloud.google.com/kms/docs/algorithms#key_purposes).\n\nProtobuf type `google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Kms \\\\ V1 \\\\ CryptoKey\n\nMethods\n-------\n\n### static::name\n\n### static::value\n\nConstants\n---------\n\n### CRYPTO_KEY_PURPOSE_UNSPECIFIED\n\n Value: 0\n\nNot specified.\n\nGenerated from protobuf enum `CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0;`\n\n### ENCRYPT_DECRYPT\n\n Value: 1\n\n[CryptoKeys](/php/docs/reference/cloud-kms/latest/V1.CryptoKey) with this purpose may be used\nwith [Encrypt](/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__encrypt__) and\n[Decrypt](/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__decrypt__).\n\nGenerated from protobuf enum `ENCRYPT_DECRYPT = 1;`\n\n### ASYMMETRIC_SIGN\n\n Value: 5\n\n[CryptoKeys](/php/docs/reference/cloud-kms/latest/V1.CryptoKey) with this purpose may be used\nwith\n[AsymmetricSign](/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__asymmetricSign__)\nand\n[GetPublicKey](/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__getPublicKey__).\n\nGenerated from protobuf enum `ASYMMETRIC_SIGN = 5;`\n\n### ASYMMETRIC_DECRYPT\n\n Value: 6\n\n[CryptoKeys](/php/docs/reference/cloud-kms/latest/V1.CryptoKey) with this purpose may be used\nwith\n[AsymmetricDecrypt](/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__asymmetricDecrypt__)\nand\n[GetPublicKey](/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__getPublicKey__).\n\nGenerated from protobuf enum `ASYMMETRIC_DECRYPT = 6;`\n\n### RAW_ENCRYPT_DECRYPT\n\n Value: 7\n\n[CryptoKeys](/php/docs/reference/cloud-kms/latest/V1.CryptoKey) with this purpose may be used\nwith [RawEncrypt](/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__rawEncrypt__)\nand [RawDecrypt](/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__rawDecrypt__).\n\nThis purpose is meant to be used for interoperable symmetric\nencryption and does not support automatic CryptoKey rotation.\n\nGenerated from protobuf enum `RAW_ENCRYPT_DECRYPT = 7;`\n\n### MAC\n\n Value: 9\n\n[CryptoKeys](/php/docs/reference/cloud-kms/latest/V1.CryptoKey) with this purpose may be used\nwith [MacSign](/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__macSign__).\n\nGenerated from protobuf enum `MAC = 9;`"]]