Cloud Storage Client - Class CreatedHmacKey (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);

Methods

__construct

Parameters
NameDescription
hmacKey Google\Cloud\Storage\HmacKey

The HMAC Key object.

secret string

The HMAC key secret.

hmacKey

Get the HMAC key object.

Example:

$key = $response->hmacKey();
Returns
TypeDescription
Google\Cloud\Storage\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
TypeDescription
string