# CertificateConfig

- [JSON representation](https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/CertificateConfig#SCHEMA_REPRESENTATION)
- [SubjectConfig](https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/CertificateConfig#SubjectConfig)
  - [JSON representation](https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/CertificateConfig#SubjectConfig.SCHEMA_REPRESENTATION)
- [KeyId](https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/CertificateConfig#KeyId)
  - [JSON representation](https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/CertificateConfig#KeyId.SCHEMA_REPRESENTATION)

A `https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/CertificateConfig` describes an X.509 certificate or CSR that is to be created, as an alternative to using ASN.1.

| JSON representation |
|---|
| ``` { "subjectConfig": { object (`https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/CertificateConfig#SubjectConfig`) }, "x509Config": { object (`https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/X509Parameters`) }, "publicKey": { object (`https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/PublicKey`) }, "subjectKeyId": { object (`https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/CertificateConfig#KeyId`) } } ``` |

| Fields ||
|---|---|
| `subjectConfig` | ``object (`https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/CertificateConfig#SubjectConfig`)`` Required. Specifies some of the values in a certificate that are related to the subject. |
| `x509Config` | ``object (`https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/X509Parameters`)`` Required. Describes how some of the technical X.509 fields in a certificate should be populated. |
| `publicKey` | ``object (`https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/PublicKey`)`` Optional. The public key that corresponds to this config. This is, for example, used when issuing `https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/projects.locations.caPools.certificates#Certificate`, but not when creating a self-signed `https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/projects.locations.caPools.certificateAuthorities#CertificateAuthority` or `https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/projects.locations.caPools.certificateAuthorities#CertificateAuthority` CSR. |
| `subjectKeyId` | ``object (`https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/CertificateConfig#KeyId`)`` Optional. When specified this provides a custom SKI to be used in the certificate. This should only be used to maintain a SKI of an existing CA originally created outside CA service, which was not generated using method (1) described in RFC 5280 section 4.2.1.2. |

## SubjectConfig

These values are used to create the distinguished name and subject alternative name fields in an X.509 certificate.

| JSON representation |
|---|
| ``` { "subject": { object (`https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/Subject`) }, "subjectAltName": { object (`https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/SubjectAltNames`) } } ``` |

| Fields ||
|---|---|
| `subject` | ``object (`https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/Subject`)`` Optional. Contains distinguished name fields such as the common name, location and organization. |
| `subjectAltName` | ``object (`https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/SubjectAltNames`)`` Optional. The subject alternative name fields. |

## KeyId

A KeyId identifies a specific public key, usually by hashing the public key.

| JSON representation |
|---|
| ``` { "keyId": string } ``` |

| Fields ||
|---|---|
| `keyId` | `string` Required. The value of this KeyId encoded in lowercase hexadecimal. This is most likely the 160 bit SHA-1 hash of the public key. |