# Google Certificate Authority Service V1 Client - Class CertificateTemplate (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 CertificateTemplate.

A
[CertificateTemplate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate)
refers to a managed template for certificate issuance.

Generated from protobuf message `google.cloud.security.privateca.v1.CertificateTemplate`

## Namespace

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

## Methods

### __construct

Constructor.

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

### getName

Identifier. The resource name for this
[CertificateTemplate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate)
in the format `projects/*/locations/*/certificateTemplates/*`.

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

### setName

Identifier. The resource name for this
[CertificateTemplate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate)
in the format `projects/*/locations/*/certificateTemplates/*`.

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

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

### getMaximumLifetime

Optional. The maximum lifetime allowed for issued
[Certificates](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate) that use
this template. If the issuing
[CaPool](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool) resource's
[IssuancePolicy](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy)
specifies a
[maximum_lifetime](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy#_Google_Cloud_Security_PrivateCA_V1_CaPool_IssuancePolicy__getMaximumLifetime__)
the minimum of the two durations will be the maximum lifetime for issued
[Certificates](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate). Note that
if the issuing
[CertificateAuthority](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateAuthority)
expires before a
[Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate)'s requested
maximum_lifetime, the effective lifetime will be explicitly truncated
to match it.

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

### hasMaximumLifetime

### clearMaximumLifetime

### setMaximumLifetime

Optional. The maximum lifetime allowed for issued
[Certificates](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate) that use
this template. If the issuing
[CaPool](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool) resource's
[IssuancePolicy](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy)
specifies a
[maximum_lifetime](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy#_Google_Cloud_Security_PrivateCA_V1_CaPool_IssuancePolicy__getMaximumLifetime__)
the minimum of the two durations will be the maximum lifetime for issued
[Certificates](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate). Note that
if the issuing
[CertificateAuthority](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateAuthority)
expires before a
[Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate)'s requested
maximum_lifetime, the effective lifetime will be explicitly truncated
to match it.

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

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

### getPredefinedValues

Optional. A set of X.509 values that will be applied to all issued
certificates that use this template. If the certificate request includes
conflicting values for the same properties, they will be overwritten by the
values defined here. If the issuing
[CaPool](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool)'s
[IssuancePolicy](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy)
defines conflicting
[baseline_values](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy#_Google_Cloud_Security_PrivateCA_V1_CaPool_IssuancePolicy__getBaselineValues__)
for the same properties, the certificate issuance request will fail.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.X509Parameters|null` |   |

### hasPredefinedValues

### clearPredefinedValues

### setPredefinedValues

Optional. A set of X.509 values that will be applied to all issued
certificates that use this template. If the certificate request includes
conflicting values for the same properties, they will be overwritten by the
values defined here. If the issuing
[CaPool](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool)'s
[IssuancePolicy](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy)
defines conflicting
[baseline_values](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy#_Google_Cloud_Security_PrivateCA_V1_CaPool_IssuancePolicy__getBaselineValues__)
for the same properties, the certificate issuance request will fail.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.X509Parameters` |

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

### getIdentityConstraints

Optional. Describes constraints on identities that may be appear in
[Certificates](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate) issued using
this template. If this is omitted, then this template will not add
restrictions on a certificate's identity.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateIdentityConstraints|null` |   |

### hasIdentityConstraints

### clearIdentityConstraints

### setIdentityConstraints

Optional. Describes constraints on identities that may be appear in
[Certificates](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate) issued using
this template. If this is omitted, then this template will not add
restrictions on a certificate's identity.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateIdentityConstraints` |

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

### getPassthroughExtensions

Optional. Describes the set of X.509 extensions that may appear in a
[Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate) issued using
this
[CertificateTemplate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate).

If a certificate request sets extensions that don't appear in the
[passthrough_extensions](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate#_Google_Cloud_Security_PrivateCA_V1_CertificateTemplate__getPassthroughExtensions__),
those extensions will be dropped. If the issuing
[CaPool](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool)'s
[IssuancePolicy](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy)
defines
[baseline_values](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy#_Google_Cloud_Security_PrivateCA_V1_CaPool_IssuancePolicy__getBaselineValues__)
that don't appear here, the certificate issuance request will fail. If this
is omitted, then this template will not add restrictions on a certificate's
X.509 extensions. These constraints do not apply to X.509 extensions set in
this
[CertificateTemplate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate)'s
[predefined_values](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate#_Google_Cloud_Security_PrivateCA_V1_CertificateTemplate__getPredefinedValues__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateExtensionConstraints|null` |   |

### hasPassthroughExtensions

### clearPassthroughExtensions

### setPassthroughExtensions

Optional. Describes the set of X.509 extensions that may appear in a
[Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate) issued using
this
[CertificateTemplate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate).

If a certificate request sets extensions that don't appear in the
[passthrough_extensions](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate#_Google_Cloud_Security_PrivateCA_V1_CertificateTemplate__getPassthroughExtensions__),
those extensions will be dropped. If the issuing
[CaPool](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool)'s
[IssuancePolicy](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy)
defines
[baseline_values](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy#_Google_Cloud_Security_PrivateCA_V1_CaPool_IssuancePolicy__getBaselineValues__)
that don't appear here, the certificate issuance request will fail. If this
is omitted, then this template will not add restrictions on a certificate's
X.509 extensions. These constraints do not apply to X.509 extensions set in
this
[CertificateTemplate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate)'s
[predefined_values](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate#_Google_Cloud_Security_PrivateCA_V1_CertificateTemplate__getPredefinedValues__).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateExtensionConstraints` |

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

### getDescription

Optional. A human-readable description of scenarios this template is
intended for.

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

### setDescription

Optional. A human-readable description of scenarios this template is
intended for.

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

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

### getCreateTime

Output only. The time at which this
[CertificateTemplate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate)
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
[CertificateTemplate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate)
was created.

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

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

### getUpdateTime

Output only. The time at which this
[CertificateTemplate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate)
was updated.

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

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The time at which this
[CertificateTemplate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateTemplate)
was updated.

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

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

### getLabels

Optional. Labels with user-defined metadata.

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

### setLabels

Optional. Labels with user-defined metadata.

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

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