# PublicKey

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

A `https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/PublicKey` describes a public key.

| JSON representation |
|---|
| ``` { "key": string, "format": enum (`https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/PublicKey#KeyFormat`) } ``` |

| Fields ||
|---|---|
| `key` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. A public key. The padding and encoding must match with the `KeyFormat` value specified for the `format` field. A base64-encoded string. |
| `format` | ``enum (`https://docs.cloud.google.com/certificate-authority-service/docs/reference/rest/v1/PublicKey#KeyFormat`)`` Required. The format of the public key. |

## KeyFormat

Types of public keys formats that are supported. Currently, only `PEM` format is supported.

| Enums ||
|---|---|
| `KEY_FORMAT_UNSPECIFIED` | Default unspecified value. |
| `PEM` | The key is PEM-encoded as defined in [RFC 7468](https://tools.ietf.org/html/rfc7468). It can be any of the following: a PEM-encoded PKCS#1/RFC 3447 RSAPublicKey structure, an RFC 5280 [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) or a PEM-encoded X.509 certificate signing request (CSR). If a [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) is specified, it can contain a A PEM-encoded PKCS#1/RFC 3447 RSAPublicKey or a NIST P-256/secp256r1/prime256v1 or P-384 key. If a CSR is specified, it will used solely for the purpose of extracting the public key. When generated by the service, it will always be an RFC 5280 [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) structure containing an algorithm identifier and a key. |