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

These values describe fields in an issued X.509 certificate such as the
distinguished name, subject alternative names, serial number, and lifetime.

Generated from protobuf message `google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription`

## Namespace

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

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ subject` | `https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.Subject` Contains distinguished name fields such as the common name, location and / organization. |
| `↳ subject_alt_name` | `https://docs.cloud.google.com/php/docs/reference/cloud-security-private-ca/latest/V1.SubjectAltNames` The subject alternative name fields. |
| `↳ hex_serial_number` | `string` The serial number encoded in lowercase hexadecimal. |
| `↳ lifetime` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` For convenience, the actual lifetime of an issued certificate. |
| `↳ not_before_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` The time at which the certificate becomes valid. |
| `↳ not_after_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` The time after which the certificate is expired. Per RFC 5280, the validity period for a certificate is the period of time from not_before_time through not_after_time, inclusive. Corresponds to 'not_before_time' + 'lifetime' - 1 second. |

### getSubject

Contains distinguished name fields such as the common name, location and
/ organization.

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

### hasSubject

### clearSubject

### setSubject

Contains distinguished name fields such as the common name, location and
/ organization.

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

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

### getSubjectAltName

The subject alternative name fields.

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

### hasSubjectAltName

### clearSubjectAltName

### setSubjectAltName

The subject alternative name fields.

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

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

### getHexSerialNumber

The serial number encoded in lowercase hexadecimal.

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

### setHexSerialNumber

The serial number encoded in lowercase hexadecimal.

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

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

### getLifetime

For convenience, the actual lifetime of an issued certificate.

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

### hasLifetime

### clearLifetime

### setLifetime

For convenience, the actual lifetime of an issued certificate.

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

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

### getNotBeforeTime

The time at which the certificate becomes valid.

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

### hasNotBeforeTime

### clearNotBeforeTime

### setNotBeforeTime

The time at which the certificate becomes valid.

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

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

### getNotAfterTime

The time after which the certificate is expired.

Per RFC 5280, the validity period for a certificate is the period of time
from not_before_time through not_after_time, inclusive.
Corresponds to 'not_before_time' + 'lifetime' - 1 second.

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

### hasNotAfterTime

### clearNotAfterTime

### setNotAfterTime

The time after which the certificate is expired.

Per RFC 5280, the validity period for a certificate is the period of time
from not_before_time through not_after_time, inclusive.
Corresponds to 'not_before_time' + 'lifetime' - 1 second.

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

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