# Cloud KMS V1 Client - Class PublicKeyFormat (2.9.0)

2.9.0 (latest) 2.8.0 2.7.0 2.6.0 2.5.2 2.4.0 2.3.1 2.2.0 2.1.6 2.0.0 1.23.0 1.22.1 1.21.4 1.20.3 1.19.0 1.18.1 1.17.0 1.16.4 1.15.3 Reference documentation and code samples for the Cloud KMS V1 Client class PublicKeyFormat.

The supported [PublicKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.PublicKey) formats.

Protobuf type `google.cloud.kms.v1.PublicKey.PublicKeyFormat`

## Namespace

Google \\ Cloud \\ Kms \\ V1 \\ PublicKey

## Methods

### static::name

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

### static::value

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

## Constants

### PUBLIC_KEY_FORMAT_UNSPECIFIED

    Value: 0

If the
[public_key_format](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.GetPublicKeyRequest#_Google_Cloud_Kms_V1_GetPublicKeyRequest__getPublicKeyFormat__)
field is not specified:

- For PQC algorithms, an error will be returned.

- For non-PQC algorithms, the default format is PEM, and the field
  [pem](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.PublicKey#_Google_Cloud_Kms_V1_PublicKey__getPem__) will be populated.
  Otherwise, the public key will be exported through the
  [public_key](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.PublicKey#_Google_Cloud_Kms_V1_PublicKey__getPublicKey__) field in the
  requested format.

Generated from protobuf enum `PUBLIC_KEY_FORMAT_UNSPECIFIED = 0;`

### PEM

    Value: 1

The returned public key will be encoded in PEM format.

See the [RFC7468](https://tools.ietf.org/html/rfc7468) sections for
[General Considerations](https://tools.ietf.org/html/rfc7468#section-2)
and [Textual Encoding of Subject Public Key Info](https://tools.ietf.org/html/rfc7468#section-13) for more information.

Generated from protobuf enum `PEM = 1;`

### DER

    Value: 2

The returned public key will be encoded in DER format (the
PrivateKeyInfo structure from RFC 5208).

Generated from protobuf enum `DER = 2;`

### NIST_PQC

    Value: 3

This is supported only for PQC algorithms.

The key material is returned in the format defined by NIST PQC
standards (FIPS 203, FIPS 204, and FIPS 205).

Generated from protobuf enum `NIST_PQC = 3;`

### XWING_RAW_BYTES

    Value: 4

The returned public key is in raw bytes format defined in its standard
<https://datatracker.ietf.org/doc/draft-connolly-cfrg-xwing-kem>.

Generated from protobuf enum `XWING_RAW_BYTES = 4;`