- [Resource: Certificate](https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/projects.locations.caPools.certificates.md.txt#Certificate)
  - [JSON representation](https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/projects.locations.caPools.certificates.md.txt#Certificate.SCHEMA_REPRESENTATION)
- [SubjectRequestMode](https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/projects.locations.caPools.certificates.md.txt#SubjectRequestMode)
- [RevocationDetails](https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/projects.locations.caPools.certificates.md.txt#RevocationDetails)
  - [JSON representation](https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/projects.locations.caPools.certificates.md.txt#RevocationDetails.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/projects.locations.caPools.certificates.md.txt#METHODS_SUMMARY)

## Resource: Certificate

A `Certificate` corresponds to a signed X.509 certificate issued by a `CertificateAuthority`.

| JSON representation |
|---|
| ``` { "name": string, "issuerCertificateAuthority": string, "lifetime": string, "certificateTemplate": string, "subjectMode": enum (`SubjectRequestMode`), "revocationDetails": { object (`RevocationDetails`) }, "pemCertificate": string, "certificateDescription": { object (`CertificateDescription`) }, "pemCertificateChain": [ string ], "createTime": string, "updateTime": string, "labels": { string: string, ... }, "requestedNotBeforeTime": string, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "pemCsr": string, "config": { object (`CertificateConfig`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. The resource name for this `Certificate` in the format `projects/*/locations/*/caPools/*/certificates/*`. |
| `issuerCertificateAuthority` | `string` Output only. The resource name of the issuing `CertificateAuthority` in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. |
| `lifetime` | ``string (`Duration` format)`` Required. Immutable. The desired lifetime of a certificate. Used to create the "notBeforeTime" and "notAfterTime" 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. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |
| `certificateTemplate` | `string` Immutable. The resource name for a `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`. |
| `subjectMode` | ``enum (`SubjectRequestMode`)`` Immutable. Specifies how the `Certificate`'s identity fields are to be decided. If this is omitted, the `DEFAULT` subject mode will be used. |
| `revocationDetails` | ``object (`RevocationDetails`)`` Output only. Details regarding the revocation of this `Certificate`. This `Certificate` is considered revoked if and only if this field is present. |
| `pemCertificate` | `string` Output only. The pem-encoded, signed X.509 certificate. |
| `certificateDescription` | ``object (`CertificateDescription`)`` Output only. A structured description of the issued X.509 certificate. |
| `pemCertificateChain[]` | `string` 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. |
| `createTime` | ``string (`Timestamp` format)`` Output only. The time at which this `Certificate` was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `updateTime` | ``string (`Timestamp` format)`` Output only. The time at which this `Certificate` was updated. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `labels` | `map (key: string, value: string)` Optional. Labels with user-defined metadata. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `requestedNotBeforeTime` | ``string (`Timestamp` format)`` Optional. The requested `notBeforeTime` of this `Certificate`. This field may only be set if the `CaPool.IssuancePolicy.allow_requester_specified_not_before_time` field is set to true for the issuing `CaPool`. If this field is specified, the certificate will be issued with this 'notBeforeTime'. If this is not specified, the 'notBeforeTime' will be set to the issuance time or issuance time minus `backdateDuration` depending on the `CaPool` configuration. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| The config used to create a signed X.509 certificate. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `pemCsr` | `string` Immutable. A pem-encoded X.509 certificate signing request (CSR). |
| `config` | ``object (`CertificateConfig`)`` Immutable. A description of the certificate and key that does not require X.509 or ASN.1. |
| End of mutually exclusive fields. ||

## SubjectRequestMode

Describes the way in which a `Certificate`'s `Subject` and/or `SubjectAltNames` will be resolved.

| Enums ||
|---|---|
| `SUBJECT_REQUEST_MODE_UNSPECIFIED` | Not specified. |
| `DEFAULT` | The default mode used in most cases. Indicates that the certificate's `Subject` and/or `SubjectAltNames` are specified in the certificate request. This mode requires the caller to have the `privateca.certificates.create` permission. |
| `RDN_SEQUENCE` | A mode used to get an accurate representation of the Subject field's distinguished name. Indicates that the certificate's `Subject` and/or `SubjectAltNames` are specified in the certificate request. When parsing a PEM CSR this mode will maintain the sequence of RDNs found in the CSR's subject field in the issued `Certificate`. This mode requires the caller to have the `privateca.certificates.create` permission. |
| `REFLECTED_SPIFFE` | A mode reserved for special cases. Indicates that the certificate should have one SPIFFE `SubjectAltNames` set by the service based on the caller's identity. This mode will ignore any explicitly specified `Subject` and/or `SubjectAltNames` in the certificate request. This mode requires the caller to have the `privateca.certificates.createForSelf` permission. |

## RevocationDetails

Describes fields that are relavent to the revocation of a `Certificate`.

| JSON representation |
|---|
| ``` { "revocationState": enum (`RevocationReason`), "revocationTime": string } ``` |

| Fields ||
|---|---|
| `revocationState` | ``enum (`RevocationReason`)`` Indicates why a `Certificate` was revoked. |
| `revocationTime` | ``string (`Timestamp` format)`` The time at which this `Certificate` was revoked. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |

| ## Methods ||
|---|---|
| ### `create` | Create a new `Certificate` in a given Project, Location from a particular `CaPool`. |
| ### `get` | Returns a `Certificate`. |
| ### `list` | Lists `Certificates`. |
| ### `patch` | Update a `Certificate`. |
| ### `revoke` | Revoke a `Certificate`. |