# Cloud Storage Client - Class CreatedHmacKey (2.3.0)

2.3.0 (latest) 2.2.0 2.1.0 2.0.0 1.51.0 1.50.0 1.49.2 1.48.7 1.47.0 1.46.0 1.45.0 1.44.0 1.43.1 1.42.1 1.41.4 1.37.0 1.36.1 1.35.0 1.34.0 1.33.4 1.32.0 1.31.2 1.30.3 Reference documentation and code samples for the Cloud Storage Client class CreatedHmacKey.

Represents a newly created HMAC key. Provides access to the key metadata and
secret.

Example:

    use Google\Cloud\Storage\StorageClient;

    $storage = new StorageClient();
    $response = $storage->createHmacKey($serviceAccountEmail);

## Namespace

Google \\ Cloud \\ Storage

## Methods

### __construct

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `hmacKey` | `https://docs.cloud.google.com/php/docs/reference/cloud-storage/latest/HmacKey` The HMAC Key object. |
| `secret` | `string` The HMAC key secret. |

### hmacKey

Get the HMAC key object.

Example:

    $key = $response->hmacKey();

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-storage/latest/HmacKey` |   |

### secret

Get the HMAC key secret.

This value will never be returned from the API after first creation. Make
sure to record it for later use immediately upon key creation.

Example:

    $secret = $response->secret();

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