# Google Certificate Authority Service V1 Client - Class KeyVersionSpec (2.4.0)

2.4.0 (latest) 2.3.0 2.2.2 2.1.1 2.0.3 1.7.3 1.5.0 1.4.2 1.3.1 1.2.2 1.1.0 1.0.3 Reference documentation and code samples for the Google Certificate Authority Service V1 Client class KeyVersionSpec.

A Cloud KMS key configuration that a
[CertificateAuthority](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateAuthority)
will use.

Generated from protobuf message `google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec`

## Namespace

Google \\ Cloud \\ Security \\ PrivateCA \\ V1 \\ CertificateAuthority

## Methods

### __construct

Constructor.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `data` | `mixed` |

### getCloudKmsKeyVersion

The resource name for an existing Cloud KMS CryptoKeyVersion in the
format
`projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.

This option enables full flexibility in the key's capabilities and
properties.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasCloudKmsKeyVersion

### setCloudKmsKeyVersion

The resource name for an existing Cloud KMS CryptoKeyVersion in the
format
`projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.

This option enables full flexibility in the key's capabilities and
properties.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAlgorithm

The algorithm to use for creating a managed Cloud KMS key for a for a
simplified experience. All managed keys will be have their
ProtectionLevel as `HSM`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [SignHashAlgorithm](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateAuthority.SignHashAlgorithm). |

### hasAlgorithm

### setAlgorithm

The algorithm to use for creating a managed Cloud KMS key for a for a
simplified experience. All managed keys will be have their
ProtectionLevel as `HSM`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [SignHashAlgorithm](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateAuthority.SignHashAlgorithm). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getKeyVersion

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |