0.22.0 (latest) 0.21.0 0.20.0 0.19.0 0.18.0 0.17.0 0.16.2 0.15.1 0.14.1 0.13.0 0.12.2 0.11.3 0.10.0 0.9.1 0.8.3 0.7.0 0.6.1 0.5.0 0.4.0 0.3.0 0.2.1 0.1.0 Reference documentation and code samples for the KMS Inventory V1 API module Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose.

[CryptoKeyPurpose](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKey-CryptoKeyPurpose "Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose (module)")
describes the cryptographic capabilities of a
[CryptoKey](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKey "Google::Cloud::Kms::V1::CryptoKey (class)"). 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).

## Constants

### CRYPTO_KEY_PURPOSE_UNSPECIFIED

**value:** 0  
Not specified.

### ENCRYPT_DECRYPT

**value:** 1  
[CryptoKeys](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKey "Google::Cloud::Kms::V1::CryptoKey (class)") with this purpose may be used
with \[Encrypt\]\[google.cloud.kms.v1.KeyManagementService.Encrypt\] and
\[Decrypt\]\[google.cloud.kms.v1.KeyManagementService.Decrypt\].

### ASYMMETRIC_SIGN

**value:** 5  
[CryptoKeys](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKey "Google::Cloud::Kms::V1::CryptoKey (class)") with this purpose may be used
with
\[AsymmetricSign\]\[google.cloud.kms.v1.KeyManagementService.AsymmetricSign\]
and
\[GetPublicKey\]\[google.cloud.kms.v1.KeyManagementService.GetPublicKey\].

### ASYMMETRIC_DECRYPT

**value:** 6  
[CryptoKeys](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKey "Google::Cloud::Kms::V1::CryptoKey (class)") with this purpose may be used
with
\[AsymmetricDecrypt\]\[google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt\]
and
\[GetPublicKey\]\[google.cloud.kms.v1.KeyManagementService.GetPublicKey\].

### RAW_ENCRYPT_DECRYPT

**value:** 7  
[CryptoKeys](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKey "Google::Cloud::Kms::V1::CryptoKey (class)") with this purpose may be used
with \[RawEncrypt\]\[google.cloud.kms.v1.KeyManagementService.RawEncrypt\]
and \[RawDecrypt\]\[google.cloud.kms.v1.KeyManagementService.RawDecrypt\].
This purpose is meant to be used for interoperable symmetric
encryption and does not support automatic CryptoKey rotation.

### MAC

**value:** 9  
[CryptoKeys](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKey "Google::Cloud::Kms::V1::CryptoKey (class)") with this purpose may be used
with \[MacSign\]\[google.cloud.kms.v1.KeyManagementService.MacSign\].

### KEY_ENCAPSULATION

**value:** 10  
[CryptoKeys](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKey "Google::Cloud::Kms::V1::CryptoKey (class)") with this purpose may be used
with
\[GetPublicKey\]\[google.cloud.kms.v1.KeyManagementService.GetPublicKey\]
and \[Decapsulate\]\[google.cloud.kms.v1.KeyManagementService.Decapsulate\].