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 class Google::Cloud::Kms::V1::CryptoKeyVersionTemplate.

A [CryptoKeyVersionTemplate](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKeyVersionTemplate "Google::Cloud::Kms::V1::CryptoKeyVersionTemplate (class)")
specifies the properties to use when creating a new
[CryptoKeyVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKeyVersion "Google::Cloud::Kms::V1::CryptoKeyVersion (class)"), either manually
with
\[CreateCryptoKeyVersion\]\[google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion\]
or automatically as a result of auto-rotation.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #algorithm

    def algorithm() -> ::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm

**Returns**

- ([::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKeyVersion-CryptoKeyVersionAlgorithm)) --- Required. [Algorithm](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKeyVersion-CryptoKeyVersionAlgorithm "Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm (module)") to use when creating a [CryptoKeyVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKeyVersion "Google::Cloud::Kms::V1::CryptoKeyVersion (class)") based on this template.


  For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
  this field is omitted and
  [CryptoKey.purpose](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKey#Google__Cloud__Kms__V1__CryptoKey_purpose_instance_ "Google::Cloud::Kms::V1::CryptoKey#purpose (method)") is
  [ENCRYPT_DECRYPT](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__ENCRYPT_DECRYPT "Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT (constant)").

### #algorithm=

    def algorithm=(value) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm

**Parameter**

- **value** ([::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKeyVersion-CryptoKeyVersionAlgorithm)) --- Required. [Algorithm](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKeyVersion-CryptoKeyVersionAlgorithm "Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm (module)") to use when creating a [CryptoKeyVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKeyVersion "Google::Cloud::Kms::V1::CryptoKeyVersion (class)") based on this template.


  For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
  this field is omitted and
  [CryptoKey.purpose](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKey#Google__Cloud__Kms__V1__CryptoKey_purpose_instance_ "Google::Cloud::Kms::V1::CryptoKey#purpose (method)") is
  [ENCRYPT_DECRYPT](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__ENCRYPT_DECRYPT "Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT (constant)").
**Returns**

- ([::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKeyVersion-CryptoKeyVersionAlgorithm)) --- Required. [Algorithm](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKeyVersion-CryptoKeyVersionAlgorithm "Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm (module)") to use when creating a [CryptoKeyVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKeyVersion "Google::Cloud::Kms::V1::CryptoKeyVersion (class)") based on this template.


  For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
  this field is omitted and
  [CryptoKey.purpose](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKey#Google__Cloud__Kms__V1__CryptoKey_purpose_instance_ "Google::Cloud::Kms::V1::CryptoKey#purpose (method)") is
  [ENCRYPT_DECRYPT](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__ENCRYPT_DECRYPT "Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT (constant)").

### #protection_level

    def protection_level() -> ::Google::Cloud::Kms::V1::ProtectionLevel

**Returns**

- ([::Google::Cloud::Kms::V1::ProtectionLevel](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-ProtectionLevel)) --- [ProtectionLevel](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-ProtectionLevel "Google::Cloud::Kms::V1::ProtectionLevel (module)") to use when creating a [CryptoKeyVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKeyVersion "Google::Cloud::Kms::V1::CryptoKeyVersion (class)") based on this template. Immutable. Defaults to [SOFTWARE](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-ProtectionLevel#Google__Cloud__Kms__V1__ProtectionLevel__SOFTWARE "Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE (constant)").

### #protection_level=

    def protection_level=(value) -> ::Google::Cloud::Kms::V1::ProtectionLevel

**Parameter**

- **value** ([::Google::Cloud::Kms::V1::ProtectionLevel](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-ProtectionLevel)) --- [ProtectionLevel](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-ProtectionLevel "Google::Cloud::Kms::V1::ProtectionLevel (module)") to use when creating a [CryptoKeyVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKeyVersion "Google::Cloud::Kms::V1::CryptoKeyVersion (class)") based on this template. Immutable. Defaults to [SOFTWARE](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-ProtectionLevel#Google__Cloud__Kms__V1__ProtectionLevel__SOFTWARE "Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE (constant)").
**Returns**

- ([::Google::Cloud::Kms::V1::ProtectionLevel](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-ProtectionLevel)) --- [ProtectionLevel](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-ProtectionLevel "Google::Cloud::Kms::V1::ProtectionLevel (module)") to use when creating a [CryptoKeyVersion](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-CryptoKeyVersion "Google::Cloud::Kms::V1::CryptoKeyVersion (class)") based on this template. Immutable. Defaults to [SOFTWARE](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-kms-inventory-v1/latest/Google-Cloud-Kms-V1-ProtectionLevel#Google__Cloud__Kms__V1__ProtectionLevel__SOFTWARE "Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE (constant)").