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

A [Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate) corresponds
to a signed X.509 certificate issued by a
[CertificateAuthority](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateAuthority).

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

## Namespace

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

## Methods

### __construct

Constructor.

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

### getName

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

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

### setName

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

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

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

### getPemCsr

Immutable. A pem-encoded X.509 certificate signing request (CSR).

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

### hasPemCsr

### setPemCsr

Immutable. A pem-encoded X.509 certificate signing request (CSR).

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

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

### getConfig

Immutable. A description of the certificate and key that does not require
X.509 or ASN.1.

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

### hasConfig

### setConfig

Immutable. A description of the certificate and key that does not require
X.509 or ASN.1.

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

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

### getIssuerCertificateAuthority

Output only. The resource name of the issuing
[CertificateAuthority](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateAuthority)
in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`.

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

### setIssuerCertificateAuthority

Output only. The resource name of the issuing
[CertificateAuthority](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateAuthority)
in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`.

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

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

### getLifetime

Required. Immutable. The desired lifetime of a certificate. Used to create
the "not_before_time" and "not_after_time" fields inside an X.509
certificate. Note that the lifetime may be truncated if it would extend
past the life of any certificate authority in the issuing chain.

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

### hasLifetime

### clearLifetime

### setLifetime

Required. Immutable. The desired lifetime of a certificate. Used to create
the "not_before_time" and "not_after_time" fields inside an X.509
certificate. Note that the lifetime may be truncated if it would extend
past the life of any certificate authority in the issuing chain.

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

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

### getCertificateTemplate

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

If this is specified, the caller must have the necessary permission to
use this template. If this is omitted, no template will be used.
This template must be in the same location as the
[Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate).

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

### setCertificateTemplate

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

If this is specified, the caller must have the necessary permission to
use this template. If this is omitted, no template will be used.
This template must be in the same location as the
[Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate).

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

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

### getSubjectMode

Immutable. Specifies how the
[Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate)'s identity
fields are to be decided. If this is omitted, the `DEFAULT` subject mode
will be used.

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

### setSubjectMode

Immutable. Specifies how the
[Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate)'s identity
fields are to be decided. If this is omitted, the `DEFAULT` subject mode
will be used.

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

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

### getRevocationDetails

Output only. Details regarding the revocation of this
[Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate). This
[Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate) is considered
revoked if and only if this field is present.

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

### hasRevocationDetails

### clearRevocationDetails

### setRevocationDetails

Output only. Details regarding the revocation of this
[Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate). This
[Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate) is considered
revoked if and only if this field is present.

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

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

### getPemCertificate

Output only. The pem-encoded, signed X.509 certificate.

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

### setPemCertificate

Output only. The pem-encoded, signed X.509 certificate.

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

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

### getCertificateDescription

Output only. A structured description of the issued X.509 certificate.

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

### hasCertificateDescription

### clearCertificateDescription

### setCertificateDescription

Output only. A structured description of the issued X.509 certificate.

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

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

### getPemCertificateChain

Output only. The chain that may be used to verify the X.509 certificate.

Expected to be in issuer-to-root order according to RFC 5246.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setPemCertificateChain

Output only. The chain that may be used to verify the X.509 certificate.

Expected to be in issuer-to-root order according to RFC 5246.

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

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

### getCreateTime

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

### getRequestedNotBeforeTime

Optional. The requested
[not_before_time](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateDescription.SubjectDescription#_Google_Cloud_Security_PrivateCA_V1_CertificateDescription_SubjectDescription__getNotBeforeTime__)
of this [Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate). This
field may only be set if the
[CaPool.IssuancePolicy.allow_requester_specified_not_before_time](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy#_Google_Cloud_Security_PrivateCA_V1_CaPool_IssuancePolicy__getAllowRequesterSpecifiedNotBeforeTime__)
field is set to true for the issuing
[CaPool](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool).

If this field is specified, the certificate will be issued with this
'not_before_time'. If this is not specified, the 'not_before_time' will be
set to the issuance time or issuance time minus
[backdate_duration](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy#_Google_Cloud_Security_PrivateCA_V1_CaPool_IssuancePolicy__getBackdateDuration__)
depending on the [CaPool](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool)
configuration.

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

### hasRequestedNotBeforeTime

### clearRequestedNotBeforeTime

### setRequestedNotBeforeTime

Optional. The requested
[not_before_time](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CertificateDescription.SubjectDescription#_Google_Cloud_Security_PrivateCA_V1_CertificateDescription_SubjectDescription__getNotBeforeTime__)
of this [Certificate](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Certificate). This
field may only be set if the
[CaPool.IssuancePolicy.allow_requester_specified_not_before_time](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy#_Google_Cloud_Security_PrivateCA_V1_CaPool_IssuancePolicy__getAllowRequesterSpecifiedNotBeforeTime__)
field is set to true for the issuing
[CaPool](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool).

If this field is specified, the certificate will be issued with this
'not_before_time'. If this is not specified, the 'not_before_time' will be
set to the issuance time or issuance time minus
[backdate_duration](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool.IssuancePolicy#_Google_Cloud_Security_PrivateCA_V1_CaPool_IssuancePolicy__getBackdateDuration__)
depending on the [CaPool](https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.CaPool)
configuration.

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

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

### getCertificateConfig

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