# Cloud KMS V1 Client - Class CryptoKeyPurpose (2.9.0)

2.9.0 (latest) 2.8.0 2.7.0 2.6.0 2.5.2 2.4.0 2.3.1 2.2.0 2.1.6 2.0.0 1.23.0 1.22.1 1.21.4 1.20.3 1.19.0 1.18.1 1.17.0 1.16.4 1.15.3 Reference documentation and code samples for the Cloud KMS V1 Client class CryptoKeyPurpose.

[CryptoKeyPurpose](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey.CryptoKeyPurpose)
describes the cryptographic capabilities of a
[CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey). A given key can only be used
for the operations allowed by its purpose. For more information, see [Key
purposes](https://cloud.google.com/kms/docs/algorithms#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;`

### ENCRYPT_DECRYPT

    Value: 1

[CryptoKeys](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) with this purpose may be used
with [Encrypt](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__encrypt__) and
[Decrypt](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__decrypt__).

Generated from protobuf enum `ENCRYPT_DECRYPT = 1;`

### ASYMMETRIC_SIGN

    Value: 5

[CryptoKeys](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) with this purpose may be used
with
[AsymmetricSign](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__asymmetricSign__)
and
[GetPublicKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__getPublicKey__).

Generated from protobuf enum `ASYMMETRIC_SIGN = 5;`

### ASYMMETRIC_DECRYPT

    Value: 6

[CryptoKeys](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) with this purpose may be used
with
[AsymmetricDecrypt](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__asymmetricDecrypt__)
and
[GetPublicKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__getPublicKey__).

Generated from protobuf enum `ASYMMETRIC_DECRYPT = 6;`

### RAW_ENCRYPT_DECRYPT

    Value: 7

[CryptoKeys](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) with this purpose may be used
with [RawEncrypt](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__rawEncrypt__)
and [RawDecrypt](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__rawDecrypt__).

This purpose is meant to be used for interoperable symmetric
encryption and does not support automatic CryptoKey rotation.

Generated from protobuf enum `RAW_ENCRYPT_DECRYPT = 7;`

### MAC

    Value: 9

[CryptoKeys](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) with this purpose may be used
with [MacSign](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__macSign__).

Generated from protobuf enum `MAC = 9;`

### KEY_ENCAPSULATION

    Value: 10

[CryptoKeys](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) with this purpose may be used
with
[GetPublicKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__getPublicKey__)
and [Decapsulate](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__decapsulate__).

Generated from protobuf enum `KEY_ENCAPSULATION = 10;`