# Cloud KMS V1 Client - Class CryptoKey (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 CryptoKey.

A [CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) represents a logical key that
can be used for cryptographic operations.

A [CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) is made up of zero or more
[versions](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion), which represent the actual
key material used in cryptographic operations.

Generated from protobuf message `google.cloud.kms.v1.CryptoKey`

## Namespace

Google \\ Cloud \\ Kms \\ V1

## Methods

### __construct

Constructor.

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

### getName

Output only. The resource name for this
[CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) in the format
`projects/*/locations/*/keyRings/*/cryptoKeys/*`.

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

### setName

Output only. The resource name for this
[CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) in the format
`projects/*/locations/*/keyRings/*/cryptoKeys/*`.

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

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

### getPrimary

Output only. A copy of the "primary"
[CryptoKeyVersion](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion) that will be used
by [Encrypt](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__encrypt__) when this
[CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) is given in
[EncryptRequest.name](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.EncryptRequest#_Google_Cloud_Kms_V1_EncryptRequest__getName__).

The [CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey)'s primary version can be
updated via
[UpdateCryptoKeyPrimaryVersion](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__updateCryptoKeyPrimaryVersion__).
Keys with [purpose](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getPurpose__)
[ENCRYPT_DECRYPT](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey.CryptoKeyPurpose#_Google_Cloud_Kms_V1_CryptoKey_CryptoKeyPurpose__ENCRYPT_DECRYPT)
may have a primary. For other keys, this field will be omitted.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion|null` |   |

### hasPrimary

### clearPrimary

### setPrimary

Output only. A copy of the "primary"
[CryptoKeyVersion](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion) that will be used
by [Encrypt](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__encrypt__) when this
[CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) is given in
[EncryptRequest.name](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.EncryptRequest#_Google_Cloud_Kms_V1_EncryptRequest__getName__).

The [CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey)'s primary version can be
updated via
[UpdateCryptoKeyPrimaryVersion](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__updateCryptoKeyPrimaryVersion__).
Keys with [purpose](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getPurpose__)
[ENCRYPT_DECRYPT](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey.CryptoKeyPurpose#_Google_Cloud_Kms_V1_CryptoKey_CryptoKeyPurpose__ENCRYPT_DECRYPT)
may have a primary. For other keys, this field will be omitted.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion` |

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

### getPurpose

Immutable. The immutable purpose of this
[CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [CryptoKeyPurpose](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey.CryptoKeyPurpose). |

### setPurpose

Immutable. The immutable purpose of this
[CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [CryptoKeyPurpose](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey.CryptoKeyPurpose). |

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

### getCreateTime

Output only. The time at which this
[CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) was created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time at which this
[CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) was created.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getNextRotationTime

At [next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getNextRotationTime__),
the Key Management Service will automatically:

1. Create a new version of this [CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey).

2. Mark the new version as primary.
   Key rotations performed manually via
   [CreateCryptoKeyVersion](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__createCryptoKeyVersion__)
   and
   [UpdateCryptoKeyPrimaryVersion](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__updateCryptoKeyPrimaryVersion__)
   do not affect
   [next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getNextRotationTime__).
   Keys with [purpose](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getPurpose__)
   [ENCRYPT_DECRYPT](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey.CryptoKeyPurpose#_Google_Cloud_Kms_V1_CryptoKey_CryptoKeyPurpose__ENCRYPT_DECRYPT)
   support automatic rotation. For other keys, this field must be omitted.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasNextRotationTime

### clearNextRotationTime

### setNextRotationTime

At [next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getNextRotationTime__),
the Key Management Service will automatically:

1. Create a new version of this [CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey).

2. Mark the new version as primary.
   Key rotations performed manually via
   [CreateCryptoKeyVersion](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__createCryptoKeyVersion__)
   and
   [UpdateCryptoKeyPrimaryVersion](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__updateCryptoKeyPrimaryVersion__)
   do not affect
   [next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getNextRotationTime__).
   Keys with [purpose](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getPurpose__)
   [ENCRYPT_DECRYPT](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey.CryptoKeyPurpose#_Google_Cloud_Kms_V1_CryptoKey_CryptoKeyPurpose__ENCRYPT_DECRYPT)
   support automatic rotation. For other keys, this field must be omitted.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getRotationPeriod

[next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getNextRotationTime__)
will be advanced by this period when the service automatically rotates a
key. Must be at least 24 hours and at most 876,000 hours.

If [rotation_period](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getRotationPeriod__) is
set,
[next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getNextRotationTime__)
must also be set.
Keys with [purpose](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getPurpose__)
[ENCRYPT_DECRYPT](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey.CryptoKeyPurpose#_Google_Cloud_Kms_V1_CryptoKey_CryptoKeyPurpose__ENCRYPT_DECRYPT)
support automatic rotation. For other keys, this field must be omitted.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasRotationPeriod

### setRotationPeriod

[next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getNextRotationTime__)
will be advanced by this period when the service automatically rotates a
key. Must be at least 24 hours and at most 876,000 hours.

If [rotation_period](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getRotationPeriod__) is
set,
[next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getNextRotationTime__)
must also be set.
Keys with [purpose](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey#_Google_Cloud_Kms_V1_CryptoKey__getPurpose__)
[ENCRYPT_DECRYPT](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey.CryptoKeyPurpose#_Google_Cloud_Kms_V1_CryptoKey_CryptoKeyPurpose__ENCRYPT_DECRYPT)
support automatic rotation. For other keys, this field must be omitted.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

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

### getVersionTemplate

A template describing settings for new
[CryptoKeyVersion](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion) instances. The
properties of new [CryptoKeyVersion](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion)
instances created by either
[CreateCryptoKeyVersion](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__createCryptoKeyVersion__)
or auto-rotation are controlled by this template.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersionTemplate|null` |   |

### hasVersionTemplate

### clearVersionTemplate

### setVersionTemplate

A template describing settings for new
[CryptoKeyVersion](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion) instances. The
properties of new [CryptoKeyVersion](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion)
instances created by either
[CreateCryptoKeyVersion](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__createCryptoKeyVersion__)
or auto-rotation are controlled by this template.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersionTemplate` |

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

### getLabels

Labels with user-defined metadata. For more information, see
[Labeling Keys](https://cloud.google.com/kms/docs/labeling-keys).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

Labels with user-defined metadata. For more information, see
[Labeling Keys](https://cloud.google.com/kms/docs/labeling-keys).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getImportOnly

Immutable. Whether this key may contain imported versions only.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setImportOnly

Immutable. Whether this key may contain imported versions only.

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

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

### getDestroyScheduledDuration

Immutable. The period of time that versions of this key spend in the
[DESTROY_SCHEDULED](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion.CryptoKeyVersionState#_Google_Cloud_Kms_V1_CryptoKeyVersion_CryptoKeyVersionState__DESTROY_SCHEDULED)
state before transitioning to
[DESTROYED](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion.CryptoKeyVersionState#_Google_Cloud_Kms_V1_CryptoKeyVersion_CryptoKeyVersionState__DESTROYED).

If not specified at creation time, the default duration is 30 days.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasDestroyScheduledDuration

### clearDestroyScheduledDuration

### setDestroyScheduledDuration

Immutable. The period of time that versions of this key spend in the
[DESTROY_SCHEDULED](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion.CryptoKeyVersionState#_Google_Cloud_Kms_V1_CryptoKeyVersion_CryptoKeyVersionState__DESTROY_SCHEDULED)
state before transitioning to
[DESTROYED](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion.CryptoKeyVersionState#_Google_Cloud_Kms_V1_CryptoKeyVersion_CryptoKeyVersionState__DESTROYED).

If not specified at creation time, the default duration is 30 days.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

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

### getCryptoKeyBackend

Immutable. The resource name of the backend environment where the key
material for all [CryptoKeyVersions](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion)
associated with this [CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) reside and
where all related cryptographic operations are performed. Only applicable
if [CryptoKeyVersions](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion) have a
[ProtectionLevel](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.ProtectionLevel) of
[EXTERNAL_VPC](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.ProtectionLevel#_Google_Cloud_Kms_V1_ProtectionLevel__EXTERNAL_VPC), with the
resource name in the format `projects/*/locations/*/ekmConnections/*`. Only
applicable if [CryptoKeyVersions](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion)
have a [ProtectionLevel](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.ProtectionLevel) of
[HSM_SINGLE_TENANT](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.ProtectionLevel#_Google_Cloud_Kms_V1_ProtectionLevel__HSM_SINGLE_TENANT),
with the resource name in the format
`projects/*/locations/*/singleTenantHsmInstances/*`.

Note, this list is non-exhaustive and may apply to additional
[ProtectionLevels](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.ProtectionLevel) in the future.

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

### setCryptoKeyBackend

Immutable. The resource name of the backend environment where the key
material for all [CryptoKeyVersions](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion)
associated with this [CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) reside and
where all related cryptographic operations are performed. Only applicable
if [CryptoKeyVersions](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion) have a
[ProtectionLevel](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.ProtectionLevel) of
[EXTERNAL_VPC](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.ProtectionLevel#_Google_Cloud_Kms_V1_ProtectionLevel__EXTERNAL_VPC), with the
resource name in the format `projects/*/locations/*/ekmConnections/*`. Only
applicable if [CryptoKeyVersions](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion)
have a [ProtectionLevel](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.ProtectionLevel) of
[HSM_SINGLE_TENANT](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.ProtectionLevel#_Google_Cloud_Kms_V1_ProtectionLevel__HSM_SINGLE_TENANT),
with the resource name in the format
`projects/*/locations/*/singleTenantHsmInstances/*`.

Note, this list is non-exhaustive and may apply to additional
[ProtectionLevels](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.ProtectionLevel) in the future.

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

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

### getKeyAccessJustificationsPolicy

Optional. The policy used for Key Access Justifications Policy Enforcement.

If this field is present and this key is enrolled in Key Access
Justifications Policy Enforcement, the policy will be evaluated in encrypt,
decrypt, and sign operations, and the operation will fail if rejected by
the policy. The policy is defined by specifying zero or more allowed
justification codes.
<https://cloud.google.com/assured-workloads/key-access-justifications/docs/justification-codes>
By default, this field is absent, and all justification codes are allowed.
If the
`key_access_justifications_policy.allowed_access_reasons`
is empty (zero allowed justification code), all encrypt, decrypt, and sign
operations will fail.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.KeyAccessJustificationsPolicy|null` |   |

### hasKeyAccessJustificationsPolicy

### clearKeyAccessJustificationsPolicy

### setKeyAccessJustificationsPolicy

Optional. The policy used for Key Access Justifications Policy Enforcement.

If this field is present and this key is enrolled in Key Access
Justifications Policy Enforcement, the policy will be evaluated in encrypt,
decrypt, and sign operations, and the operation will fail if rejected by
the policy. The policy is defined by specifying zero or more allowed
justification codes.
<https://cloud.google.com/assured-workloads/key-access-justifications/docs/justification-codes>
By default, this field is absent, and all justification codes are allowed.
If the
`key_access_justifications_policy.allowed_access_reasons`
is empty (zero allowed justification code), all encrypt, decrypt, and sign
operations will fail.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.KeyAccessJustificationsPolicy` |

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

### getRotationSchedule

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