# Google Cloud IoT Core V1 Client - Class PublicKeyCredential (1.7.5)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [1.7.5 (latest)](https://docs.cloud.google.com/php/docs/reference/cloud-iot/latest/V1.PublicKeyCredential)
- [1.7.4](https://docs.cloud.google.com/php/docs/reference/cloud-iot/1.7.4/V1.PublicKeyCredential)
- [1.6.4](https://docs.cloud.google.com/php/docs/reference/cloud-iot/1.6.4/V1.PublicKeyCredential)
- [1.5.12](https://docs.cloud.google.com/php/docs/reference/cloud-iot/1.5.12/V1.PublicKeyCredential)
Reference documentation and code samples for the Google Cloud IoT Core V1 Client class PublicKeyCredential.

A public key format and data.

Generated from protobuf message `google.cloud.iot.v1.PublicKeyCredential`

## Namespace

Google \\ Cloud \\ Iot \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ format` | `int` The format of the key. |
| `↳ key` | `string` The key data. |

### getFormat

The format of the key.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setFormat

The format of the key.

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

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

### getKey

The key data.

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

### setKey

The key data.

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

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